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())
1032 #ifdef ENABLE_LOGGING
1035 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1039 Error(
"[syncinv] HandleInputData remote input (cmd=HAND_EVENT, event=" + e.
DumpToString() +
") dropped, item not in bubble");
1055 #ifdef ENABLE_LOGGING
1058 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1081 if (success && !e.CheckRequestEx(validation))
1083 #ifdef ENABLE_LOGGING
1086 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1095#ifdef ENABLE_LOGGING
1119 #ifdef ENABLE_LOGGING
1122 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1131#ifdef ENABLE_LOGGING
1160 #ifdef ENABLE_LOGGING
1163 Debug.
InventoryMoveLog(
"Juncture not required",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1171 #ifdef ENABLE_LOGGING
1174 Debug.
InventoryMoveLog(
"Juncture sended",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1191 #ifdef ENABLE_LOGGING
1194 Debug.
InventoryMoveLog(
"Juncture denied",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1209 #ifdef ENABLE_LOGGING
1212 Debug.
InventoryMoveLog(
"Success - ProcessHandEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1219 if (!e.m_Player.GetHumanInventory().ProcessHandEvent(e))
1239 bool skippedSwap =
false;
1240 bool success =
true;
1246 ctx.Read(skippedSwap);
1248 #ifdef ENABLE_LOGGING
1259 #ifdef ENABLE_LOGGING
1276 #ifdef ENABLE_LOGGING
1283 Error(
"[syncinv] HandleInputData remote input (cmd=SWAP) dropped, item not in bubble");
1297#ifdef ENABLE_LOGGING
1327#ifdef ENABLE_LOGGING
1357#ifdef ENABLE_LOGGING
1387 ClearInventoryReservationEx(dst1.
GetItem(), dst1);
1388 ClearInventoryReservationEx(dst2.
GetItem(), dst2);
1396 #ifdef ENABLE_LOGGING
1399 DumpInventoryDebug();
1437 #ifdef ENABLE_LOGGING
1448 #ifdef ENABLE_LOGGING
1462 #ifdef ENABLE_LOGGING
1477 ClearInventoryReservationEx(dst1.
GetItem(), dst1);
1478 ClearInventoryReservationEx(dst2.
GetItem(), dst2);
1489 #ifdef ENABLE_LOGGING
1498 #ifdef ENABLE_LOGGING
1506 bool isNotSkipped = LocationSwap(src1, src2, dst1, dst2);
1522 if (isJuncture && isRemote)
1529 if (!ctx.
Read(type))
1544 if (!ValidateUserReservationCancel(serializer, validation))
1576 if (canSendJuncture)
1582 writeableSerializer.
CopyFrom(serializer);
1583 serializer = writeableSerializer;
1592 if (canSendJuncture)
1599 Error(
"InventoryValidationResult.JUNCTURE returned when not possible to send!");
1614 itemIB.SetCanBeMovedOverride(
false);
1621 itemIB.SetCanBeMovedOverride(
true);
1627 Rope rope = Rope.Cast(src.
GetItem());
1629 rope.SetTargetLocation(dst);
1641 #ifdef ENABLE_LOGGING
1657 if (GetManOwner().IsAlive() ==
false)
1658 return super.TakeToDst(mode, src, dst);
1660 #ifdef ENABLE_LOGGING
1670 if (RedirectToHandEvent(mode, src, dst))
1672 #ifdef ENABLE_LOGGING
1683 if (
GetDayZPlayerOwner().NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
1687#ifdef ENABLE_LOGGING
1696#ifdef ENABLE_LOGGING
1718#ifdef ENABLE_LOGGING
1727 #ifdef ENABLE_LOGGING
1736 LocationSyncMoveEntity(src, dst);
1739 if (!super.TakeToDst(mode,src,dst))
1748 if (!super.PostDeferredEventTakeToDst(mode,src,dst))
1765 if( deferred_take_to_dst )
1767 #ifdef ENABLE_LOGGING
1774 deferred_take_to_dst.ClearInventoryReservation(
this);
1781 switch (deferred_take_to_dst.m_mode)
1784 #ifdef ENABLE_LOGGING
1791 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
1794 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
1798 #ifdef ENABLE_LOGGING
1807 #ifdef ENABLE_LOGGING
1814 if (LocationCanMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst))
1823 #ifdef ENABLE_LOGGING
1832 #ifdef ENABLE_LOGGING
1840 #ifdef ENABLE_LOGGING
1848 Error(
"HandEvent - Invalid mode");
1856 #ifdef ENABLE_LOGGING
1868 LocationSwap(src1, src2, dst1, dst2);
1873 if(!super.SwapEntities(mode,item1,item2))
1885 if (!super.PostDeferredForceSwapEntities(mode, item1, item2, dst1, dst2))
1902 if( deferred_swap_entities )
1913 switch (deferred_swap_entities.
m_mode)
1919 LocationSwap(src1, src2, deferred_swap_entities.
m_dst1, deferred_swap_entities.
m_dst2);
1923 #ifdef ENABLE_LOGGING
1944 #ifdef ENABLE_LOGGING
1957 Error(
"SwapEntities - HandEvent - Invalid mode");
1961 Error(
"SwapEntities - MakeSrcAndDstForSwap - no inv loc");
1967 #ifdef ENABLE_LOGGING
1979 LocationSwap(src1, src2, dst1, item2_dst);
1985 if(!super.ForceSwapEntities(mode,item1,item2,item2_dst))
1999 if (deferred_force_swap_entities)
2001 deferred_force_swap_entities.ClearInventoryReservation(
this);
2004 deferred_force_swap_entities.m_item1.GetInventory().GetCurrentInventoryLocation(src1);
2005 deferred_force_swap_entities.m_item2.GetInventory().GetCurrentInventoryLocation(src2);
2014 switch (deferred_force_swap_entities.m_mode)
2017 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))
2020 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
2024 #ifdef ENABLE_LOGGING
2034 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))
2043 #ifdef ENABLE_LOGGING
2056 Error(
"ForceSwapEntities - HandEvent - Invalid mode");
2067 Error(
"[syncinv] " +
Object.GetDebugName(player) +
" SendServerHandEventViaJuncture - called on server side event only, e=" + e.
DumpToString());
2070 if (player.IsAlive())
2078#ifdef ENABLE_LOGGING
2087#ifdef ENABLE_LOGGING
2096#ifdef ENABLE_LOGGING
2105#ifdef ENABLE_LOGGING
2116#ifdef ENABLE_LOGGING
2129 Error(
"[syncinv] SendServerHandEventViaJuncture - called on dead player, juncture is for living only");
2139 super.NetSyncCurrentStateID(
id);
2160 if (GetEntityInHands())
2170 pb.GetWeaponManager().SetRunning(
true);
2174 fsmDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(wpn) +
" recv event from remote: created event=" + e);
2179 wpn.ProcessWeaponAbortEvent(e);
2183 wpn.ProcessWeaponEvent(e);
2185 pb.GetWeaponManager().SetRunning(
false);
2189 Error(
"OnEventForRemoteWeapon - entity in hands, but not weapon. item=" + GetEntityInHands());
2192 Error(
"OnEventForRemoteWeapon - no entity in hands");
2207 hndDebugSpam(
"[hndfsm] recv event from remote: created event=" + e);
2212 if (e.GetEventID() ==
HandEventID.HUMANCOMMAND_ACTION_ABORTED)
2215 m_FSM.ProcessAbortEvent(e, aa);
2219 m_FSM.ProcessEvent(e);
2239 hndDebugPrint(
"[hndfsm] send 2 remote: sending e=" + e +
" id=" + e.GetEventID() +
" p=" + p +
" e=" + e.
DumpToString());
2242 p.StoreInputForRemotes(ctx);
2248 super.OnHandsExitedStableState(src, dst);
2252 hndDebugPrint(
"[hndfsm] hand fsm exit stable src=" + src.Type().ToString());
2258 super.OnHandsEnteredStableState(src, dst);
2262 hndDebugPrint(
"[hndfsm] hand fsm entered stable dst=" + dst.Type().ToString());
2268 super.OnHandsStateChanged(src, dst);
2272 hndDebugPrint(
"[hndfsm] hand fsm changed state src=" + src.Type().ToString() +
" ---> dst=" + dst.Type().ToString());
2281#ifdef DIAG_DEVELOPER
2294 EntityAI itemInHands = GetEntityInHands();
2297 handInventoryLocation.
SetHands(GetInventoryOwner(), itemInHands);
2338 if (deferred_hand_event)
2340 #ifdef ENABLE_LOGGING
2352 switch (deferred_hand_event.
m_mode)
2355 #ifdef ENABLE_LOGGING
2366 ProcessHandEvent(deferred_hand_event.
m_event);
2371 #ifdef ENABLE_LOGGING
2397 #ifdef ENABLE_LOGGING
2405 ProcessHandEvent(deferred_hand_event.
m_event);
2410 #ifdef ENABLE_LOGGING
2435 ProcessHandEvent(deferred_hand_event.
m_event);
2440 Error(
"HumanInventory::HandEvent - Invalid mode");
2447 super.HandleInventoryManipulation();
2478 if (player.IsAlive())
2480 if (!player.IsRestrained() && !player.IsUnconscious())
2509 if (player.IsAlive())
2511 if (!player.IsRestrained() && !player.IsUnconscious())
2522 result = CheckMoveToDstRequest( GetManOwner(), src, dst, radius);
2536 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2541 if (player.IsAlive())
2543 if (!player.IsRestrained() && !player.IsUnconscious())
2552 ent = dst2.GetParent();
2555 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2560 if (player.IsAlive())
2562 if (!player.IsRestrained() && !player.IsUnconscious())
2593 if (player.IsAlive())
2595 if (!player.IsRestrained() && !player.IsUnconscious())
2606 result = CheckDropRequest( GetManOwner(), src, radius);
2617 return dst.GetParent().CheckAttachmentReceiveExclusion(src.GetItem(),dst.GetSlot());
2626 bool failed =
false;
2630 failed |= !dst1.GetParent().CheckAttachmentReceiveExclusion(dst1.GetItem(),dst1.GetSlot());
2635 failed |= !dst2.GetParent().CheckAttachmentReceiveExclusion(dst2.GetItem(),dst2.GetSlot());
2660 #ifdef ENABLE_LOGGING
2669 #ifdef ENABLE_LOGGING
2676 Error(
"[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
2685 #ifdef ENABLE_LOGGING
2700 #ifdef ENABLE_LOGGING
2710 #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
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)
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)