135 return m_event.ReserveInventory();
140 m_event.ClearInventoryReservation();
212 CreateStableStates();
214 m_Taking =
new HandAnimatedTakingFromAtt(GetManOwner(), null);
215 m_MovingTo =
new HandAnimatedMovingToAtt(GetManOwner(), null);
216 m_Swapping =
new HandAnimatedSwapping(GetManOwner(), null);
217 m_FSwapping =
new HandAnimatedForceSwapping(GetManOwner(), null);
218 m_FSwappingInst =
new HandAnimatedForceSwapping_Inst(GetManOwner(), null);
221 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
222 HandEventBase _abt_ =
new HandEventHumanCommandActionAborted;
231 m_FSM.AddTransition(
new HandTransition( m_Empty , __T__,
m_Taking, NULL,
new HandGuardAnd(
new HandSelectAnimationOfTakeToHandsEvent(GetManOwner()),
new HandGuardIsNotSurrendered(GetManOwner()))));
232 m_FSM.AddTransition(
new HandTransition(
m_Taking , _fin_, m_Empty, null,
new HandGuardNot(
new HandGuardHasItemInHands(GetManOwner()))));
234 m_FSM.AddTransition(
new HandTransition(
m_Taking , __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
238 m_FSM.AddTransition(
new HandTransition( m_Equipped, __M__,
m_MovingTo, NULL,
new HandSelectAnimationOfMoveFromHandsEvent(GetManOwner())));
239 m_FSM.AddTransition(
new HandTransition(
m_MovingTo, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
240 m_FSM.AddTransition(
new HandTransition(
m_MovingTo, _fin_, m_Equipped, null,
new HandGuardHasItemInHands(GetManOwner())));
245 m_FSM.AddTransition(
new HandTransition( m_Equipped, __W__,
m_Swapping, NULL,
new HandGuardAnd(
new HandSelectAnimationOfSwapInHandsEvent(GetManOwner()),
new HandGuardIsNotSurrendered(GetManOwner()))));
246 m_FSM.AddTransition(
new HandTransition(
m_Swapping, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
247 m_FSM.AddTransition(
new HandTransition(
m_Swapping, _fin_, m_Empty, null,
new HandGuardNot(
new HandGuardHasItemInHands(GetManOwner()))));
254 m_FSM.AddTransition(
new HandTransition(
m_FSwappingInst, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
258 m_FSM.AddTransition(
new HandTransition(
m_FSwapping, _fin_, m_Equipped, null,
new HandGuardHasItemInHands(GetManOwner())));
260 m_FSM.AddTransition(
new HandTransition(
m_FSwapping, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
291 if (hcw && weapon && weapon.CanProcessWeaponEvents() && !weapon.IsIdle())
295 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
298 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
328 string secondPart =
" - ENTITY IN HANDS IS NOT A WEAPON: " +
Object.GetDebugName(GetEntityInHands());
330 string firstPart =
"[wpnfsm] " +
Object.GetDebugName(GetInventoryOwner()) +
" failed to perform weaponevent " +
m_DeferredWeaponEvent.DumpToString();
333 secondPart =
" on " +
Object.GetDebugName(GetEntityInHands()) +
" which is in state " + weapon.GetCurrentState();
334 secondPart +=
" with physical state: J: " + weapon.IsJammed() +
" | ";
335 for (
int i = 0; i < weapon.GetMuzzleCount(); ++i)
337 secondPart +=
"Chamber_" + i +
": B(" + weapon.IsChamberFull(i) +
") F(" + weapon.IsChamberFiredOut(i) +
") E(" + weapon.IsChamberEmpty(i) +
") | ";
338 secondPart +=
"Magazine_" + i +
": " + weapon.GetMagazine(i);
339 if (i < weapon.GetMuzzleCount() - 1)
344 Error(firstPart + secondPart);
357 weapon.UpdateCoolDown(dt);
358 if (hcw && weapon.CanProcessWeaponEvents())
361 weapon.GetCurrentState().OnUpdate(dt);
368 if (!weapon.IsIdle())
372 int weaponEventId = hcw.
IsEvent();
373 if (weaponEventId == -1)
387 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" HandleWeapons: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
390 if (anim_event != NULL)
392 weapon.ProcessWeaponEvent(anim_event);
398 if (weapon.IsWaitingForActionFinish())
402 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: finished! notifying waiting state=" + weapon.GetCurrentState());
405 weapon.ProcessWeaponEvent(
new WeaponEventHumanCommandActionFinished(
GetDayZPlayerOwner()));
411 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
414 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
428 exitIronSights =
true;
460 #ifdef ENABLE_LOGGING
467 if ( !fsmState.
IsIdle() || !m_FSM.IsRunning())
471 int weaponEventId = hcw.
IsEvent();
472 if (weaponEventId == -1)
479 #ifdef ENABLE_LOGGING
482 hndDebugPrint(
"[hndfsm] HandleInventory: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
486 if (anim_event != NULL)
489 ProcessHandEvent(anim_event);
497 #ifdef ENABLE_LOGGING
500 hndDebugPrint(
"[hndfsm] Hand-Weapon event: finished! notifying waiting state=" + fsmState);
504 HandEventBase fin_event =
new HandEventHumanCommandActionFinished(GetManOwner());
506 ProcessHandEvent(fin_event);
510 #ifdef ENABLE_LOGGING
513 hndDebugPrint(
"[hndfsm] Hand-Weapon event: ABORT! notifying running state=" + fsmState);
517 HandEventBase abt_event =
new HandEventHumanCommandActionAborted(GetManOwner());
519 ProcessHandAbortEvent(abt_event);
574 if (
g_Game.IsDedicatedServer())
579 int udtIdentifier = -1;
635 if (!ctx.
Read(reason))
670 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsOldProcessInputDataEnable())
735 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsOldProcessInputDataEnable())
748 Error(
"OnHandleStoredInputUserData - Client");
771 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsOldProcessInputDataEnable())
794 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsOldProcessInputDataEnable())
801 Error(
"OnServerInventoryCommand Should not happen");
818 #ifdef ENABLE_LOGGING
828 if (validation.
m_IsRemote && (!itemSrc || !itemDst))
849 #ifdef ENABLE_LOGGING
857 syncDebugPrint(
"[syncinv] HandleInputData Failed - src and dst are for different items src item =" + itemSrc +
" dst item =" + itemDst);
897 #ifdef DIAG_DEVELOPER
898 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
903 src.
GetItem().GetInventory().GetCurrentInventoryLocation(realIl);
907 itemsToRepair.Insert(src.
GetItem());
910 #ifdef DIAG_DEVELOPER
965 #ifdef ENABLE_LOGGING
975 LocationSyncMoveEntity(src, dst);
983 #ifdef ENABLE_LOGGING
992 #ifdef ENABLE_LOGGING
995 DumpInventoryDebug();
1013 #ifdef ENABLE_LOGGING
1028 bool hasJuncture =
false;
1029 if (itemSrc != null && itemDst != null)
1033 else if (itemSrc != null)
1037 else if (itemDst != null)
1044#ifdef ENABLE_LOGGING
1073 #ifdef ENABLE_LOGGING
1076 DumpInventoryDebug();
1090 #ifdef ENABLE_LOGGING
1093 DumpInventoryDebug();
1111 #ifdef ENABLE_LOGGING
1120 #ifdef ENABLE_LOGGING
1129 LocationSyncMoveEntity(src, dst);
1140 bool success =
true;
1147#ifdef ENABLE_LOGGING
1157 if (success && itemSrc != itemDst)
1159#ifdef ENABLE_LOGGING
1167 syncDebugPrint(
"[syncinv] ValidateSyncMoveServer Failed - src and dst are for different items src item =" + itemSrc +
" dst item =" + itemDst);
1178#ifdef ENABLE_LOGGING
1193#ifdef DIAG_DEVELOPER
1194 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
1199 src.
GetItem().GetInventory().GetCurrentInventoryLocation(realIl);
1203 itemsToRepair.Insert(src.
GetItem());
1206#ifdef DIAG_DEVELOPER
1213#ifdef ENABLE_LOGGING
1233#ifdef ENABLE_LOGGING
1243#ifdef ENABLE_LOGGING
1252 LocationSyncMoveEntity(src, dst);
1260#ifdef ENABLE_LOGGING
1269#ifdef ENABLE_LOGGING
1272 DumpInventoryDebug();
1291#ifdef ENABLE_LOGGING
1317#ifdef ENABLE_LOGGING
1328 #ifdef ENABLE_LOGGING
1336 bool hasJuncture =
false;
1337 if (itemSrc != null && itemDst != null)
1341 else if (itemSrc != null)
1345 else if (itemDst != null)
1352#ifdef ENABLE_LOGGING
1368#ifdef ENABLE_LOGGING
1379#ifdef ENABLE_LOGGING
1389#ifdef ENABLE_LOGGING
1395 return LocationSyncMoveEntity(src, dst);
1412#ifdef ENABLE_LOGGING
1423 #ifdef ENABLE_LOGGING
1435#ifdef ENABLE_LOGGING
1446#ifdef ENABLE_LOGGING
1455#ifdef ENABLE_LOGGING
1461 return LocationSyncMoveEntity(src, dst);
1474#ifdef ENABLE_LOGGING
1484 if (!itemSrc || !itemDst)
1486#ifdef ENABLE_LOGGING
1502#ifdef ENABLE_LOGGING
1509#ifdef ENABLE_LOGGING
1516 return LocationSyncMoveEntity(src, dst);
1522 bool success =
true;
1535 EntityAI itemSrc = e.GetSrcEntity();
1538 #ifdef ENABLE_LOGGING
1541 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1547 Error(
"[syncinv] Inventory owner " + GetManOwner() +
" and event sender " + e.m_Player +
" do not match.");
1553 Error(
"[syncinv] ValidateHandEvent This event " + e.GetDebugName() +
" should not be use for synchronization.");
1563 srcNew.
Copy(e.GetSrc());
1566 Error(
"[syncinv] HandleInputData remote swap event REPLACED with TAKE (cmd=HAND_EVENT, event=" + e.
DumpToString() +
"), src item is null! Continuing.");
1570 #ifdef ENABLE_LOGGING
1573 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1577 Error(
"[syncinv] HandleInputData remote input (cmd=HAND_EVENT, event=" + e.
DumpToString() +
") dropped, item not in bubble");
1594 #ifdef ENABLE_LOGGING
1597 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1613 #ifdef DIAG_DEVELOPER
1614 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
1624 itemSrc.GetInventory().GetCurrentInventoryLocation(repairIl);
1626 if(e.GetSrc() != repairIl)
1628 itemsToRepair.Insert(itemSrc);
1631 if(itemDst && itemSrc != itemDst )
1633 itemDst.GetInventory().GetCurrentInventoryLocation(repairIl);
1636 itemsToRepair.Insert(itemDst);
1640 if (itemsToRepair.Count())
1644 #ifdef DIAG_DEVELOPER
1654 if (success && !e.CheckRequestEx(validation))
1656 #ifdef ENABLE_LOGGING
1659 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1668#ifdef ENABLE_LOGGING
1692 #ifdef ENABLE_LOGGING
1695 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1704#ifdef ENABLE_LOGGING
1741 #ifdef ENABLE_LOGGING
1744 Debug.
InventoryMoveLog(
"Juncture not required",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1752 #ifdef ENABLE_LOGGING
1755 Debug.
InventoryMoveLog(
"Juncture sended",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1772 #ifdef ENABLE_LOGGING
1775 Debug.
InventoryMoveLog(
"Juncture denied",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1787 bool hasJuncture =
false;
1789 if (itemSrc != null && itemDst != null)
1793 else if (itemSrc != null)
1797 else if (itemDst != null)
1804#ifdef ENABLE_LOGGING
1820 #ifdef ENABLE_LOGGING
1823 Debug.
InventoryMoveLog(
"Success - ProcessHandEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1830 if (!e.m_Player.GetHumanInventory().ProcessHandEvent(e))
1842 bool success =
true;
1845 if (e.m_Player != GetManOwner())
1847 Error(
"[syncinv] Inventory owner " + GetManOwner() +
" and event sender " + e.m_Player +
" not match.");
1851 e.m_IsJuncture =
false;
1852 e.m_IsRemote =
false;
1854 EntityAI itemSrc = e.GetSrcEntity();
1857#ifdef ENABLE_LOGGING
1860 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1866 Error(
"[syncinv] ValidateHandEvent This event " + e.GetDebugName() +
" should not be use for synchronization.");
1883#ifdef ENABLE_LOGGING
1886 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1894#ifdef DIAG_DEVELOPER
1895 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
1902 itemSrc.GetInventory().GetCurrentInventoryLocation(repairIl);
1904 if(e.GetSrc() != repairIl)
1906 itemsToRepair.Insert(itemSrc);
1909 if(itemDst && itemSrc != itemDst )
1911 itemDst.GetInventory().GetCurrentInventoryLocation(repairIl);
1914 itemsToRepair.Insert(itemDst);
1918 if (itemsToRepair.Count())
1923#ifdef DIAG_DEVELOPER
1928 if (success && !e.CheckRequestEx(validation))
1930#ifdef ENABLE_LOGGING
1933 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1942#ifdef ENABLE_LOGGING
1954#ifdef ENABLE_LOGGING
1957 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1966#ifdef ENABLE_LOGGING
1991#ifdef ENABLE_LOGGING
1994 Debug.
InventoryMoveLog(
"Juncture not required",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1998#ifdef ENABLE_LOGGING
2001 Debug.
InventoryMoveLog(
"Success - ProcessHandEvent",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
2005 return e.m_Player.GetHumanInventory().ProcessHandEvent(e);
2010#ifdef ENABLE_LOGGING
2013 Debug.
InventoryMoveLog(
"Juncture sended",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
2034#ifdef ENABLE_LOGGING
2037 Debug.
InventoryMoveLog(
"Juncture denied",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
2051 e.m_IsJuncture =
true;
2052 e.m_IsRemote =
false;
2054 EntityAI itemSrc = e.GetSrcEntity();
2057#ifdef ENABLE_LOGGING
2060 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandServer", e.m_Player.ToString() );
2081 if (!e.CheckRequestEx(validation))
2083#ifdef ENABLE_LOGGING
2086 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandServer", e.m_Player.ToString() );
2095#ifdef ENABLE_LOGGING
2108#ifdef ENABLE_LOGGING
2111 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandServer", e.m_Player.ToString() );
2120#ifdef ENABLE_LOGGING
2130 bool hasJuncture =
false;
2132 if (itemSrc != null && itemDst != null)
2136 else if (itemSrc != null)
2140 else if (itemDst != null)
2147#ifdef ENABLE_LOGGING
2160#ifdef ENABLE_LOGGING
2163 Debug.
InventoryMoveLog(
"Success",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandServer", e.m_Player.ToString() );
2167 return e.m_Player.GetHumanInventory().ProcessHandEvent(e);
2175 e.m_IsJuncture =
true;
2176 e.m_IsRemote =
false;
2178 EntityAI itemSrc = e.GetSrcEntity();
2181#ifdef ENABLE_LOGGING
2184 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandClient", e.m_Player.ToString() );
2205 if (!e.CheckRequestEx(validation))
2207#ifdef ENABLE_LOGGING
2210 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandClient", e.m_Player.ToString() );
2219#ifdef ENABLE_LOGGING
2232#ifdef ENABLE_LOGGING
2235 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandClient", e.m_Player.ToString() );
2244#ifdef ENABLE_LOGGING
2254#ifdef ENABLE_LOGGING
2257 Debug.
InventoryMoveLog(
"Success",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandClient", e.m_Player.ToString() );
2261 return e.m_Player.GetHumanInventory().ProcessHandEvent(e);
2268 e.m_IsJuncture =
true;
2269 e.m_IsRemote =
true;
2271 EntityAI itemSrc = e.GetSrcEntity();
2274#ifdef ENABLE_LOGGING
2277 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2287 srcNew.
Copy(e.GetSrc());
2290 Error(
"[syncinv] ExecuteHandEventCommandRemote remote swap event REPLACED with TAKE (cmd=HAND_EVENT, event=" + e.
DumpToString() +
"), src item is null! Continuing.");
2294#ifdef ENABLE_LOGGING
2297 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2301 Error(
"[syncinv] ExecuteHandEventCommandRemote remote input (cmd=HAND_EVENT, event=" + e.
DumpToString() +
") dropped, item not in bubble");
2323 if (!e.CheckRequestEx(validation))
2325#ifdef ENABLE_LOGGING
2328 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2337#ifdef ENABLE_LOGGING
2347#ifdef ENABLE_LOGGING
2350 Debug.
InventoryMoveLog(
"Success",
"HAND_EVENT" ,
"n/a",
"ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2354 return e.m_Player.GetHumanInventory().ProcessHandEvent(e);
2361 if (!swapValidation)
2367 #ifdef ENABLE_LOGGING
2379 LocationSyncMoveEntity(swapValidation.
m_Src1, swapValidation.
m_Dst1);
2386 LocationSyncMoveEntity(swapValidation.
m_Src2, swapValidation.
m_Dst2);
2394 #ifdef ENABLE_LOGGING
2397 Debug.
InventoryMoveLog(
"Remote - skipped",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString() );
2404 #ifdef ENABLE_LOGGING
2407 Debug.
InventoryMoveLog(
"Failed - item1 or item2 not exist",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString() );
2411 Error(
"[syncinv] HandleInputData remote input (cmd=SWAP) dropped, item not in bubble");
2423 #ifdef ENABLE_LOGGING
2435 syncDebugPrint(
"[syncinv] HandleInputData Failed - first src and dst are for different items src item =" + swapValidation.
m_SrcItem1 +
" dst item =" + swapValidation.
m_DstItem1);
2437 syncDebugPrint(
"[syncinv] HandleInputData Failed - second src and dst are for different items src item =" + swapValidation.
m_SrcItem1 +
" dst item =" + swapValidation.
m_DstItem1);
2456 #ifdef ENABLE_LOGGING
2459 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc1",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString() );
2474 #ifdef DIAG_DEVELOPER
2475 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
2481 swapValidation.
m_SrcItem1.GetInventory().GetCurrentInventoryLocation(repairIl);
2483 if(swapValidation.
m_Src1 != repairIl)
2485 itemsToRepair.Insert(swapValidation.
m_SrcItem1);
2488 swapValidation.
m_SrcItem2.GetInventory().GetCurrentInventoryLocation(repairIl);
2489 if(swapValidation.
m_Src2 != repairIl)
2491 itemsToRepair.Insert(swapValidation.
m_SrcItem2);
2494 if (itemsToRepair.Count())
2498 #ifdef DIAG_DEVELOPER
2513 #ifdef ENABLE_LOGGING
2516 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc2",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString() );
2531 #ifdef DIAG_DEVELOPER
2532 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
2538 swapValidation.
m_SrcItem2.GetInventory().GetCurrentInventoryLocation(repairIl);
2539 if(swapValidation.
m_Src2 != repairIl)
2541 itemsToRepair.Insert(swapValidation.
m_SrcItem2);
2544 if (itemsToRepair.Count())
2548 #ifdef DIAG_DEVELOPER
2563 #ifdef ENABLE_LOGGING
2566 Debug.
InventoryMoveLog(
"Failed - CheckSwapItemsRequest",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString());
2602 #ifdef ENABLE_LOGGING
2604 DumpInventoryDebug();
2609 Debug.
InventoryMoveLog(
"Failed - CanForceSwapEntitiesEx",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString());
2615 if (swapValidation.
m_Dst1)
2618 if (swapValidation.
m_Dst2)
2649 #ifdef ENABLE_LOGGING
2660 #ifdef ENABLE_LOGGING
2674 #ifdef ENABLE_LOGGING
2689 bool hasJuncture =
false;
2690 int nonNullCount = 0;
2691 bool failed =
false;
2700 if (!failed && swapValidation.
m_SrcItem2 != null)
2707 if (!failed && swapValidation.
m_DstItem1 != null)
2714 if (!failed && swapValidation.
m_DstItem2 != null)
2721 hasJuncture = (nonNullCount > 0 && !failed);
2725#ifdef ENABLE_LOGGING
2750 #ifdef ENABLE_LOGGING
2753 Debug.
InventoryMoveLog(
"Failed - !SwapCheckExclusionMaskLocal - condition failed locally",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString() );
2759 #ifdef ENABLE_LOGGING
2762 Debug.
InventoryMoveLog(
"Success - item swap",
"SWAP" ,
"n/a",
"ProcessInputData", playerOwner.ToString() );
2768 bool isNotSkipped = LocationSwap(swapValidation.
m_Src1, swapValidation.
m_Src2, swapValidation.
m_Dst1, swapValidation.
m_Dst2);
2781 if (!swapValidation)
2789#ifdef ENABLE_LOGGING
2801 #ifdef ENABLE_LOGGING
2818 syncDebugPrint(
"[syncinv] ValidateSwapServer Failed - first src and dst are for different items src item =" + swapValidation.
m_SrcItem1 +
" dst item =" + swapValidation.
m_DstItem1);
2822 syncDebugPrint(
"[syncinv] ValidateSwapServer Failed - second src and dst are for different items src item =" + swapValidation.
m_SrcItem1 +
" dst item =" + swapValidation.
m_DstItem1);
2835#ifdef ENABLE_LOGGING
2838 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc1",
"SWAP" ,
"n/a",
"ValidateSwapServer", playerOwner.ToString() );
2851#ifdef DIAG_DEVELOPER
2852 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
2858 swapValidation.
m_SrcItem1.GetInventory().GetCurrentInventoryLocation(repairIl);
2860 if(swapValidation.
m_Src1 != repairIl)
2862 itemsToRepair.Insert(swapValidation.
m_SrcItem1);
2865 swapValidation.
m_SrcItem2.GetInventory().GetCurrentInventoryLocation(repairIl);
2866 if(swapValidation.
m_Src2 != repairIl)
2868 itemsToRepair.Insert(swapValidation.
m_SrcItem2);
2871 if (itemsToRepair.Count())
2875#ifdef DIAG_DEVELOPER
2885 #ifdef ENABLE_LOGGING
2888 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc2",
"SWAP" ,
"n/a",
"ValidateSwapServer", playerOwner.ToString() );
2901#ifdef DIAG_DEVELOPER
2902 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
2908 swapValidation.
m_SrcItem2.GetInventory().GetCurrentInventoryLocation(repairIl);
2909 if(swapValidation.
m_Src2 != repairIl)
2911 itemsToRepair.Insert(swapValidation.
m_SrcItem2);
2914 if (itemsToRepair.Count())
2918#ifdef DIAG_DEVELOPER
2928#ifdef ENABLE_LOGGING
2931 Debug.
InventoryMoveLog(
"Failed - CheckSwapItemsRequest",
"SWAP" ,
"n/a",
"ValidateSwapServer", playerOwner.ToString());
2954#ifdef ENABLE_LOGGING
2956 DumpInventoryDebug();
2961 Debug.
InventoryMoveLog(
"Failed - CanForceSwapEntitiesEx",
"SWAP" ,
"n/a",
"ValidateSwapServer", playerOwner.ToString());
2965 if (swapValidation.
m_Dst1)
2970 if (swapValidation.
m_Dst2)
2989#ifdef ENABLE_LOGGING
2992 Debug.
InventoryMoveLog(
"Success - item swap without juncture",
"SWAP" ,
"n/a",
"ValidateSwapServer", playerOwner.ToString() );
2998 bool isNotSkipped = LocationSwap(swapValidation.
m_Src1, swapValidation.
m_Src2, swapValidation.
m_Dst1, swapValidation.
m_Dst2);
3008#ifdef ENABLE_LOGGING
3022#ifdef ENABLE_LOGGING
3042 if (!swapValidation)
3047#ifdef ENABLE_LOGGING
3063 bool hasJuncture =
false;
3064 int nonNullCount = 0;
3065 bool failed =
false;
3076 if (!failed && swapValidation.
m_SrcItem2 != null)
3085 if (!failed && swapValidation.
m_DstItem1 != null)
3094 if (!failed && swapValidation.
m_DstItem2 != null)
3103 hasJuncture = (nonNullCount > 0 && !failed);
3107#ifdef ENABLE_LOGGING
3122#ifdef ENABLE_LOGGING
3125 Debug.
InventoryMoveLog(
"Failed - !SwapCheckExclusionMaskLocal - condition failed locally",
"SWAP" ,
"n/a",
"ExecuteSwapCommandServer", playerOwner.ToString() );
3133#ifdef ENABLE_LOGGING
3136 Debug.
InventoryMoveLog(
"Failed - !CanForceSwapEntitiesEx",
"SWAP" ,
"n/a",
"ExecuteSwapCommandServer", playerOwner.ToString() );
3142#ifdef ENABLE_LOGGING
3145 Debug.
InventoryMoveLog(
"Success - item swap",
"SWAP" ,
"n/a",
"ExecuteSwapCommandServer", playerOwner.ToString() );
3151 bool isNotSkipped = LocationSwap(swapValidation.
m_Src1, swapValidation.
m_Src2, swapValidation.
m_Dst1, swapValidation.
m_Dst2);
3164 if (!swapValidation)
3169#ifdef ENABLE_LOGGING
3190#ifdef ENABLE_LOGGING
3193 Debug.
InventoryMoveLog(
"Failed - !SwapCheckExclusionMaskLocal - condition failed locally",
"SWAP" ,
"n/a",
"ExecuteSwapCommandClient", playerOwner.ToString() );
3201#ifdef ENABLE_LOGGING
3204 Debug.
InventoryMoveLog(
"Failed - !CanForceSwapEntitiesEx",
"SWAP" ,
"n/a",
"ExecuteSwapCommandClient", playerOwner.ToString() );
3210#ifdef ENABLE_LOGGING
3213 Debug.
InventoryMoveLog(
"Success - item swap",
"SWAP" ,
"n/a",
"ExecuteSwapCommandClient", playerOwner.ToString() );
3219 bool isNotSkipped = LocationSwap(swapValidation.
m_Src1, swapValidation.
m_Src2, swapValidation.
m_Dst1, swapValidation.
m_Dst2);
3231 if (!swapValidation)
3236#ifdef ENABLE_LOGGING
3248 LocationSyncMoveEntity(swapValidation.
m_Src1, swapValidation.
m_Dst1);
3254 LocationSyncMoveEntity(swapValidation.
m_Src2, swapValidation.
m_Dst2);
3261#ifdef ENABLE_LOGGING
3264 Debug.
InventoryMoveLog(
"Remote - skipped",
"SWAP" ,
"n/a",
"ExecuteSwapCommandRemote", playerOwner.ToString() );
3271#ifdef ENABLE_LOGGING
3274 Debug.
InventoryMoveLog(
"Failed - item1 or item2 not exist",
"SWAP" ,
"n/a",
"ExecuteSwapCommandRemote", playerOwner.ToString() );
3278 Error(
"[syncinv] ExecuteSwapCommandRemote remote input (cmd=SWAP) dropped, item not in bubble");
3297#ifdef ENABLE_LOGGING
3300 Debug.
InventoryMoveLog(
"Success - item swap",
"SWAP" ,
"n/a",
"ExecuteSwapCommandRemote", playerOwner.ToString() );
3306 bool isNotSkipped = LocationSwap(swapValidation.
m_Src1, swapValidation.
m_Src2, swapValidation.
m_Dst1, swapValidation.
m_Dst2);
3321 if (isJuncture && isRemote)
3328 if (!ctx.
Read(type))
3344 if (!ValidateUserReservationCancel(serializer, validation))
3376 if (canSendJuncture)
3382 writeableSerializer.
CopyFrom(serializer);
3383 serializer = writeableSerializer;
3392 if (canSendJuncture)
3399 Error(
"InventoryValidationResult.JUNCTURE returned when not possible to send!");
3413 if (!ctx.
Read(type))
3429 if (!ValidateUserReservationCancel(serializer, validation))
3460#ifdef ENABLE_LOGGING
3470 writeableSerializer.
CopyFrom(serializer);
3471 serializer = writeableSerializer;
3478#ifdef ENABLE_LOGGING
3487#ifdef ENABLE_LOGGING
3504 if (!ctx.
Read(type))
3515 Error(
"JunctureServer - InventoryCommandType.USER_RESERVATION_CANCEL");
3520#ifdef ENABLE_LOGGING
3532#ifdef ENABLE_LOGGING
3544#ifdef ENABLE_LOGGING
3557#ifdef ENABLE_LOGGING
3572 if (!ctx.
Read(type))
3583 Error(
"JunctureClient - InventoryCommandType.USER_RESERVATION_CANCEL");
3588#ifdef ENABLE_LOGGING
3600#ifdef ENABLE_LOGGING
3612#ifdef ENABLE_LOGGING
3625#ifdef ENABLE_LOGGING
3636 if (!ctx.
Read(type))
3647 if (!ExecuteUserReservationCancelRemote(serializer))
3674#ifdef ENABLE_LOGGING
3687 itemIB.SetCanBeMovedOverride(
false);
3694 itemIB.SetCanBeMovedOverride(
true);
3700 Rope rope = Rope.Cast(src.
GetItem());
3702 rope.SetTargetLocation(dst);
3714 #ifdef ENABLE_LOGGING
3730 if (GetManOwner().IsAlive() ==
false)
3731 return super.TakeToDst(mode, src, dst);
3733 #ifdef ENABLE_LOGGING
3743 if (RedirectToHandEvent(mode, src, dst))
3745 #ifdef ENABLE_LOGGING
3756 if (
GetDayZPlayerOwner().NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
3760#ifdef ENABLE_LOGGING
3769#ifdef ENABLE_LOGGING
3791#ifdef ENABLE_LOGGING
3800 #ifdef ENABLE_LOGGING
3809 LocationSyncMoveEntity(src, dst);
3812 if (!super.TakeToDst(mode,src,dst))
3821 if (!super.PostDeferredEventTakeToDst(mode,src,dst))
3838 if( deferred_take_to_dst )
3840 #ifdef ENABLE_LOGGING
3847 deferred_take_to_dst.ClearInventoryReservation(
this);
3854 switch (deferred_take_to_dst.m_mode)
3857 #ifdef ENABLE_LOGGING
3864 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
3866 #ifdef DIAG_DEVELOPER
3867 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
3869 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3875 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3876 #ifdef DIAG_DEVELOPER
3882 #ifdef ENABLE_LOGGING
3891 #ifdef ENABLE_LOGGING
3898 if (LocationCanMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst))
3900 #ifdef DIAG_DEVELOPER
3901 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
3903 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3912 #ifdef DIAG_DEVELOPER
3918 #ifdef ENABLE_LOGGING
3927 #ifdef ENABLE_LOGGING
3935 #ifdef ENABLE_LOGGING
3943 Error(
"HandEvent - Invalid mode");
3951 #ifdef ENABLE_LOGGING
3963 LocationSwap(src1, src2, dst1, dst2);
3968 if(!super.SwapEntities(mode,item1,item2))
3980 if (!super.PostDeferredForceSwapEntities(mode, item1, item2, dst1, dst2))
3997 if( deferred_swap_entities )
4008 switch (deferred_swap_entities.
m_mode)
4013 #ifdef DIAG_DEVELOPER
4014 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4016 LocationSwap(src1, src2, deferred_swap_entities.
m_dst1, deferred_swap_entities.
m_dst2);
4023 LocationSwap(src1, src2, deferred_swap_entities.
m_dst1, deferred_swap_entities.
m_dst2);
4025 #ifdef DIAG_DEVELOPER
4031 #ifdef ENABLE_LOGGING
4043 #ifdef DIAG_DEVELOPER
4044 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4046 LocationSwap(src1, src2, deferred_swap_entities.
m_dst1, deferred_swap_entities.
m_dst2);
4059 #ifdef DIAG_DEVELOPER
4065 #ifdef ENABLE_LOGGING
4078 Error(
"SwapEntities - HandEvent - Invalid mode");
4082 Error(
"SwapEntities - MakeSrcAndDstForSwap - no inv loc");
4088 #ifdef ENABLE_LOGGING
4100 LocationSwap(src1, src2, dst1, item2_dst);
4106 if(!super.ForceSwapEntities(mode,item1,item2,item2_dst))
4120 if (deferred_force_swap_entities)
4122 deferred_force_swap_entities.ClearInventoryReservation(
this);
4125 deferred_force_swap_entities.m_item1.GetInventory().GetCurrentInventoryLocation(src1);
4126 deferred_force_swap_entities.m_item2.GetInventory().GetCurrentInventoryLocation(src2);
4135 switch (deferred_force_swap_entities.m_mode)
4138 if (CanForceSwapEntitiesEx(deferred_force_swap_entities.m_dst1.GetItem(),deferred_force_swap_entities.m_dst1,deferred_force_swap_entities.m_dst2.GetItem(), deferred_force_swap_entities.m_dst2))
4140 #ifdef DIAG_DEVELOPER
4141 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4143 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
4149 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
4150 #ifdef DIAG_DEVELOPER
4156 #ifdef ENABLE_LOGGING
4166 if (CanForceSwapEntitiesEx(deferred_force_swap_entities.m_dst1.GetItem(), deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2.GetItem(), deferred_force_swap_entities.m_dst2))
4168 #ifdef DIAG_DEVELOPER
4169 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4171 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
4182 #ifdef DIAG_DEVELOPER
4188 #ifdef ENABLE_LOGGING
4201 Error(
"ForceSwapEntities - HandEvent - Invalid mode");
4212 Error(
"[syncinv] " +
Object.GetDebugName(player) +
" SendServerHandEventViaJuncture - called on server side event only, e=" + e.
DumpToString());
4215 if (player.IsAlive())
4223#ifdef ENABLE_LOGGING
4232#ifdef ENABLE_LOGGING
4241#ifdef ENABLE_LOGGING
4250#ifdef ENABLE_LOGGING
4261#ifdef ENABLE_LOGGING
4274 Error(
"[syncinv] SendServerHandEventViaJuncture - called on dead player, juncture is for living only");
4284 super.NetSyncCurrentStateID(
id);
4305 if (GetEntityInHands())
4315 pb.GetWeaponManager().SetRunning(
true);
4319 fsmDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(wpn) +
" recv event from remote: created event=" + e);
4324 wpn.ProcessWeaponAbortEvent(e);
4328 wpn.ProcessWeaponEvent(e);
4330 pb.GetWeaponManager().SetRunning(
false);
4334 Error(
"OnEventForRemoteWeapon - entity in hands, but not weapon. item=" + GetEntityInHands());
4337 Error(
"OnEventForRemoteWeapon - no entity in hands");
4352 hndDebugSpam(
"[hndfsm] recv event from remote: created event=" + e);
4357 if (e.GetEventID() ==
HandEventID.HUMANCOMMAND_ACTION_ABORTED)
4360 m_FSM.ProcessAbortEvent(e, aa);
4364 m_FSM.ProcessEvent(e);
4384 hndDebugPrint(
"[hndfsm] send 2 remote: sending e=" + e +
" id=" + e.GetEventID() +
" p=" + p +
" e=" + e.
DumpToString());
4387 p.StoreInputForRemotes(ctx);
4393 super.OnHandsExitedStableState(src, dst);
4397 hndDebugPrint(
"[hndfsm] hand fsm exit stable src=" + src.Type().ToString());
4403 super.OnHandsEnteredStableState(src, dst);
4407 hndDebugPrint(
"[hndfsm] hand fsm entered stable dst=" + dst.Type().ToString());
4413 super.OnHandsStateChanged(src, dst);
4417 hndDebugPrint(
"[hndfsm] hand fsm changed state src=" + src.Type().ToString() +
" ---> dst=" + dst.Type().ToString());
4430 p.m_Bot.ProcessEvent(
new BotEventOnItemInHandsChanged(p));
4439 EntityAI itemInHands = GetEntityInHands();
4442 il.
SetHands(GetInventoryOwner(), itemInHands);
4445 validation.
m_Mode = mode;
4480 if (!deferred_hand_event)
4492 if (deferred_hand_event)
4494 #ifdef ENABLE_LOGGING
4508 switch (deferred_hand_event.
m_mode)
4511 #ifdef ENABLE_LOGGING
4521 #ifdef DIAG_DEVELOPER
4522 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4524 ProcessHandEvent(deferred_hand_event.
m_event);
4530 ProcessHandEvent(deferred_hand_event.
m_event);
4531 #ifdef DIAG_DEVELOPER
4538 #ifdef ENABLE_LOGGING
4548 #ifdef DIAG_DEVELOPER
4549 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4551 ProcessHandEvent(deferred_hand_event.
m_event);
4568 #ifdef DIAG_DEVELOPER
4575 #ifdef ENABLE_LOGGING
4583 ProcessHandEvent(deferred_hand_event.
m_event);
4588 #ifdef ENABLE_LOGGING
4613 ProcessHandEvent(deferred_hand_event.
m_event);
4618 Error(
"HumanInventory::HandEvent - Invalid mode");
4625 super.HandleInventoryManipulation();
4656 if (player.IsAlive())
4658 if (!player.IsRestrained() && !player.IsUnconscious())
4674 EntityAI item = src.GetItem().GetHierarchyRoot();
4675 EntityAI root = item.GetHierarchyRoot();
4694 if (player.IsAlive())
4696 if (!player.IsRestrained() && !player.IsUnconscious())
4705 if (!LocationCanMoveEntity(src, dst))
4713 result = CheckMoveToDstRequest( GetManOwner(), src, dst, radius);
4718 EntityAI item = dst.GetItem().GetHierarchyRoot();
4719 EntityAI root = item.GetHierarchyRoot();
4728 #ifdef DIAG_DEVELOPER
4729 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
4733 switch(dst.GetType())
4737 CargoBase cargo = dst.GetParent().GetInventory().GetCargo();
4741 itemInCargo.GetInventory().GetCurrentInventoryLocation(ilCargoItem);
4742 if (dst.CollidesWith(ilCargoItem))
4744 itemsToRepair.Insert(itemInCargo);
4749 EntityAI entityInAttachment = dst.GetParent().GetInventory().FindAttachment(dst.GetSlot());
4751 if(entityInAttachment)
4753 itemsToRepair.Insert(entityInAttachment);
4757 EntityAI entityInHands = GetEntityInHands();
4760 itemsToRepair.Insert(entityInHands);
4768 if(itemsToRepair.Count() > 0)
4772 #ifdef DIAG_DEVELOPER
4785 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
4790 if (player.IsAlive())
4792 if (!player.IsRestrained() && !player.IsUnconscious())
4801 ent = dst2.GetParent();
4804 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
4809 if (player.IsAlive())
4811 if (!player.IsRestrained() && !player.IsUnconscious())
4831 item = dst1.GetItem().GetHierarchyRoot();
4832 root = item.GetHierarchyRoot();
4839 item = dst2.GetItem().GetHierarchyRoot();
4840 root = item.GetHierarchyRoot();
4861 if (player.IsAlive())
4863 if (!player.IsRestrained() && !player.IsUnconscious())
4874 result = CheckDropRequest( GetManOwner(), src, radius);
4885 return dst.GetParent().CheckAttachmentReceiveExclusion(src.GetItem(),dst.GetSlot());
4894 bool failed =
false;
4898 failed |= !dst1.GetParent().CheckAttachmentReceiveExclusion(dst1.GetItem(),dst1.GetSlot());
4903 failed |= !dst2.GetParent().CheckAttachmentReceiveExclusion(dst2.GetItem(),dst2.GetSlot());
4928 #ifdef ENABLE_LOGGING
4937 #ifdef ENABLE_LOGGING
4944 Error(
"[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
4953 #ifdef ENABLE_LOGGING
4968 #ifdef ENABLE_LOGGING
4978 if (GetInventoryOwner() != src.
GetParent())
4980 #ifdef ENABLE_LOGGING
4990 #ifdef ENABLE_LOGGING
5007 bool correct =
true;
5016 if(!ctx.
Read(count))
5022 for (
int i = 0; i < count; i++)
5033 Man itemOwner = item.GetHierarchyRootPlayer();
5037 item.GetInventory().GetCurrentInventoryLocation(realIl);
5039 if(clientIl != realIl)
5041 itemsToRepair.Insert(item);
5046 if (itemsToRepair.Count())
5048 #ifdef DIAG_DEVELOPER
5049 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
5053 #ifdef DIAG_DEVELOPER
void syncDebugPrint(string s)
void inventoryDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
InventoryValidationResult
InventoryValidationReason
void wpnDebugSpamALot(string s)
void wpnDebugPrint(string s)
void ClearInventoryReservationEx(ActionData action_data)
bool ExecuteHandEventCommandServer(inout Serializer ctx)
bool PlayerCheckDropRequest(notnull InventoryLocation src, float radius)
bool ValidateSyncMove(inout Serializer ctx, InventoryValidation validation)
bool ValidateHandEvent(inout Serializer ctx, InventoryValidation validation)
void EnableMovableOverride(EntityAI item)
void OnHandleStoredInputUserData(ParamsReadContext ctx)
bool SwapCheckExclusionMaskLocal(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
Local, checks only stuff that is in guaranteed sync.
bool ProcessInputData(ParamsReadContext ctx, bool isJuncture, bool isRemote)
ref HandAnimatedForceSwapping m_FSwapping
void HandleHandEvent(DeferredEvent deferred_event)
bool ExecuteInventoryCommandRemote(ParamsReadContext ctx)
void HandleWeaponEvents(float dt, out bool exitIronSights)
proto native void StoreInputUserData(ParamsReadContext ctx)
void OnHandleStoredJunctureData(ParamsReadContext ctx)
void SyncHandEventToRemote(HandEventBase e)
void HandleTakeToDst(DeferredEvent deferred_event)
bool ExecuteSyncMoveCommandClient(ParamsReadContext ctx)
void DeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
bool ExecuteHandEventCommandClient(inout Serializer ctx)
ref HandAnimatedForceSwapping_Inst m_FSwappingInst
ref HandAnimatedSwapping m_Swapping
bool ValidateDestroy(inout Serializer ctx, InventoryValidation validation)
bool MoveCheckExclusionMaskLocal(notnull InventoryLocation src, notnull InventoryLocation dst)
Local, checks only stuff that is in guaranteed sync.
void CheckForRope(InventoryLocation src, InventoryLocation dst)
bool ExecuteSyncMoveCommandRemote(ParamsReadContext ctx)
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
override void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
bool ExecuteHandEventCommandRemote(inout Serializer ctx)
bool ValidateSyncMoveServer(ParamsReadContext ctx, InventoryValidation validation)
void PostWeaponEvent(WeaponEventBase e)
override void NetSyncCurrentStateID(int id)
override void OnHandsEnteredStableState(HandStateBase src, HandStateBase dst)
bool IsServerOrLocalPlayer()
bool ValidateSwapServer(inout Serializer ctx, InventoryValidation validation)
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override void OnInventoryJunctureFailureFromServer(ParamsReadContext ctx)
void RemoveMovableOverride(EntityAI item)
static const int INVENTORY_REPAIR_MAX_ITEMS
MAx distance for itme to be repair (without it it can be use for getting position from server)
bool ExecuteSwapCommandClient(inout Serializer ctx)
ref HandEventBase m_DeferredPostedHandEvent
void SyncDeferredEventToRemotes()
bool ValidateHandEventServer(inout Serializer ctx, InventoryValidation validation)
override void HandleInventoryManipulation()
override bool OnInventoryJunctureFromServer(ParamsReadContext ctx)
void DayZPlayerInventory()
limmit number of items transfere duting repair.
ref HandAnimatedTakingFromAtt m_Taking
deferred weapon event
override bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)
override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
ref HandAnimatedMovingToAtt m_MovingTo
void SendRepairToClientDst(notnull InventoryLocation dst)
void DeferredTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override void OnHandsExitedStableState(HandStateBase src, HandStateBase dst)
bool ValidateInventoryCommandServer(ParamsReadContext ctx)
override void OnHandsStateChanged(HandStateBase src, HandStateBase dst)
override bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
bool ExecuteSwapCommandServer(inout Serializer ctx)
bool OnHandEventForRemote(ParamsReadContext ctx)
ref InventoryLocation m_dst1
ref WeaponEventBase m_DeferredWeaponEvent
deferred hand event
void OnInputUserDataForRemote(ParamsReadContext ctx)
DayZPlayer GetDayZPlayerOwner()
void DeferredHandEvent(InventoryMode mode, HandEventBase e)
override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool ValidateSwap(inout Serializer ctx, InventoryValidation validation)
void HandleSwapEntities(DeferredEvent deferred_event)
bool PlayerCheckSwapItemsRequest(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
void HandleInventory(float dt)
static const float INVENTORY_REPAIR_MAX_DISTANCE
void DeferredWeaponFailed()
bool ExecuteSyncMoveCommandServer(ParamsReadContext ctx)
ref InventoryLocation m_dst
void HandleForceSwapEntities(DeferredEvent deferred_event)
bool ExecuteInventoryCommandClient(ParamsReadContext ctx)
ref Timer m_DeferredWeaponTimer
override bool PostDeferredEventTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
bool PlayerCheckRequestDst(notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
bool OnEventForRemoteWeapon(ParamsReadContext ctx)
override void OnServerInventoryCommand(ParamsReadContext ctx)
void CancelHandEvent()
cancels any handevents that will be executed this frame @NOTE: this is used in situations where the p...
bool ExecuteSwapCommandRemote(inout Serializer ctx)
bool ExecuteInventoryCommandServer(ParamsReadContext ctx)
proto native void StoreJunctureData(ParamsReadContext ctx)
ref InventoryLocation m_dst2
DeferredSwapEntities m_item1
override bool HandEvent(InventoryMode mode, HandEventBase e)
class DeferredEvent m_src
static void SendServerHandEventViaJuncture(notnull DayZPlayer player, HandEventBase e)
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
WeaponEventBase WeaponAnimEventFactory(WeaponEvents type, DayZPlayer p=NULL, Magazine m=NULL)
creates animation system events
WeaponEventBase CreateWeaponEventFromContext(ParamsReadContext ctx)
WeaponEventID
identifier for events. mainly for rpc purposes
bool IsProcessing()
returns true when FP is heating or cooling
void fsmDebugSpam(string s)
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
void ClearInventoryReservation()
void hndDebugSpam(string s)
void hndDebugSpamALot(string s)
void hndDebugPrint(string s)
FSMTransition< HandStateBase, HandEventBase, HandActionBase, HandGuardBase > HandTransition
InventoryLocationType
types of Inventory Location
bool TryAcquireInventoryJunctureFromServer(notnull Man player, notnull InventoryLocation src, notnull InventoryLocation dst)
bool TryAcquireTwoInventoryJuncturesFromServer(notnull Man player, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
override void OnAfterStoreLoad()
engine reaction to load from database originates in: engine - Person::BinLoad script - PlayerBase....
PluginBase GetPlugin(typename plugin_type)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
Super root of all classes in Enforce script.
override void OnItemInHandsChanged()
static const int SJ_INVENTORY_FAILURE
static const int SJ_INVENTORY
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
bool ReserveInventory(HumanInventory inventory)
void ClearInventoryReservation(HumanInventory inventory)
override bool ReserveInventory(HumanInventory inventory)
ref HandEventBase m_event
void DeferredHandEvent(InventoryMode mode, HandEventBase e)
override void ClearInventoryReservation(HumanInventory inventory)
ref InventoryLocation m_dst1
void DeferredSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
override void ClearInventoryReservation(HumanInventory inventory)
override bool ReserveInventory(HumanInventory inventory)
ref InventoryLocation m_dst2
static proto native bool LocationTestAddEntity(notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....
bool ClearInventoryReservationEx(EntityAI item, InventoryLocation dst)
const int c_InventoryReservationTimeoutShortMS
static bool MakeSrcAndDstForSwap(notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
helper function for swap
static bool MakeSrcAndDstForForceSwap(notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, notnull InventoryLocation dst2)
helper function for ForceSwap
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
const int c_InventoryReservationTimeoutMS
reservations
static bool LocationCanMoveEntitySyncCheck(notnull InventoryLocation src, notnull InventoryLocation dst)
static proto native bool HasInventoryReservation(EntityAI item, InventoryLocation dst)
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY,...
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
const float c_MaxItemDistanceRadius
anti-cheats
bool AddInventoryReservationEx(EntityAI item, InventoryLocation dst, int timeout_ms)
script counterpart to engine's class Inventory
override InventoryLocation GetSecondDst()
override InventoryLocation GetDst()
override bool AcquireInventoryJunctureFromServer(notnull Man player)
override EntityAI GetSecondSrcEntity()
override bool IsServerSideOnly()
override string DumpToString()
override void ClearInventoryReservation()
override void WriteToContext(ParamsWriteContext ctx)
override bool CheckRequestSrc()
override bool CanPerformEventEx(InventoryValidation validation)
override InventoryLocation GetSecondSrc()
Abstracted event, not to be used, only inherited.
override bool IsIdle()
idle state does not expect any animation events
override void OnUpdate(float dt)
override bool IsWaitingForActionFinish()
waiting for active animation action/actionType finish
represent hand state base
proto native bool IsActionFinished()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
proto native int GetRunningActionType()
returns -1 when no action is running or appropriate action type
inventory for plain man/human
HumanInventory... with FSM (synchronous, no anims)
ref InventoryLocation m_Src2
ref InventoryLocation m_Src1
ref InventoryLocation m_Dst1
ref InventoryLocation m_Dst2
proto native bool IsValid()
verify current set inventory location
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native EntityAI GetParent()
returns parent of current inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location
bool ReadFromContext(ParamsReadContext ctx)
proto native EntityAI GetItem()
returns item of current inventory location
InventoryValidationResult m_Result
InventoryValidationReason m_Reason
static bool IsWeaponLogEnable()
static bool IsSyncLogEnable()
static bool IsInventoryHFSMLogEnable()
static bool IsInventoryMoveLogEnable()
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native bool CanWrite()
Serialization general interface. Serializer API works with:
WeaponEventID GetEventID()
returns id from enum WeaponEventID
signalize mechanism manipulation
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native void StoreInputForRemotes(ParamsWriteContext ctx)
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerInstanceType GetInstanceType()
Serializer ParamsReadContext
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
void Obsolete(string msg="")
vector GetPosition()
Get the world position of the Effect.
string WeaponActionTypeToString(int A, int AT)