DIFF

class DayZPlayerInventorySource

DayZPlayerInventory HumanInventoryWithFSM HumanInventory GameInventory

All members, including inherited

Constructors 1

void DayZPlayerInventory()

Members 9

ref Timer m_DeferredWeaponTimer = new Timer
protected ref HandEventBase m_DeferredPostedHandEvent = NULL

deferred hand event

ref WeaponEventBase m_DeferredWeaponEvent = NULL

deferred weapon event

protected ref HandAnimatedTakingFromAtt m_Taking
Referenced by Init()
protected ref HandAnimatedMovingToAtt m_MovingTo
Referenced by Init()
protected ref HandAnimatedSwapping m_Swapping
Referenced by Init()
protected ref HandAnimatedForceSwapping m_FSwapping
Referenced by Init()
protected ref HandAnimatedForceSwapping_Inst m_FSwappingInst
Referenced by Init()

Methods 62

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 PostWeaponEvent(WeaponEventBase e)

deferred weapon's fsm handling of events @NOTE: "post" stores the event for later use when ::CommandHandler is being run

override bool OnInventoryJunctureFromServer(ParamsReadContext ctx)

reaction to engine callback originates in: engine - DayZPlayer::OnSyncJuncture script - PlayerBase.OnSyncJuncture

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

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

protected void OnHandleStoredJunctureData(ParamsReadContext ctx)

reaction to engine callback originates in engine - DayZPlayerInventory::HandleStoredJunctureData

proto native void StoreJunctureData(ParamsReadContext ctx)

stores received input user data for later handling /aaa

override bool OnInputUserDataProcess(ParamsReadContext ctx)

reaction to engine callback originates in: engine - DayZPlayer::OnInputUserDataReceived script - DayZPlayerImplement.OnInputUserDataReceived

protected void OnHandleStoredInputUserData(ParamsReadContext ctx)

reaction to engine callback originates in engine - DayZPlayerInventory::HandleStoredInputUserData

proto native void StoreInputUserData(ParamsReadContext ctx)

stores received input user data for later handling

bool ValidateHandEvent(inout Serializer ctx, InventoryValidation validation)

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

References HandEventBase.AcquireInventoryJunctureFromServer(), HandEventBase.CanPerformEventEx(), Class.Cast()
Show 52 more, CheckForRope(), HandEventBase.CheckRequestEx(), HandEventBase.CheckRequestSrc(), HandEventBase.ClearInventoryReservation(), InventoryLocation.Copy(), array.Count(), HandEventBase.CreateHandEventFromContext(), HandEventBase.DumpToString(), EnableMovableOverride(), typename.EnumToString(), Error(), GameInventory.GetCurrentInventoryLocation(), GameInventory.GetCurrentInventoryLocation(), GetDayZPlayerOwner(), Object.GetDebugName(), HandEventBase.GetDst(), HandEventBase.GetEventID(), Man.GetHumanInventory(), DayZPlayer.GetInstanceType(), EntityAI.GetInventory(), EntityAI.GetInventory(), HumanInventory.GetManOwner(), GetPlugin(), HandEventBase.GetSecondDst(), HandEventBase.GetSecondSrc(), HandEventBase.GetSecondSrcEntity(), Entity.GetSimulationTimeStamp(), Entity.GetSimulationTimeStamp(), HandEventBase.GetSrc(), HandEventBase.GetSrcEntity(), HandEventBase.HandEventFactory(), CGame.HasInventoryJuncture(), array.Insert(), new InventoryLocation(), Debug.InventoryMoveLog(), PluginInventoryDebug.IsDesyncRepairEnable(), LogManager.IsInventoryMoveLogEnable(), LogManager.IsSyncLogEnable(), HumanInventory.ProcessHandEvent(), RemoveMovableOverride(), SendRepairToClientDst(), InventoryInputUserData.SendServerInventoryCheck(), InventoryInputUserData.SerializeHandEvent(), syncDebugPrint(), Class.ToString(), HandEventBase.m_IsJuncture, InventoryValidation.m_IsJuncture, HandEventBase.m_IsRemote, InventoryValidation.m_IsRemote, HandEventBase.m_Player, InventoryValidation.m_Reason, and InventoryValidation.m_Result
Referenced by ProcessInputData()
bool ValidateSwap(inout Serializer ctx, InventoryValidation validation)

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

References GameInventory.AddInventoryReservationEx(), GameInventory.CanForceSwapEntitiesEx(), Class.Cast()
Show 60 more, GameInventory.ClearInventoryReservationEx(), CGame.ClearJunctureEx(), array.Count(), GameInventory.DumpInventoryDebug(), InventoryLocation.DumpToStringNullSafe(), EnableMovableOverride(), typename.EnumToString(), Error(), GameInventory.GetCurrentInventoryLocation(), GameInventory.GetCurrentInventoryLocation(), GetDayZPlayerOwner(), Object.GetDebugName(), DayZPlayer.GetInstanceType(), DayZPlayer.GetInstanceType(), EntityAI.GetInventory(), EntityAI.GetInventory(), HumanInventory.GetManOwner(), GetPlugin(), Entity.GetSimulationTimeStamp(), CGame.HasInventoryJuncture(), array.Insert(), new InventoryJunctureSwapValidation(), Debug.InventoryMoveLog(), PluginInventoryDebug.IsDesyncRepairEnable(), LogManager.IsInventoryMoveLogEnable(), LogManager.IsSyncLogEnable(), InventoryLocation.IsValid(), InventoryLocation.IsValid(), InventoryLocation.IsValid(), InventoryLocation.IsValid(), GameInventory.LocationSwap(), GameInventory.LocationSyncMoveEntity(), PlayerCheckRequestSrc(), PlayerCheckSwapItemsRequest(), RemoveMovableOverride(), new ScriptInputUserData(), SendRepairToClientDst(), InventoryInputUserData.SendServerInventoryCheck(), InventoryInputUserData.SerializeSwap(), SwapCheckExclusionMaskLocal(), syncDebugPrint(), Class.ToString(), Class.ToString(), TryAcquireTwoInventoryJuncturesFromServer(), GameInventory.c_InventoryReservationTimeoutShortMS, GameInventory.c_MaxItemDistanceRadius, 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, and InventoryJunctureSwapValidation.m_Success
Referenced by ProcessInputData()
void RemoveMovableOverride(EntityAI item)

Only send juncture back to client

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

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

Referenced by TakeToDst()
override bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
override void NetSyncCurrentStateID(int id)

Engine callback - network synchronization of FSM's state. not intended to direct use.

override void OnAfterStoreLoad()

engine reaction to load from database originates in: engine - Person::BinLoad script - PlayerBase.OnAfterStoreLoad

void SyncDeferredEventToRemotes()

If singleplayer or the client is executing this

bool MoveCheckExclusionMaskLocal(notnull InventoryLocation src, notnull InventoryLocation dst)

Local, checks only stuff that is in guaranteed sync

Referenced by ValidateSyncMove()
override bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)

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