84 return m_Src.GetItem();
114 case HandEventID.DROP:
return new HandEventDrop(p, src);
115 case HandEventID.THROW:
return new HandEventThrow(p, src);
117 case HandEventID.FORCESWAP:
return new HandEventForceSwap(p, src);
122 case HandEventID.REPLACE2:
return new HandEventDestroyAndReplaceWithNewElsewhere(p, src);
123 case HandEventID.REPLACE3:
return new HandEventDestroyElsewhereAndReplaceWithNewInHands(p, src);
129 Error(
"[hndfsm] HandEventFactory - unregistered hand event with id=" +
id);
136 if (!ctx.
Read(eventID))
138 Error(
"[hndfsm] CreateHandEventFromContext - cannot read eventID");
142 if (!ctx.
Read(player))
144 Error(
"[hndfsm] CreateHandEventFromContext - cannot read player");
151 if (!ctx.
Read(animID))
153 Error(
"[hndfsm] CreateHandEventFromContext - cannot read animID");
159 b.m_AnimationID = animID;
182 if (il && !
m_Player.GetHumanInventory().HasInventoryReservation(il.
GetItem(),il))
203 m_Player.GetHumanInventory().ClearInventoryReservationEx(il.
GetItem(), il);
244 #ifdef ENABLE_LOGGING
254 return super.CanPerformEventEx(validation);
265 Error(
"[hndfsm] HandEventTake. AcquireInventoryJunctureFromServer: no src or dst for ev=" +
DumpToString());
280 m_Dst.ReadFromContext(ctx);
284 super.WriteToContext(ctx);
285 m_Dst.WriteToContext(ctx);
309 #ifdef ENABLE_LOGGING
328 Error(
"[hndfsm] HandEventMoveTo. AcquireInventoryJunctureFromServer: no src or dst for ev=" +
DumpToString());
351 #ifdef ENABLE_LOGGING
371 #ifdef ENABLE_LOGGING
390 Error(
"[hndfsm] HandEventThrow. AcquireInventoryJunctureFromServer: no src or dst for ev=" +
DumpToString());
407 super.ReadFromContext(ctx);
419 super.WriteToContext(ctx);
439 return super.CheckRequestEx(validation);
468 return super.CanPerformEventEx(validation);
486 entity.GetTransform(mat);
487 m_Dst.SetGround(entity, mat);
491 Error(
"[hndfsm] HandEventThrow src entity null!");
498 super.ReadFromContext(ctx);
514 super.WriteToContext(ctx);
516 m_Dst.WriteToContext(ctx);
547 super.ReadFromContext(ctx);
553 m_Src2.ReadFromContext(ctx);
554 m_Dst.ReadFromContext(ctx);
555 m_Dst2.ReadFromContext(ctx);
561 super.WriteToContext(ctx);
563 m_Src2.WriteToContext(ctx);
564 m_Dst.WriteToContext(ctx);
565 m_Dst2.WriteToContext(ctx);
600 #ifdef ENABLE_LOGGING
609 #ifdef ENABLE_LOGGING
627 #ifdef ENABLE_LOGGING
649 player.ForceStandUpForHeavyItemsSwap(
m_Src.GetItem(),
m_Src2.GetItem() );
686 if (
GetSrcEntity() && inHands && m_Dst && m_Dst.IsValid())
689 #ifdef ENABLE_LOGGING
703 #ifdef ENABLE_LOGGING
740 super.ReadFromContext(ctx);
742 Error(
"[hndfsm] HandEventDestroyAndReplaceWithNew - Cannot serialize lambda (read)");
746 super.WriteToContext(ctx);
748 Error(
"[hndfsm] HandEventDestroyAndReplaceWithNew - Cannot serialize lambda (write)");
798 case WeaponEvents.CHANGE_HIDE:
return new HandAnimEventChanged(p, src);
799 case WeaponEvents.CHANGE_SHOW:
return new HandAnimEventChanged(p, src);
806class HandEventHumanCommandActionFinished
extends HandEventBase
812class HandEventHumanCommandActionAborted
extends HandEventBase
void syncDebugPrint(string s)
InventoryValidationReason
@ UNKNOWN
24 - Any other error. Can be returned from any call.
static HandEventBase HandEventFactory(HandEventID id, Man p=null, InventoryLocation src=null)
static HandEventBase CreateHandEventFromContext(ParamsReadContext ctx)
InventoryLocation GetSrc()
ref InventoryLocation m_Src
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
bool CheckRequestEx(InventoryValidation validation)
@ HUMANCOMMAND_ACTION_FINISHED
@ HUMANCOMMAND_ACTION_ABORTED
@ SWAP
swapping from ground
void HandEventBase(Man p=null, InventoryLocation src=null)
InventoryLocation GetDst()
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
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)
Super root of all classes in Enforce script.
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
const int c_InventoryReservationTimeoutShortMS
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...
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
const float c_MaxItemDistanceRadius
anti-cheats
static proto native bool CheckSwapItemsRequest(notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
static proto native bool CheckMoveToDstRequest(notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
static proto native bool CheckRequestSrc(notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
script counterpart to engine's class Inventory
void HandAnimEventChanged(Man p=null, InventoryLocation src=null)
override bool CanPerformEvent()
override InventoryLocation GetDst()
override bool AcquireInventoryJunctureFromServer(notnull Man player)
override bool CheckRequest()
override bool ReserveInventory()
ref InventoryLocation m_Dst2
src of old item in hands
void HandEventCreated(Man p=null, InventoryLocation src=null)
override EntityAI GetSecondSrcEntity()
ref ReplaceItemWithNewLambdaBase m_Lambda
void HandEventHumanCommandActionFinished(Man p=null, InventoryLocation src=null)
void CheckAndExecuteForceStandUp()
void HandEventTake(Man p=null, InventoryLocation src=null)
override bool IsServerSideOnly()
void HandEventReplaced(Man p=null, InventoryLocation src=null)
void HandEventSwap(Man p=null, InventoryLocation src=null, InventoryLocation src2=null, InventoryLocation dst=null, InventoryLocation dst2=null)
void HandEventDestroy(Man p=null, InventoryLocation src=null)
void HandEventMoveTo(Man p=null, InventoryLocation src=null, InventoryLocation dst=null)
destination for item in hands
override string DumpToString()
override void ReadFromContext(ParamsReadContext ctx)
override void ClearInventoryReservation()
override void WriteToContext(ParamsWriteContext ctx)
void HandEvengReplaceWithNewBase(Man p=null, InventoryLocation src=null, ReplaceItemWithNewLambdaBase lambda=NULL)
override bool CheckRequestSrc()
void HandEventDestroyed(Man p=null, InventoryLocation src=null)
override bool CanPerformEventEx(InventoryValidation validation)
void HandEventHumanCommandActionAborted(Man p=null, InventoryLocation src=null)
ref InventoryLocation m_Src2
destination for new item (i.e. hands)
ref InventoryLocation m_Dst
int m_Animation2ID
destination for old item that was in hands
Abstracted event, not to be used, only inherited.
void HandEventDestroyAndReplaceWithNewElsewhere(Man p=null, InventoryLocation src=null, ReplaceItemWithNewLambdaBase lambda=NULL)
void HandEventDrop(Man p=null, InventoryLocation src=null)
override void ReadFromContext(ParamsReadContext ctx)
void HandEventThrow(Man p=null, InventoryLocation src=null)
override void WriteToContext(ParamsWriteContext ctx)
override bool CheckRequestEx(InventoryValidation validation)
void SetForce(vector force)
override bool CanPerformEventEx(InventoryValidation validation)
void HandEventDestroyAndReplaceWithNew(Man p=null, InventoryLocation src=null, ReplaceItemWithNewLambdaBase lambda=NULL)
void HandEventDestroyElsewhereAndReplaceWithNewInHands(Man p=null, InventoryLocation src=null, ReplaceItemWithNewLambdaBase lambda=NULL)
void HandEventForceSwap(Man p=null, InventoryLocation src=null, InventoryLocation src2=null, InventoryLocation dst=null, InventoryLocation dst2=null)
override bool CheckRequest()
override bool CanPerformEvent()
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
static string DumpToStringNullSafe(InventoryLocation loc)
bool ReadFromContext(ParamsReadContext ctx)
proto native EntityAI GetItem()
returns item of current inventory location
InventoryValidationReason m_Reason
static bool IsSyncLogEnable()
static bool IsInventoryHFSMLogEnable()
base class for transformation operations (creating one item from another)
proto bool Write(void value_out)
proto bool Read(void value_in)
DayZPlayerInstanceType
defined in C++
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
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.