Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
dayzplayerinventory.c File Reference

Go to the source code of this file.

Data Structures

class  DeferredEvent
class  DeferredHandEvent
class  DeferredSwapEntities

Functions

void AbortWeaponEvent ()
void CancelHandEvent ()
 cancels any handevents that will be executed this frame @NOTE: this is used in situations where the player performs an action that renders the event invalid exactly on the frame it will be executed
void CancelWeaponEvent ()
void CheckForRope (InventoryLocation src, InventoryLocation dst)
override void ClearInventoryReservation (HumanInventory inventory)
void DayZPlayerInventory ()
void DeferredForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
void DeferredHandEvent (InventoryMode mode, HandEventBase e)
void DeferredTakeToDst (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
void DeferredWeaponFailed ()
void EnableMovableOverride (EntityAI item)
override bool ForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
DayZPlayer GetDayZPlayerOwner ()
override bool HandEvent (InventoryMode mode, HandEventBase e)
void HandleForceSwapEntities (DeferredEvent deferred_event)
void HandleHandEvent (DeferredEvent deferred_event)
void HandleInventory (float dt)
override void HandleInventoryManipulation ()
void HandleSwapEntities (DeferredEvent deferred_event)
void HandleTakeToDst (DeferredEvent deferred_event)
void HandleWeaponEvents (float dt, out bool exitIronSights)
override void Init ()
bool IsAuthoritative ()
bool IsOwner ()
bool IsProcessing ()
bool IsProxy ()
bool IsServerOrLocalPlayer ()
bool MoveCheckExclusionMaskLocal (notnull InventoryLocation src, notnull InventoryLocation dst)
 Local, checks only stuff that is in guaranteed sync.
override void NetSyncCurrentStateID (int id)
override void OnAfterStoreLoad ()
bool OnEventForRemoteWeapon (ParamsReadContext ctx)
bool OnHandEventForRemote (ParamsReadContext ctx)
override void OnHandsEnteredStableState (HandStateBase src, HandStateBase dst)
override void OnHandsExitedStableState (HandStateBase src, HandStateBase dst)
override void OnHandsStateChanged (HandStateBase src, HandStateBase dst)
void OnInputUserDataForRemote (ParamsReadContext ctx)
override bool OnInventoryCheck (int userDataType, ParamsReadContext ctx)
override void OnServerInventoryCommand (ParamsReadContext ctx)
bool PlayerCheckDropRequest (notnull InventoryLocation src, float radius)
bool PlayerCheckRequestDst (notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
bool PlayerCheckRequestSrc (notnull InventoryLocation src, float radius)
bool PlayerCheckSwapItemsRequest (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
override bool PostDeferredEventTakeToDst (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override bool PostDeferredForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
void PostWeaponEvent (WeaponEventBase e)
bool ProcessInputData (ParamsReadContext ctx, bool isJuncture, bool isRemote)
void RemoveMovableOverride (EntityAI item)
override bool ReserveInventory (HumanInventory inventory)
void SendRepairToClientDst (notnull InventoryLocation dst)
static void SendServerHandEventViaJuncture (notnull DayZPlayer player, HandEventBase e)
bool StoreInputForRemotes (bool handling_juncture, bool remote, 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.
override bool SwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
void SyncDeferredEventToRemotes ()
void SyncHandEventToRemote (HandEventBase e)
override bool TakeToDst (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
bool ValidateDestroy (inout Serializer ctx, InventoryValidation validation)
bool ValidateHandEvent (inout Serializer ctx, InventoryValidation validation)
bool ValidateSwap (inout Serializer ctx, InventoryValidation validation)
bool ValidateSyncMove (inout Serializer ctx, InventoryValidation validation)
void OnHandleStoredJunctureData (ParamsReadContext ctx)
override void OnInventoryFailure (InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
override void OnInventoryJunctureFailureFromServer (ParamsReadContext ctx)
override bool OnInventoryJunctureFromServer (ParamsReadContext ctx)
proto native void StoreJunctureData (ParamsReadContext ctx)
void OnHandleStoredInputUserData (ParamsReadContext ctx)
override bool OnInputUserDataProcess (ParamsReadContext ctx)
proto native void StoreInputUserData (ParamsReadContext ctx)

Variables

 m_DeferredEvent = NULL
ref HandEventBase m_DeferredPostedHandEvent = NULL
ref WeaponEventBase m_DeferredWeaponEvent = NULL
 deferred hand event
ref Timer m_DeferredWeaponTimer = new Timer
ref InventoryLocation m_dst
ref InventoryLocation m_dst1
ref InventoryLocation m_dst2
ref HandEventBase m_event
ref HandAnimatedForceSwapping m_FSwapping
ref HandAnimatedForceSwapping_Inst m_FSwappingInst
DeferredSwapEntities m_item1
EntityAI m_item2
ref HandAnimatedMovingToAtt m_MovingTo
class DeferredEvent m_src
ref HandAnimatedSwapping m_Swapping
ref HandAnimatedTakingFromAtt m_Taking
 deferred weapon event

Function Documentation

◆ AbortWeaponEvent()

◆ CancelHandEvent()

void CancelHandEvent ( )
protected

cancels any handevents that will be executed this frame @NOTE: this is used in situations where the player performs an action that renders the event invalid exactly on the frame it will be executed

Definition at line 269 of file dayzplayerinventory.c.

References m_DeferredPostedHandEvent.

◆ CancelWeaponEvent()

void CancelWeaponEvent ( )
protected

Definition at line 275 of file dayzplayerinventory.c.

References m_DeferredWeaponEvent, and m_DeferredWeaponTimer.

Referenced by DeferredWeaponFailed().

◆ CheckForRope()

void CheckForRope ( InventoryLocation src,
InventoryLocation dst )
protected

Definition at line 1868 of file dayzplayerinventory.c.

References InventoryLocation::GetItem().

Referenced by ValidateHandEvent(), and ValidateSyncMove().

◆ ClearInventoryReservation()

override void ClearInventoryReservation ( HumanInventory inventory)

Definition at line 34 of file dayzplayerinventory.c.

References GameInventory::ClearInventoryReservationEx(), and m_dst.

◆ DayZPlayerInventory()

void DayZPlayerInventory ( )
protected

Definition at line 163 of file dayzplayerinventory.c.

◆ DeferredForceSwapEntities()

void DeferredForceSwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2 )

Definition at line 89 of file dayzplayerinventory.c.

References m_dst1, m_dst2, m_item1, and m_item2.

Referenced by HandleForceSwapEntities(), and PostDeferredForceSwapEntities().

◆ DeferredHandEvent()

void DeferredHandEvent ( InventoryMode mode,
HandEventBase e )

Definition at line 127 of file dayzplayerinventory.c.

Referenced by HandEvent().

◆ DeferredTakeToDst()

void DeferredTakeToDst ( InventoryMode mode,
notnull InventoryLocation src,
notnull InventoryLocation dst )

Definition at line 15 of file dayzplayerinventory.c.

References m_dst, and m_src.

Referenced by HandleTakeToDst(), and PostDeferredEventTakeToDst().

◆ DeferredWeaponFailed()

void DeferredWeaponFailed ( )
protected

◆ EnableMovableOverride()

void EnableMovableOverride ( EntityAI item)
protected

◆ ForceSwapEntities()

◆ GetDayZPlayerOwner()

◆ HandEvent()

◆ HandleForceSwapEntities()

◆ HandleHandEvent()

◆ HandleInventory()

◆ HandleInventoryManipulation()

override void HandleInventoryManipulation ( )
protected

◆ HandleSwapEntities()

◆ HandleTakeToDst()

◆ HandleWeaponEvents()

◆ Init()

override void Init ( )
protected

◆ IsAuthoritative()

bool IsAuthoritative ( )
protected

Definition at line 169 of file dayzplayerinventory.c.

References Class::CastTo().

◆ IsOwner()

bool IsOwner ( )
protected

Definition at line 180 of file dayzplayerinventory.c.

References Class::CastTo().

◆ IsProcessing()

bool IsProcessing ( )
protected

Definition at line 2809 of file dayzplayerinventory.c.

References m_DeferredEvent, and m_DeferredPostedHandEvent.

◆ IsProxy()

bool IsProxy ( )
protected

Definition at line 191 of file dayzplayerinventory.c.

References Class::CastTo().

◆ IsServerOrLocalPlayer()

bool IsServerOrLocalPlayer ( )
protected

Definition at line 1875 of file dayzplayerinventory.c.

References g_Game, GetDayZPlayerOwner(), and GetInstanceType().

◆ MoveCheckExclusionMaskLocal()

bool MoveCheckExclusionMaskLocal ( notnull InventoryLocation src,
notnull InventoryLocation dst )
protected

Local, checks only stuff that is in guaranteed sync.

Definition at line 3051 of file dayzplayerinventory.c.

Referenced by ValidateSyncMove().

◆ NetSyncCurrentStateID()

override void NetSyncCurrentStateID ( int id)
protected

◆ OnAfterStoreLoad()

override void OnAfterStoreLoad ( )
protected

◆ OnEventForRemoteWeapon()

◆ OnHandEventForRemote()

bool OnHandEventForRemote ( ParamsReadContext ctx)
protected

◆ OnHandleStoredInputUserData()

void OnHandleStoredInputUserData ( ParamsReadContext ctx)
protected

◆ OnHandleStoredJunctureData()

void OnHandleStoredJunctureData ( ParamsReadContext ctx)
protected

Juncture is only ever Server Req->Client Ack and Perform->Server Perform, never remote

Definition at line 654 of file dayzplayerinventory.c.

References GetDayZPlayerOwner(), LogManager::IsSyncLogEnable(), ProcessInputData(), Serializer::Read(), and syncDebugPrint().

◆ OnHandsEnteredStableState()

override void OnHandsEnteredStableState ( HandStateBase src,
HandStateBase dst )
protected

Definition at line 2571 of file dayzplayerinventory.c.

References hndDebugPrint(), and LogManager::IsInventoryHFSMLogEnable().

Referenced by OnHandsStateChanged().

◆ OnHandsExitedStableState()

override void OnHandsExitedStableState ( HandStateBase src,
HandStateBase dst )
protected

Definition at line 2561 of file dayzplayerinventory.c.

References hndDebugPrint(), and LogManager::IsInventoryHFSMLogEnable().

Referenced by OnHandsStateChanged().

◆ OnHandsStateChanged()

◆ OnInputUserDataForRemote()

void OnInputUserDataForRemote ( ParamsReadContext ctx)
protected

◆ OnInputUserDataProcess()

override bool OnInputUserDataProcess ( ParamsReadContext ctx)
protected

◆ OnInventoryCheck()

◆ OnInventoryFailure()

override void OnInventoryFailure ( InventoryCommandType type,
InventoryValidationReason reason,
InventoryLocation src,
InventoryLocation dst )
protected

TODO(kumarjac): Notify player here

Definition at line 640 of file dayzplayerinventory.c.

Referenced by HandEvent(), and OnInventoryJunctureFailureFromServer().

◆ OnInventoryJunctureFailureFromServer()

override void OnInventoryJunctureFailureFromServer ( ParamsReadContext ctx)
protected

Function and setup is still messy due to the switch statement and relation with reading.

It could be cleaner if we used classes to handle each inventory command type, but that comes at a performance cost and will also probably require making a fair amount of changes elsewhere.

The downsides with this system right now:

  1. It makes it hard to track what is written/read from the serializer
  2. It makes this file very very large

The new changes at least remove the massive switch block and allow for all inventory commands to respond back to the client if something goes wrong

Definition at line 556 of file dayzplayerinventory.c.

References HandEventBase::ClearInventoryReservation(), g_Game, HandEventBase::GetDst(), InventoryLocation::GetItem(), INPUT_UDT_INVENTORY, OnInventoryFailure(), Serializer::Read(), and InventoryLocation::ReadFromContext().

◆ OnInventoryJunctureFromServer()

override bool OnInventoryJunctureFromServer ( ParamsReadContext ctx)
protected

◆ OnServerInventoryCommand()

override void OnServerInventoryCommand ( ParamsReadContext ctx)
protected

◆ PlayerCheckDropRequest()

bool PlayerCheckDropRequest ( notnull InventoryLocation src,
float radius )
protected

Definition at line 3019 of file dayzplayerinventory.c.

References GetDayZPlayerOwner().

Referenced by ValidateDestroy().

◆ PlayerCheckRequestDst()

bool PlayerCheckRequestDst ( notnull InventoryLocation src,
notnull InventoryLocation dst,
float radius )
protected

Definition at line 2852 of file dayzplayerinventory.c.

References vector::Distance(), GetDayZPlayerOwner(), and GetPosition().

Referenced by ValidateSyncMove().

◆ PlayerCheckRequestSrc()

bool PlayerCheckRequestSrc ( notnull InventoryLocation src,
float radius )
protected

◆ PlayerCheckSwapItemsRequest()

bool PlayerCheckSwapItemsRequest ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
float radius )
protected

◆ PostDeferredEventTakeToDst()

override bool PostDeferredEventTakeToDst ( InventoryMode mode,
notnull InventoryLocation src,
notnull InventoryLocation dst )
protected

Definition at line 1989 of file dayzplayerinventory.c.

References DeferredTakeToDst(), and m_DeferredEvent.

Referenced by TakeToDst().

◆ PostDeferredForceSwapEntities()

override bool PostDeferredForceSwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2 )
protected

Definition at line 2148 of file dayzplayerinventory.c.

References DeferredForceSwapEntities(), and m_DeferredEvent.

Referenced by ForceSwapEntities(), and SwapEntities().

◆ PostWeaponEvent()

◆ ProcessInputData()

bool ProcessInputData ( ParamsReadContext ctx,
bool isJuncture,
bool isRemote )
protected
Returns
false on malformed data, true on anything else, including cheats

It should be impossible for juncture to be ran on remote

Serializer can be updated and re-written to when we may want to only correct the client instead of denying the inventory command

Only inform client about failure

General purpose serializer change from read to write here if the validation doesn't update it

Only send juncture back to client

Definition at line 1762 of file dayzplayerinventory.c.

References Serializer::CanWrite(), ScriptInputUserData::CopyFrom(), Error(), GetDayZPlayerOwner(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Mode, InventoryValidation::m_Reason, InventoryValidation::m_Result, Serializer::Read(), DayZPlayerSyncJunctures::SJ_INVENTORY, DayZPlayerSyncJunctures::SJ_INVENTORY_FAILURE, StoreInputForRemotes(), ValidateHandEvent(), ValidateSwap(), ValidateSyncMove(), and Serializer::Write().

Referenced by OnHandleStoredInputUserData(), OnHandleStoredJunctureData(), OnInputUserDataForRemote(), and OnServerInventoryCommand().

◆ RemoveMovableOverride()

void RemoveMovableOverride ( EntityAI item)
protected

Definition at line 1853 of file dayzplayerinventory.c.

Referenced by ValidateHandEvent(), ValidateSwap(), and ValidateSyncMove().

◆ ReserveInventory()

◆ SendRepairToClientDst()

◆ SendServerHandEventViaJuncture()

void SendServerHandEventViaJuncture ( notnull DayZPlayer player,
HandEventBase e )
staticprotected

◆ StoreInputForRemotes()

bool StoreInputForRemotes ( bool handling_juncture,
bool remote,
ParamsReadContext ctx )
protected

◆ StoreInputUserData()

proto native void StoreInputUserData ( ParamsReadContext ctx)
protected

Referenced by OnInputUserDataProcess().

◆ StoreJunctureData()

proto native void StoreJunctureData ( ParamsReadContext ctx)
protected

◆ SwapCheckExclusionMaskLocal()

bool SwapCheckExclusionMaskLocal ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2 )
protected

Local, checks only stuff that is in guaranteed sync.

Definition at line 3062 of file dayzplayerinventory.c.

Referenced by ValidateSwap().

◆ SwapEntities()

◆ SyncDeferredEventToRemotes()

void SyncDeferredEventToRemotes ( )
protected

◆ SyncHandEventToRemote()

◆ TakeToDst()

override bool TakeToDst ( InventoryMode mode,
notnull InventoryLocation src,
notnull InventoryLocation dst )
protected

Remote inputs are processed in sync juncture once performed on the server - this code below was executing the inventory command before the player simulation timeestamp for remotes which is illegal

Definition at line 1898 of file dayzplayerinventory.c.

References GameInventory::c_InventoryReservationTimeoutMS, InventoryLocation::DumpToStringNullSafe(), g_Game, GetDayZPlayerOwner(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), PostDeferredEventTakeToDst(), InventoryInputUserData::SerializeMove(), DayZPlayerSyncJunctures::SJ_INVENTORY, syncDebugPrint(), and ToString().

◆ ValidateDestroy()

bool ValidateDestroy ( inout Serializer ctx,
InventoryValidation validation )
protected

TODO(kumarjac): Probably should be called through inventory juncture, we shouldn't allow the client to delete until the server says it is okay as there can be more reasons than "cheater" for it to be rejected such as desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Definition at line 3079 of file dayzplayerinventory.c.

References GameInventory::c_MaxItemDistanceRadius, InventoryLocation::DumpToStringNullSafe(), Error(), g_Game, GetDayZPlayerOwner(), InventoryLocation::GetItem(), InventoryLocation::GetParent(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Result, PlayerCheckDropRequest(), PlayerCheckRequestSrc(), InventoryLocation::ReadFromContext(), and ToString().

◆ ValidateHandEvent()

bool ValidateHandEvent ( inout Serializer ctx,
InventoryValidation validation )
protected

Pass partial information to guards so guards can do minimal checks if needed The guards can't prevent event so it would be incorrect to pass full InventoryValidation struct. We have to make sure guards don't inadvertantly produce different results in the FSM as that will create desync (two players attempting to put a rag into the same fireplace slot at the same time)

kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote

TODO(kumarjac): Is this one correct to be 'RemoveMovableOverride' or are the other Validate methdos wrong with 'EnableMovableOverride'?

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

'HandEventBase.CheckRequestEx' updates failure reason

if it already happened on server, remote just needs to comply TODO(kumarjac): Move m_IsRemote check to inside of HandEventBase.CanPerformEventEx

'HandEventBase.CanPerformEventEx' updates failure reason

Check if this this is being executed on the server and not by a juncture or AI

Continuing on with execution of rest of the function

Is called twice unfortunately... but it works so won't change

TODO(kumarjac): We should probably set the result to failure like so

Definition at line 1048 of file dayzplayerinventory.c.

References HandEventBase::AcquireInventoryJunctureFromServer(), HandEventBase::CanPerformEventEx(), CheckForRope(), HandEventBase::CheckRequestSrc(), HandEventBase::ClearInventoryReservation(), InventoryLocation::Copy(), HandEventBase::DumpToString(), EnableMovableOverride(), Error(), g_Game, GetDayZPlayerOwner(), HandEventBase::GetDst(), GetInstanceType(), GetPlugin(), HandEventBase::GetSecondDst(), HandEventBase::GetSecondSrc(), HandEventBase::GetSecondSrcEntity(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Reason, InventoryValidation::m_Result, RemoveMovableOverride(), SendRepairToClientDst(), InventoryInputUserData::SendServerInventoryCheck(), InventoryInputUserData::SerializeHandEvent(), and syncDebugPrint().

Referenced by ProcessInputData().

◆ ValidateSwap()

bool ValidateSwap ( inout Serializer ctx,
InventoryValidation validation )
protected

kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Check if this this is being executed on the server and not by a juncture or AI

Continuing on with execution of rest of the function

Check whether the juncture for the related player and items has been acquired.

Definition at line 1344 of file dayzplayerinventory.c.

References GameInventory::c_InventoryReservationTimeoutShortMS, GameInventory::c_MaxItemDistanceRadius, GameInventory::CanForceSwapEntitiesEx(), InventoryLocation::DumpToStringNullSafe(), EnableMovableOverride(), Error(), g_Game, GetDayZPlayerOwner(), GetInstanceType(), GetPlugin(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), InventoryLocation::IsValid(), InventoryJunctureSwapValidation::m_Dst1, InventoryJunctureSwapValidation::m_Dst2, InventoryJunctureSwapValidation::m_DstItem1, InventoryJunctureSwapValidation::m_DstItem2, InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Reason, InventoryValidation::m_Result, InventoryJunctureSwapValidation::m_SkippedSwap, InventoryJunctureSwapValidation::m_Src1, InventoryJunctureSwapValidation::m_Src2, InventoryJunctureSwapValidation::m_SrcItem1, InventoryJunctureSwapValidation::m_SrcItem2, InventoryJunctureSwapValidation::m_Success, PlayerCheckRequestSrc(), PlayerCheckSwapItemsRequest(), RemoveMovableOverride(), SendRepairToClientDst(), InventoryInputUserData::SendServerInventoryCheck(), InventoryInputUserData::SerializeSwap(), SwapCheckExclusionMaskLocal(), syncDebugPrint(), ToString(), and TryAcquireTwoInventoryJuncturesFromServer().

Referenced by ProcessInputData().

◆ ValidateSyncMove()

bool ValidateSyncMove ( inout Serializer ctx,
InventoryValidation validation )
protected

kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Check if this this is being executed on the server and not by a juncture or AI so we can lock the item and ensure replication relationships are setup

TODO(kumarjac): We should continue with the execution and not have this special block but making a change here now will require testing

Is called twice unfortunately...

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Definition at line 747 of file dayzplayerinventory.c.

References GameInventory::c_MaxItemDistanceRadius, CheckForRope(), InventoryLocation::DumpToStringNullSafe(), EnableMovableOverride(), Error(), g_Game, GetDayZPlayerOwner(), GetInstanceType(), InventoryLocation::GetItem(), GetPlugin(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationCanMoveEntitySyncCheck(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Reason, InventoryValidation::m_Result, MoveCheckExclusionMaskLocal(), PlayerCheckRequestDst(), PlayerCheckRequestSrc(), InventoryLocation::ReadFromContext(), RemoveMovableOverride(), SendRepairToClientDst(), InventoryInputUserData::SendServerInventoryCheck(), syncDebugPrint(), ToString(), and TryAcquireInventoryJunctureFromServer().

Referenced by ProcessInputData().

Variable Documentation

◆ m_DeferredEvent

◆ m_DeferredPostedHandEvent

ref HandEventBase m_DeferredPostedHandEvent = NULL
protected

Definition at line 154 of file dayzplayerinventory.c.

Referenced by CancelHandEvent(), and IsProcessing().

◆ m_DeferredWeaponEvent

ref WeaponEventBase m_DeferredWeaponEvent = NULL
protected

deferred hand event

Definition at line 155 of file dayzplayerinventory.c.

Referenced by CancelWeaponEvent(), DeferredWeaponFailed(), HandleWeaponEvents(), and PostWeaponEvent().

◆ m_DeferredWeaponTimer

ref Timer m_DeferredWeaponTimer = new Timer

Definition at line 150 of file dayzplayerinventory.c.

Referenced by CancelWeaponEvent(), and HandleWeaponEvents().

◆ m_dst

◆ m_dst1

ref InventoryLocation m_dst1

Definition at line 86 of file dayzplayerinventory.c.

Referenced by DeferredForceSwapEntities().

◆ m_dst2

ref InventoryLocation m_dst2

Definition at line 87 of file dayzplayerinventory.c.

Referenced by DeferredForceSwapEntities().

◆ m_event

ref HandEventBase m_event

Definition at line 126 of file dayzplayerinventory.c.

◆ m_FSwapping

ref HandAnimatedForceSwapping m_FSwapping
protected

Definition at line 160 of file dayzplayerinventory.c.

Referenced by Init().

◆ m_FSwappingInst

ref HandAnimatedForceSwapping_Inst m_FSwappingInst
protected

Definition at line 161 of file dayzplayerinventory.c.

Referenced by Init().

◆ m_item1

◆ m_item2

EntityAI m_item2

Definition at line 85 of file dayzplayerinventory.c.

Referenced by DeferredForceSwapEntities().

◆ m_MovingTo

ref HandAnimatedMovingToAtt m_MovingTo
protected

Definition at line 158 of file dayzplayerinventory.c.

Referenced by Init().

◆ m_src

class DeferredEvent m_src

Referenced by DeferredTakeToDst().

◆ m_Swapping

ref HandAnimatedSwapping m_Swapping
protected

Definition at line 159 of file dayzplayerinventory.c.

Referenced by Init().

◆ m_Taking

ref HandAnimatedTakingFromAtt m_Taking
protected

deferred weapon event

Definition at line 157 of file dayzplayerinventory.c.

Referenced by Init().