135 return m_event.ReserveInventory();
140 m_event.ClearInventoryReservation();
210 CreateStableStates();
212 m_Taking =
new HandAnimatedTakingFromAtt(GetManOwner(), null);
213 m_MovingTo =
new HandAnimatedMovingToAtt(GetManOwner(), null);
214 m_Swapping =
new HandAnimatedSwapping(GetManOwner(), null);
215 m_FSwapping =
new HandAnimatedForceSwapping(GetManOwner(), null);
216 m_FSwappingInst =
new HandAnimatedForceSwapping_Inst(GetManOwner(), null);
219 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
220 HandEventBase _abt_ =
new HandEventHumanCommandActionAborted;
229 m_FSM.AddTransition(
new HandTransition( m_Empty , __T__,
m_Taking, NULL,
new HandSelectAnimationOfTakeToHandsEvent(GetManOwner())));
230 m_FSM.AddTransition(
new HandTransition(
m_Taking , _fin_, m_Empty, null,
new HandGuardNot(
new HandGuardHasItemInHands(GetManOwner()))));
232 m_FSM.AddTransition(
new HandTransition(
m_Taking , __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
236 m_FSM.AddTransition(
new HandTransition( m_Equipped, __M__,
m_MovingTo, NULL,
new HandSelectAnimationOfMoveFromHandsEvent(GetManOwner())));
237 m_FSM.AddTransition(
new HandTransition(
m_MovingTo, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
238 m_FSM.AddTransition(
new HandTransition(
m_MovingTo, _fin_, m_Equipped, null,
new HandGuardHasItemInHands(GetManOwner())));
243 m_FSM.AddTransition(
new HandTransition( m_Equipped, __W__,
m_Swapping, NULL,
new HandSelectAnimationOfSwapInHandsEvent(GetManOwner())));
244 m_FSM.AddTransition(
new HandTransition(
m_Swapping, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
245 m_FSM.AddTransition(
new HandTransition(
m_Swapping, _fin_, m_Empty, null,
new HandGuardNot(
new HandGuardHasItemInHands(GetManOwner()))));
252 m_FSM.AddTransition(
new HandTransition(
m_FSwappingInst, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
256 m_FSM.AddTransition(
new HandTransition(
m_FSwapping, _fin_, m_Equipped, null,
new HandGuardHasItemInHands(GetManOwner())));
258 m_FSM.AddTransition(
new HandTransition(
m_FSwapping, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
289 if (hcw && weapon && weapon.CanProcessWeaponEvents() && !weapon.IsIdle())
293 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
296 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
326 string secondPart =
" - ENTITY IN HANDS IS NOT A WEAPON: " +
Object.GetDebugName(GetEntityInHands());
328 string firstPart =
"[wpnfsm] " +
Object.GetDebugName(GetInventoryOwner()) +
" failed to perform weaponevent " +
m_DeferredWeaponEvent.DumpToString();
331 secondPart =
" on " +
Object.GetDebugName(GetEntityInHands()) +
" which is in state " + weapon.GetCurrentState();
332 secondPart +=
" with physical state: J: " + weapon.IsJammed() +
" | ";
333 for (
int i = 0; i < weapon.GetMuzzleCount(); ++i)
335 secondPart +=
"Chamber_" + i +
": B(" + weapon.IsChamberFull(i) +
") F(" + weapon.IsChamberFiredOut(i) +
") E(" + weapon.IsChamberEmpty(i) +
") | ";
336 secondPart +=
"Magazine_" + i +
": " + weapon.GetMagazine(i);
337 if (i < weapon.GetMuzzleCount() - 1)
342 Error(firstPart + secondPart);
355 weapon.UpdateCoolDown(dt);
356 if (hcw && weapon.CanProcessWeaponEvents())
359 weapon.GetCurrentState().OnUpdate(dt);
366 if (!weapon.IsIdle())
370 int weaponEventId = hcw.
IsEvent();
371 if (weaponEventId == -1)
385 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" HandleWeapons: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
388 if (anim_event != NULL)
390 weapon.ProcessWeaponEvent(anim_event);
396 if (weapon.IsWaitingForActionFinish())
400 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: finished! notifying waiting state=" + weapon.GetCurrentState());
403 weapon.ProcessWeaponEvent(
new WeaponEventHumanCommandActionFinished(
GetDayZPlayerOwner()));
409 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
412 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
426 exitIronSights =
true;
455 m_FSM.GetCurrentState().OnUpdate(dt);
457 #ifdef ENABLE_LOGGING
464 if ( !m_FSM.GetCurrentState().IsIdle() || !m_FSM.IsRunning())
468 int weaponEventId = hcw.
IsEvent();
469 if (weaponEventId == -1)
476 #ifdef ENABLE_LOGGING
479 hndDebugPrint(
"[hndfsm] HandleInventory: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
483 if (anim_event != NULL)
486 ProcessHandEvent(anim_event);
492 if (m_FSM.GetCurrentState().IsWaitingForActionFinish())
494 #ifdef ENABLE_LOGGING
497 hndDebugPrint(
"[hndfsm] Hand-Weapon event: finished! notifying waiting state=" + m_FSM.GetCurrentState());
501 HandEventBase fin_event =
new HandEventHumanCommandActionFinished(GetManOwner());
503 ProcessHandEvent(fin_event);
507 #ifdef ENABLE_LOGGING
510 hndDebugPrint(
"[hndfsm] Hand-Weapon event: ABORT! notifying running state=" + m_FSM.GetCurrentState());
514 HandEventBase abt_event =
new HandEventHumanCommandActionAborted(GetManOwner());
516 ProcessHandAbortEvent(abt_event);
596 if (
GetGame().IsDedicatedServer())
601 int udtIdentifier = -1;
623 ClearInventoryReservationEx(dst.
GetItem(), dst);
641 ClearInventoryReservationEx(dst.
GetItem(), dst);
642 ClearInventoryReservationEx(temp.
GetItem(), temp);
657 if (!ctx.
Read(reason))
783 #ifdef ENABLE_LOGGING
886 #ifdef ENABLE_LOGGING
896 LocationSyncMoveEntity(src, dst);
904 #ifdef ENABLE_LOGGING
913 #ifdef ENABLE_LOGGING
916 DumpInventoryDebug();
934 #ifdef ENABLE_LOGGING
949 ClearInventoryReservationEx(dst.
GetItem(), dst);
963 #ifdef ENABLE_LOGGING
966 DumpInventoryDebug();
982 #ifdef ENABLE_LOGGING
991 #ifdef ENABLE_LOGGING
998 LocationSyncMoveEntity(src, dst);
1007 bool success =
true;
1018 EntityAI itemSrc = e.GetSrcEntity();
1021 #ifdef ENABLE_LOGGING
1024 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1028 if (validation.
m_IsRemote && !e.GetSrcEntity())
1034 srcNew.
Copy(e.GetSrc());
1037 Error(
"[syncinv] HandleInputData remote swap event REPLACED with TAKE (cmd=HAND_EVENT, event=" + e.
DumpToString() +
"), src item is null! Continuing.");
1041 #ifdef ENABLE_LOGGING
1044 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1048 Error(
"[syncinv] HandleInputData remote input (cmd=HAND_EVENT, event=" + e.
DumpToString() +
") dropped, item not in bubble");
1065 #ifdef ENABLE_LOGGING
1068 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1091 if (success && !e.CheckRequestEx(validation))
1093 #ifdef ENABLE_LOGGING
1096 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1105#ifdef ENABLE_LOGGING
1129 #ifdef ENABLE_LOGGING
1132 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1141#ifdef ENABLE_LOGGING
1170 #ifdef ENABLE_LOGGING
1173 Debug.
InventoryMoveLog(
"Juncture not required",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1181 #ifdef ENABLE_LOGGING
1184 Debug.
InventoryMoveLog(
"Juncture sended",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1201 #ifdef ENABLE_LOGGING
1204 Debug.
InventoryMoveLog(
"Juncture denied",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1219 #ifdef ENABLE_LOGGING
1222 Debug.
InventoryMoveLog(
"Success - ProcessHandEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1229 if (!e.m_Player.GetHumanInventory().ProcessHandEvent(e))
1249 bool skippedSwap =
false;
1250 bool success =
true;
1256 ctx.Read(skippedSwap);
1258 #ifdef ENABLE_LOGGING
1269 #ifdef ENABLE_LOGGING
1286 #ifdef ENABLE_LOGGING
1293 Error(
"[syncinv] HandleInputData remote input (cmd=SWAP) dropped, item not in bubble");
1307#ifdef ENABLE_LOGGING
1337#ifdef ENABLE_LOGGING
1367#ifdef ENABLE_LOGGING
1397 ClearInventoryReservationEx(dst1.
GetItem(), dst1);
1398 ClearInventoryReservationEx(dst2.
GetItem(), dst2);
1406 #ifdef ENABLE_LOGGING
1409 DumpInventoryDebug();
1447 #ifdef ENABLE_LOGGING
1458 #ifdef ENABLE_LOGGING
1472 #ifdef ENABLE_LOGGING
1487 ClearInventoryReservationEx(dst1.
GetItem(), dst1);
1488 ClearInventoryReservationEx(dst2.
GetItem(), dst2);
1499 #ifdef ENABLE_LOGGING
1508 #ifdef ENABLE_LOGGING
1516 bool isNotSkipped = LocationSwap(src1, src2, dst1, dst2);
1532 if (isJuncture && isRemote)
1539 if (!ctx.
Read(type))
1554 if (!ValidateUserReservationCancel(serializer, validation))
1586 if (canSendJuncture)
1592 writeableSerializer.
CopyFrom(serializer);
1593 serializer = writeableSerializer;
1602 if (canSendJuncture)
1609 Error(
"InventoryValidationResult.JUNCTURE returned when not possible to send!");
1624 itemIB.SetCanBeMovedOverride(
false);
1631 itemIB.SetCanBeMovedOverride(
true);
1637 Rope rope = Rope.Cast(src.
GetItem());
1639 rope.SetTargetLocation(dst);
1651 #ifdef ENABLE_LOGGING
1667 if (GetManOwner().IsAlive() ==
false)
1668 return super.TakeToDst(mode, src, dst);
1670 #ifdef ENABLE_LOGGING
1680 if (RedirectToHandEvent(mode, src, dst))
1682 #ifdef ENABLE_LOGGING
1693 if (
GetDayZPlayerOwner().NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
1697#ifdef ENABLE_LOGGING
1706#ifdef ENABLE_LOGGING
1728#ifdef ENABLE_LOGGING
1737 #ifdef ENABLE_LOGGING
1746 LocationSyncMoveEntity(src, dst);
1749 if (!super.TakeToDst(mode,src,dst))
1758 if (!super.PostDeferredEventTakeToDst(mode,src,dst))
1775 if( deferred_take_to_dst )
1777 #ifdef ENABLE_LOGGING
1784 deferred_take_to_dst.ClearInventoryReservation(
this);
1791 switch (deferred_take_to_dst.m_mode)
1794 #ifdef ENABLE_LOGGING
1801 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
1804 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
1808 #ifdef ENABLE_LOGGING
1817 #ifdef ENABLE_LOGGING
1824 if (LocationCanMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst))
1833 #ifdef ENABLE_LOGGING
1842 #ifdef ENABLE_LOGGING
1850 #ifdef ENABLE_LOGGING
1858 Error(
"HandEvent - Invalid mode");
1866 #ifdef ENABLE_LOGGING
1878 LocationSwap(src1, src2, dst1, dst2);
1883 if(!super.SwapEntities(mode,item1,item2))
1895 if (!super.PostDeferredForceSwapEntities(mode, item1, item2, dst1, dst2))
1912 if( deferred_swap_entities )
1923 switch (deferred_swap_entities.
m_mode)
1929 LocationSwap(src1, src2, deferred_swap_entities.
m_dst1, deferred_swap_entities.
m_dst2);
1933 #ifdef ENABLE_LOGGING
1954 #ifdef ENABLE_LOGGING
1967 Error(
"SwapEntities - HandEvent - Invalid mode");
1971 Error(
"SwapEntities - MakeSrcAndDstForSwap - no inv loc");
1977 #ifdef ENABLE_LOGGING
1989 LocationSwap(src1, src2, dst1, item2_dst);
1995 if(!super.ForceSwapEntities(mode,item1,item2,item2_dst))
2009 if (deferred_force_swap_entities)
2011 deferred_force_swap_entities.ClearInventoryReservation(
this);
2014 deferred_force_swap_entities.m_item1.GetInventory().GetCurrentInventoryLocation(src1);
2015 deferred_force_swap_entities.m_item2.GetInventory().GetCurrentInventoryLocation(src2);
2024 switch (deferred_force_swap_entities.m_mode)
2027 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))
2030 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
2034 #ifdef ENABLE_LOGGING
2044 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))
2053 #ifdef ENABLE_LOGGING
2066 Error(
"ForceSwapEntities - HandEvent - Invalid mode");
2077 Error(
"[syncinv] " +
Object.GetDebugName(player) +
" SendServerHandEventViaJuncture - called on server side event only, e=" + e.
DumpToString());
2080 if (player.IsAlive())
2088#ifdef ENABLE_LOGGING
2097#ifdef ENABLE_LOGGING
2106#ifdef ENABLE_LOGGING
2115#ifdef ENABLE_LOGGING
2126#ifdef ENABLE_LOGGING
2139 Error(
"[syncinv] SendServerHandEventViaJuncture - called on dead player, juncture is for living only");
2149 super.NetSyncCurrentStateID(
id);
2170 if (GetEntityInHands())
2180 pb.GetWeaponManager().SetRunning(
true);
2184 fsmDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(wpn) +
" recv event from remote: created event=" + e);
2189 wpn.ProcessWeaponAbortEvent(e);
2193 wpn.ProcessWeaponEvent(e);
2195 pb.GetWeaponManager().SetRunning(
false);
2199 Error(
"OnEventForRemoteWeapon - entity in hands, but not weapon. item=" + GetEntityInHands());
2202 Error(
"OnEventForRemoteWeapon - no entity in hands");
2217 hndDebugSpam(
"[hndfsm] recv event from remote: created event=" + e);
2222 if (e.GetEventID() ==
HandEventID.HUMANCOMMAND_ACTION_ABORTED)
2225 m_FSM.ProcessAbortEvent(e, aa);
2229 m_FSM.ProcessEvent(e);
2249 hndDebugPrint(
"[hndfsm] send 2 remote: sending e=" + e +
" id=" + e.GetEventID() +
" p=" + p +
" e=" + e.
DumpToString());
2252 p.StoreInputForRemotes(ctx);
2258 super.OnHandsExitedStableState(src, dst);
2262 hndDebugPrint(
"[hndfsm] hand fsm exit stable src=" + src.Type().ToString());
2268 super.OnHandsEnteredStableState(src, dst);
2272 hndDebugPrint(
"[hndfsm] hand fsm entered stable dst=" + dst.Type().ToString());
2278 super.OnHandsStateChanged(src, dst);
2282 hndDebugPrint(
"[hndfsm] hand fsm changed state src=" + src.Type().ToString() +
" ---> dst=" + dst.Type().ToString());
2291#ifdef DIAG_DEVELOPER
2304 EntityAI itemInHands = GetEntityInHands();
2307 il.
SetHands(GetInventoryOwner(), itemInHands);
2348 if (deferred_hand_event)
2350 #ifdef ENABLE_LOGGING
2362 switch (deferred_hand_event.
m_mode)
2365 #ifdef ENABLE_LOGGING
2376 ProcessHandEvent(deferred_hand_event.
m_event);
2381 #ifdef ENABLE_LOGGING
2407 #ifdef ENABLE_LOGGING
2415 ProcessHandEvent(deferred_hand_event.
m_event);
2420 #ifdef ENABLE_LOGGING
2445 ProcessHandEvent(deferred_hand_event.
m_event);
2450 Error(
"HumanInventory::HandEvent - Invalid mode");
2457 super.HandleInventoryManipulation();
2488 if (player.IsAlive())
2490 if (!player.IsRestrained() && !player.IsUnconscious())
2519 if (player.IsAlive())
2521 if (!player.IsRestrained() && !player.IsUnconscious())
2532 result = CheckMoveToDstRequest( GetManOwner(), src, dst, radius);
2546 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2551 if (player.IsAlive())
2553 if (!player.IsRestrained() && !player.IsUnconscious())
2562 ent = dst2.GetParent();
2565 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2570 if (player.IsAlive())
2572 if (!player.IsRestrained() && !player.IsUnconscious())
2603 if (player.IsAlive())
2605 if (!player.IsRestrained() && !player.IsUnconscious())
2616 result = CheckDropRequest( GetManOwner(), src, radius);
2627 return dst.GetParent().CheckAttachmentReceiveExclusion(src.GetItem(),dst.GetSlot());
2636 bool failed =
false;
2640 failed |= !dst1.GetParent().CheckAttachmentReceiveExclusion(dst1.GetItem(),dst1.GetSlot());
2645 failed |= !dst2.GetParent().CheckAttachmentReceiveExclusion(dst2.GetItem(),dst2.GetSlot());
2670 #ifdef ENABLE_LOGGING
2679 #ifdef ENABLE_LOGGING
2686 Error(
"[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
2695 #ifdef ENABLE_LOGGING
2710 #ifdef ENABLE_LOGGING
2720 #ifdef ENABLE_LOGGING
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)
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)
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)
void DeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
ref HandAnimatedForceSwapping_Inst m_FSwappingInst
ref HandAnimatedSwapping m_Swapping
bool ValidateDestroy(inout Serializer ctx, InventoryValidation validation)
DEPRECATED.
bool MoveCheckExclusionMaskLocal(notnull InventoryLocation src, notnull InventoryLocation dst)
Local, checks only stuff that is in guaranteed sync.
void CheckForRope(InventoryLocation src, InventoryLocation dst)
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
override void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
void PostWeaponEvent(WeaponEventBase e)
override void NetSyncCurrentStateID(int id)
override void OnHandsEnteredStableState(HandStateBase src, HandStateBase dst)
bool IsServerOrLocalPlayer()
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override void OnInventoryJunctureFailureFromServer(ParamsReadContext ctx)
void RemoveMovableOverride(EntityAI item)
ref HandEventBase m_DeferredPostedHandEvent
override void HandleInventoryManipulation()
override bool OnInventoryJunctureFromServer(ParamsReadContext ctx)
void DayZPlayerInventory()
ref HandAnimatedTakingFromAtt m_Taking
deferred weapon event
override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
ref HandAnimatedMovingToAtt m_MovingTo
override bool OnInventoryJunctureRepairFromServer(ParamsReadContext ctx)
void DeferredTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override void OnHandsExitedStableState(HandStateBase src, HandStateBase dst)
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 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)
void DeferredWeaponFailed()
ref InventoryLocation m_dst
void HandleForceSwapEntities(DeferredEvent deferred_event)
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...
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....
bool ClearJunctureEx(Man player, notnull EntityAI item)
proto native DayZPlayer GetPlayer()
proto native void ObjectDelete(Object obj)
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
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 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)
Abstracted event, not to be used, only inherited.
override bool IsIdle()
idle state does not expect any animation events
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)
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
proto native void StoreInputForRemotes(ParamsWriteContext ctx)
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerInstanceType GetInstanceType()
Serializer ParamsReadContext
proto native CGame GetGame()
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.
string WeaponActionTypeToString(int A, int AT)