6 static const int SJ_DAMAGE_HIT = 0;
7 static const int SJ_INJURY = 1;
8 static const int SJ_ACTION_INTERRUPT = 2;
9 static const int SJ_PLAYER_STATES = 3;
10 static const int SJ_QUICKBAR_SET_SHORTCUT = 4;
11 static const int SJ_INVENTORY = 5;
12 static const int SJ_ACTION_ACK_ACCEPT = 6;
13 static const int SJ_ACTION_ACK_REJECT = 7;
14 static const int SJ_WEAPON_ACTION_ACK_ACCEPT = 8;
15 static const int SJ_WEAPON_ACTION_ACK_REJECT = 9;
16 static const int SJ_WEAPON_SET_JAMMING_CHANCE = 10;
17 static const int SJ_UNCONSCIOUSNESS = 11;
18 static const int SJ_DEATH = 12;
19 static const int SJ_PLAYER_FB_MODIFIER = 13;
20 static const int SJ_PLAYER_ADD_MODIFIER = 14;
21 static const int SJ_KURU_REQUEST = 15;
22 static const int SJ_GESTURE_REQUEST = 16;
23 static const int SJ_INVENTORY_REPAIR = 17;
24 static const int SJ_WEAPON_LIFT = 18;
25 static const int SJ_WEAPON_RAISE_COMPLETED = 19;
26 static const int SJ_DELETE_ITEM = 20;
27 static const int SJ_BROKEN_LEGS = 21;
28 static const int SJ_SHOCK = 22;
29 static const int SJ_STAMINA = 23;
30 static const int SJ_STAMINA_MISC = 24;
31 static const int SJ_ADS_RESET = 25;
32 static const int SJ_INVENTORY_FAILURE = 26;
34 static const int SJ_DEBUG_GET_IN_VEHICLE = 200;
48 pPlayer.SendSyncJuncture(SJ_DEBUG_GET_IN_VEHICLE, ctx);
53 if (!pCtx.Read(vehicle))
65 static void SendDeath(
DayZPlayer pPlayer,
int pType,
float pHitDir)
71 pPlayer.SendSyncJuncture(SJ_DEATH, ctx);
74 static bool ReadDeathParams(
ParamsReadContext pCtx, out
int pType, out
float pHitDir)
76 if (!pCtx.Read(pType))
78 if (!pCtx.Read(pHitDir))
89 static void SendDamageHit(
DayZPlayer pPlayer,
int pType,
float pHitDir,
bool pFullbody)
96 pPlayer.SendSyncJuncture(SJ_DAMAGE_HIT, ctx);
99 static void SendDamageHitEx(
DayZPlayer pPlayer,
int pType,
float pHitDir,
bool pFullbody,
TotalDamageResult pDamageResult,
int pDamageType,
EntityAI pSource,
string pComponent,
string pAmmoType,
vector pModelPos)
102 SyncHitInfo data =
new SyncHitInfo;
104 data.m_AnimType = pType;
105 data.m_HitDir = pHitDir;
106 data.m_Fullbody = pFullbody;
107 data.m_HasSource = pSource != null;
108 if ( !pDamageResult )
110 data.m_HealthDamage = -1.0;
114 data.m_HealthDamage = pDamageResult.GetHighestDamage(
"Health");
118 pPlayer.SendSyncJuncture(SJ_DAMAGE_HIT, ctx);
121 static bool ReadDamageHitParams(
ParamsReadContext pCtx, out
int pType, out
float pHitDir, out
bool pFullbody)
123 if (!pCtx.Read(pType))
125 if (!pCtx.Read(pHitDir))
127 if (!pCtx.Read(pFullbody))
134 if (!pCtx.Read(pData))
150 pPlayer.SendSyncJuncture(SJ_INJURY, ctx);
155 if ( !pCtx.Read(pEnable) )
157 if ( !pCtx.Read(level) )
168 static void SendPlayerUnconsciousness(
DayZPlayer pPlayer,
bool enable)
174 pPlayer.SendSyncJuncture(SJ_UNCONSCIOUSNESS, ctx);
177 static bool ReadPlayerUnconsciousnessParams(
ParamsReadContext pCtx, out
bool enable)
179 if ( !pCtx.Read(enable) )
191 static void SendPlayerFBModifier(
PlayerBase pPlayer,
int type)
196 pPlayer.SendSyncJuncture(SJ_PLAYER_FB_MODIFIER, ctx);
201 if ( !pCtx.Read(type) )
211 static void SendPlayerSymptomADD(
DayZPlayer pPlayer,
int type,
int state_type)
214 ctx.Write(state_type);
218 pPlayer.SendSyncJuncture(SJ_PLAYER_ADD_MODIFIER, ctx);
223 if ( !pCtx.Read(type) )
237 ctx.Write(state_type);
239 ctx.Write(stance_mask);
243 pPlayer.SendSyncJuncture(SJ_PLAYER_STATES, ctx);
248 if ( !pCtx.Read(anim_id) )
250 if ( !pCtx.Read(stance_mask) )
252 if ( !pCtx.Read(duration) )
265 static void SendActionInterrupt(
DayZPlayer pPlayer)
268 pPlayer.SendSyncJuncture(SJ_ACTION_INTERRUPT, ctx);
280 static void SendActionAcknowledgment(
DayZPlayer pPlayer,
int AckID,
bool accept)
285 pPlayer.SendSyncJuncture(SJ_ACTION_ACK_ACCEPT, ctx);
287 pPlayer.SendSyncJuncture(SJ_ACTION_ACK_REJECT, ctx);
291 static void SendWeaponActionAcknowledgment(
DayZPlayer pPlayer,
int AckID,
bool accept)
296 pPlayer.SendSyncJuncture(SJ_WEAPON_ACTION_ACK_ACCEPT, ctx);
298 pPlayer.SendSyncJuncture(SJ_WEAPON_ACTION_ACK_REJECT, ctx);
308 if ( !pCtx.Read(amount) )
313 static void SendKuruRequest(
DayZPlayer pPlayer,
float amount)
317 pPlayer.SendSyncJuncture(SJ_KURU_REQUEST, ctx);
325 static void SendQuickbarSetShortcut(
DayZPlayer pPlayer,
EntityAI item,
int index,
bool force =
false )
332 pPlayer.SendSyncJuncture(SJ_QUICKBAR_SET_SHORTCUT, ctx);
335 static void SendWeaponJamChance(
DayZPlayer pPlayer,
float jamChance )
338 ctx.Write(jamChance);
340 pPlayer.SendSyncJuncture(SJ_WEAPON_SET_JAMMING_CHANCE, ctx);
361 pPlayer.SendSyncJuncture(SJ_DELETE_ITEM, ctx);
373 ctx.Write(canPlaySound);
374 ctx.Write(currentState);
375 ctx.Write(localState);
377 pPlayer.SendSyncJuncture(SJ_BROKEN_LEGS, ctx);
382 if ( !pCtx.Read(canPlaySound) )
384 if ( !pCtx.Read(currentState) )
386 if ( !pCtx.Read(localState) )
392 static void SendBrokenLegsEx(
DayZPlayer pPlayer,
int currentState)
395 ctx.Write(currentState);
397 pPlayer.SendSyncJuncture(SJ_BROKEN_LEGS, ctx);
402 if ( !pCtx.Read(currentState) )
413 static void SendShock(
DayZPlayer pPlayer,
float shockValue)
416 ctx.Write(shockValue);
418 pPlayer.SendSyncJuncture(SJ_SHOCK, ctx);
423 if ( !pCtx.Read(shockValue) )