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_CAR = 200;
48 pPlayer.SendSyncJuncture(SJ_DEBUG_GET_IN_CAR, ctx);
64 static void SendDeath(
DayZPlayer pPlayer,
int pType,
float pHitDir)
70 pPlayer.SendSyncJuncture(SJ_DEATH, ctx);
73 static bool ReadDeathParams(
ParamsReadContext pCtx, out
int pType, out
float pHitDir)
75 if (!pCtx.Read(pType))
77 if (!pCtx.Read(pHitDir))
88 static void SendDamageHit(
DayZPlayer pPlayer,
int pType,
float pHitDir,
bool pFullbody)
95 pPlayer.SendSyncJuncture(SJ_DAMAGE_HIT, ctx);
98 static void SendDamageHitEx(
DayZPlayer pPlayer,
int pType,
float pHitDir,
bool pFullbody,
TotalDamageResult pDamageResult,
int pDamageType,
EntityAI pSource,
string pComponent,
string pAmmoType,
vector pModelPos)
101 SyncHitInfo data =
new SyncHitInfo;
103 data.m_AnimType = pType;
104 data.m_HitDir = pHitDir;
105 data.m_Fullbody = pFullbody;
106 data.m_HasSource = pSource !=
null;
107 if ( !pDamageResult )
109 data.m_HealthDamage = -1.0;
113 data.m_HealthDamage = pDamageResult.GetHighestDamage(
"Health");
117 pPlayer.SendSyncJuncture(SJ_DAMAGE_HIT, ctx);
120 static bool ReadDamageHitParams(
ParamsReadContext pCtx, out
int pType, out
float pHitDir, out
bool pFullbody)
122 if (!pCtx.Read(pType))
124 if (!pCtx.Read(pHitDir))
126 if (!pCtx.Read(pFullbody))
133 if (!pCtx.Read(pData))
149 pPlayer.SendSyncJuncture(SJ_INJURY, ctx);
154 if ( !pCtx.Read(pEnable) )
156 if ( !pCtx.Read(level) )
167 static void SendPlayerUnconsciousness(
DayZPlayer pPlayer,
bool enable)
173 pPlayer.SendSyncJuncture(SJ_UNCONSCIOUSNESS, ctx);
176 static bool ReadPlayerUnconsciousnessParams(
ParamsReadContext pCtx, out
bool enable)
178 if ( !pCtx.Read(enable) )
190 static void SendPlayerFBModifier(
PlayerBase pPlayer,
int type)
195 pPlayer.SendSyncJuncture(SJ_PLAYER_FB_MODIFIER, ctx);
200 if ( !pCtx.Read(type) )
210 static void SendPlayerSymptomADD(
DayZPlayer pPlayer,
int type,
int state_type)
213 ctx.Write(state_type);
217 pPlayer.SendSyncJuncture(SJ_PLAYER_ADD_MODIFIER, ctx);
222 if ( !pCtx.Read(type) )
236 ctx.Write(state_type);
238 ctx.Write(stance_mask);
242 pPlayer.SendSyncJuncture(SJ_PLAYER_STATES, ctx);
247 if ( !pCtx.Read(anim_id) )
249 if ( !pCtx.Read(stance_mask) )
251 if ( !pCtx.Read(duration) )
264 static void SendActionInterrupt(
DayZPlayer pPlayer)
267 pPlayer.SendSyncJuncture(SJ_ACTION_INTERRUPT, ctx);
279 static void SendActionAcknowledgment(
DayZPlayer pPlayer,
int AckID,
bool accept)
284 pPlayer.SendSyncJuncture(SJ_ACTION_ACK_ACCEPT, ctx);
286 pPlayer.SendSyncJuncture(SJ_ACTION_ACK_REJECT, ctx);
290 static void SendWeaponActionAcknowledgment(
DayZPlayer pPlayer,
int AckID,
bool accept)
295 pPlayer.SendSyncJuncture(SJ_WEAPON_ACTION_ACK_ACCEPT, ctx);
297 pPlayer.SendSyncJuncture(SJ_WEAPON_ACTION_ACK_REJECT, ctx);
307 if ( !pCtx.Read(amount) )
312 static void SendKuruRequest(
DayZPlayer pPlayer,
float amount)
316 pPlayer.SendSyncJuncture(SJ_KURU_REQUEST, ctx);
324 static void SendQuickbarSetShortcut(
DayZPlayer pPlayer,
EntityAI item,
int index,
bool force =
false )
331 pPlayer.SendSyncJuncture(SJ_QUICKBAR_SET_SHORTCUT, ctx);
334 static void SendWeaponJamChance(
DayZPlayer pPlayer,
float jamChance )
337 ctx.Write(jamChance);
339 pPlayer.SendSyncJuncture(SJ_WEAPON_SET_JAMMING_CHANCE, ctx);
360 pPlayer.SendSyncJuncture(SJ_DELETE_ITEM, ctx);
372 ctx.Write(canPlaySound);
373 ctx.Write(currentState);
374 ctx.Write(localState);
376 pPlayer.SendSyncJuncture(SJ_BROKEN_LEGS, ctx);
381 if ( !pCtx.Read(canPlaySound) )
383 if ( !pCtx.Read(currentState) )
385 if ( !pCtx.Read(localState) )
391 static void SendBrokenLegsEx(
DayZPlayer pPlayer,
int currentState)
394 ctx.Write(currentState);
396 pPlayer.SendSyncJuncture(SJ_BROKEN_LEGS, ctx);
401 if ( !pCtx.Read(currentState) )
412 static void SendShock(
DayZPlayer pPlayer,
float shockValue)
415 ctx.Write(shockValue);
417 pPlayer.SendSyncJuncture(SJ_SHOCK, ctx);
422 if ( !pCtx.Read(shockValue) )