DayZ 1.24
Loading...
Searching...
No Matches
Hand_Events.c
Go to the documentation of this file.
1
2
26
34
38class HandEventBase
39{
40 int m_EventID = 0;
41 int m_AnimationID = -1;
44
51
54
56 {
57 return m_Player && (m_Player.GetInstanceType() != DayZPlayerInstanceType.INSTANCETYPE_CLIENT && m_Player.GetInstanceType() != DayZPlayerInstanceType.INSTANCETYPE_REMOTE);
58 }
59
60 bool IsOwner()
61 {
62 return m_Player && (m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT || m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_AI_SERVER || m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_AI_SINGLEPLAYER);
63 }
64
65 bool IsProxy()
66 {
67 return m_Player && (m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_REMOTE || m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_AI_REMOTE);
68 }
69
70 void ReadFromContext(ParamsReadContext ctx) { } // actual read is in CreateHandEventFromContext
71
79
82 {
83 if (m_Src)
84 return m_Src.GetItem();
85 return null;
86 }
89 int GetAnimationID() { return m_AnimationID; }
91 bool CheckRequest() { return true; }
93 {
97 if (validation.m_IsRemote || validation.m_IsJuncture)
98 return true;
99
100 return CheckRequest();
101 }
102 bool CanPerformEvent() { return true; }
104 bool CheckRequestSrc() { return true; }
105 bool IsServerSideOnly() { return false; }
106
108 {
109 switch (id)
110 {
111 case HandEventID.UNKNOWN: return null;
112 case HandEventID.TAKE: return new HandEventTake(p, src);
113 case HandEventID.MOVETO: return new HandEventMoveTo(p, src);
114 case HandEventID.DROP: return new HandEventDrop(p, src);
115 case HandEventID.THROW: return new HandEventThrow(p, src);
116 case HandEventID.SWAP: return new HandEventSwap(p, src);
117 case HandEventID.FORCESWAP: return new HandEventForceSwap(p, src);
118 case HandEventID.DESTROY: return new HandEventDestroy(p, src);
119 case HandEventID.CREATED: return new HandEventCreated(p, src);
120 case HandEventID.DESTROYED: return new HandEventDestroyed(p, src);
121 case HandEventID.REPLACE: return new HandEventDestroyAndReplaceWithNew(p, src);
122 case HandEventID.REPLACE2: return new HandEventDestroyAndReplaceWithNewElsewhere(p, src);
123 case HandEventID.REPLACE3: return new HandEventDestroyElsewhereAndReplaceWithNewInHands(p, src);
124 case HandEventID.REPLACED: return new HandEventReplaced(p, src);
125 case HandEventID.ANIMEVENT_CHANGE_HIDE: return HandAnimEventChanged(p, src);
126 case HandEventID.HUMANCOMMAND_ACTION_FINISHED : return HandEventHumanCommandActionFinished(p, src);
127 case HandEventID.HUMANCOMMAND_ACTION_ABORTED : return HandEventHumanCommandActionAborted(p, src);
128 }
129 Error("[hndfsm] HandEventFactory - unregistered hand event with id=" + id);
130 return null;
131 }
132
134 {
135 int eventID = -1;
136 if (!ctx.Read(eventID))
137 {
138 Error("[hndfsm] CreateHandEventFromContext - cannot read eventID");
139 return null;
140 }
141 Man player;
142 if (!ctx.Read(player))
143 {
144 Error("[hndfsm] CreateHandEventFromContext - cannot read player");
145 return null;
146 }
149
150 int animID = -1;
151 if (!ctx.Read(animID))
152 {
153 Error("[hndfsm] CreateHandEventFromContext - cannot read animID");
154 return null;
155 }
157 if (b)
158 {
159 b.m_AnimationID = animID;
161 }
162 return b;
163 }
164
166 {
167 string res = "{ HandEv id=" + typename.EnumToString(HandEventID, GetEventID());
168 res = res + " pl=" + Object.GetDebugName(m_Player);
170 res = res + " }";
171 return res;
172 }
173
175 {
177 if (dst && !m_Player.GetHumanInventory().AddInventoryReservationEx(dst.GetItem(), dst, GameInventory.c_InventoryReservationTimeoutShortMS))
178 return false;
179 return true;
180 }
181
183 {
185 if (dst)
186 m_Player.GetHumanInventory().ClearInventoryReservationEx(dst.GetItem(), dst);
187 }
188};
189
190class HandEventTake extends HandEventBase
191{
193
195 {
197 dst.SetHands(m_Player, GetSrcEntity());
198 return dst;
199 }
200
201 override bool CheckRequestSrc()
202 {
204 {
205 Debug.InventoryHFSMLog("CANNOT perform", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CheckRequestSrc", m_Player.ToString());
206 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[cheat] HandleInputData man=" + Object.GetDebugName(m_Player) + " failed src1 check with cmd=" + typename.EnumToString(HandEventID, GetEventID()) + " src1=" + InventoryLocation.DumpToStringNullSafe(GetSrc()));
207 return false; // stale packet
208 }
209 return true;
210 }
211
216
218 {
219 if (validation.m_IsJuncture)
220 return true;
221
223 {
224#ifdef DEVELOPER
226 Debug.InventoryHFSMLog("CANNOT perform", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CanPerformEvent", m_Player.ToString());
227#endif
228 //if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[desync] HandleInputData man=" + Object.GetDebugName(m_Player) + " CANNOT perform ev=" + DumpToString());
229 return false;
230 }
231
232 return super.CanPerformEventEx(validation);
233 }
234
236 {
239 if (src && dst)
241 Error("[hndfsm] HandEventTake. AcquireInventoryJunctureFromServer: no src or dst for ev=" + DumpToString());
242 return JunctureRequestResult.ERROR;
243 }
244};
245
246class HandEventMoveTo extends HandEventBase
247{
249
251
253 {
254 m_Dst = new InventoryLocation;
255 super.ReadFromContext(ctx);
256 m_Dst.ReadFromContext(ctx);
257 }
259 {
260 super.WriteToContext(ctx);
261 m_Dst.WriteToContext(ctx);
262 }
263
264 override InventoryLocation GetDst() { return m_Dst; }
265
266 override bool CheckRequestSrc()
267 {
269 {
270 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[cheat] HandleInputData man=" + Object.GetDebugName(m_Player) + " failed src1 check with cmd=" + typename.EnumToString(HandEventID, GetEventID()) + " src1=" + InventoryLocation.DumpToStringNullSafe(GetSrc()));
271 return false; // stale packet
272 }
273 return true;
274 }
275
280
281 override bool CanPerformEvent()
282 {
284 {
285#ifdef DEVELOPER
287 Debug.InventoryHFSMLog("CANNOT perform", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CanPerformEvent", m_Player.ToString());
288#endif
289 return false;
290 }
291 return true;
292 }
293
295 {
298 if (src && dst)
300 Error("[hndfsm] HandEventMoveTo. AcquireInventoryJunctureFromServer: no src or dst for ev=" + DumpToString());
301 return JunctureRequestResult.ERROR;
302 }
303
304 override string DumpToString()
305 {
306 string res = "{ HandEventMoveTo id=" + typename.EnumToString(HandEventID, GetEventID()) + " pl=" + Object.GetDebugName(m_Player) + " src=" + InventoryLocation.DumpToStringNullSafe(m_Src) + " dst=" + InventoryLocation.DumpToStringNullSafe(m_Dst) + " }";
307 return res;
308 }
309};
310
312class HandEventRemove extends HandEventBase
313{
315 {
316 return m_Dst;
317 }
318
319 override bool CheckRequestSrc()
320 {
322 {
323#ifdef DEVELOPER
325 Debug.InventoryHFSMLog("Check src - failed, src = " + InventoryLocation.DumpToStringNullSafe(GetSrc()), typename.EnumToString(HandEventID, GetEventID()), "n/a", "CheckRequestSrc", m_Player.ToString());
326#endif
327 return false; // stale packet
328 }
329 return true;
330 }
331
336
337 override bool CanPerformEvent()
338 {
340 {
341#ifdef DEVELOPER
343 Debug.InventoryHFSMLog("CANNOT perform", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CanPerformEvent", m_Player.ToString());
344#endif
345 return false;
346 }
347 return true;
348 }
349
351 {
354 if (src && dst)
356 Error("[hndfsm] HandEventThrow. AcquireInventoryJunctureFromServer: no src or dst for ev=" + DumpToString());
357 return JunctureRequestResult.ERROR;
358 }
359
361};
362
363class HandEventDrop extends HandEventRemove
364{
366 {
367 m_EventID = HandEventID.DROP;
368 m_CanPerformDrop = true;
369 }
370
372 {
373 super.ReadFromContext(ctx);
374
375 ctx.Read(m_CanPerformDrop);
377 if (!m_Dst)
378 m_Dst = new InventoryLocation();
379 }
380
382 {
383 super.WriteToContext(ctx);
384
385 ctx.Write(m_CanPerformDrop);
387 }
388
390 {
392 if (!validation.m_IsJuncture && IsAuthoritative())
393 m_CanPerformDrop = GameInventory.SetGroundPosByOwner(m_Player, GetSrcEntity(), m_Dst);
394
395 if (!m_CanPerformDrop)
396 {
397 validation.m_Reason = InventoryValidationReason.DROP_PREVENTED;
398 return false;
399 }
400
401 return super.CheckRequestEx(validation);
402 }
403
405 {
406 if (!m_CanPerformDrop)
407 return false;
408
410 if (!validation.m_IsJuncture && !validation.m_IsRemote && !GetDst() && (GetGame().IsMultiplayer() && GetGame().IsClient()))
411 return true;
412
414 if (!validation.m_IsRemote && !GetDst())
415 {
416 m_Dst = new InventoryLocation();
417 m_CanPerformDrop = GameInventory.SetGroundPosByOwner(m_Player, GetSrcEntity(), m_Dst);
418
419 if (!m_CanPerformDrop)
420 {
421 validation.m_Reason = InventoryValidationReason.DROP_PREVENTED;
422 return false;
423 }
424 }
425
426 return super.CanPerformEventEx(validation);
427 }
428
430};
431
432class HandEventThrow extends HandEventRemove
433{
435 {
436 m_EventID = HandEventID.THROW;
437 if (src)
438 {
439 vector mat[4];
441 if (entity)
442 {
443 m_Dst = new InventoryLocation;
444 entity.GetTransform(mat);
445 m_Dst.SetGround(entity, mat);
446 }
447 else
448 Error("[hndfsm] HandEventThrow src entity null!");
449 }
450 }
451
453 {
454 super.ReadFromContext(ctx);
455
456 m_Dst = new InventoryLocation;
457 m_Dst.ReadFromContext(ctx);
458
459 float x, y, z;
460 ctx.Read(x);
461 ctx.Read(y);
462 ctx.Read(z);
463 m_Force[0] = x;
464 m_Force[1] = y;
465 m_Force[2] = z;
466 }
467
469 {
470 super.WriteToContext(ctx);
471
472 m_Dst.WriteToContext(ctx);
473
474 ctx.Write(m_Force[0]);
475 ctx.Write(m_Force[1]);
476 ctx.Write(m_Force[2]);
477 }
478
479 void SetForce(vector force) { m_Force = force; }
480 vector GetForce() { return m_Force; }
481
483};
484
485class HandEventSwap extends HandEventBase
486{
487 // super.m_Src == src location of new item (that will be taken)
488 ref InventoryLocation m_Dst;
491 int m_Animation2ID = -1;
492
494 {
495 m_EventID = HandEventID.SWAP;
496 m_Dst = dst;
497 m_Src2 = src2;
498 m_Dst2 = dst2;
499 }
500
502 {
503 super.ReadFromContext(ctx);
504
505 m_Src2 = new InventoryLocation;
506 m_Dst = new InventoryLocation;
507 m_Dst2 = new InventoryLocation;
508
509 m_Src2.ReadFromContext(ctx);
510 m_Dst.ReadFromContext(ctx);
511 m_Dst2.ReadFromContext(ctx);
512 ctx.Read(m_Animation2ID);
513 }
514
516 {
517 super.WriteToContext(ctx);
518
519 m_Src2.WriteToContext(ctx);
520 m_Dst.WriteToContext(ctx);
521 m_Dst2.WriteToContext(ctx);
522 ctx.Write(m_Animation2ID);
523 }
524
526 {
527 return m_Dst;
528 }
529
531 {
532 return m_Src2.GetItem();
533 }
534
535 override bool CheckRequestSrc()
536 {
537 //return false;
538
540 {
541 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[cheat] HandleInputData man=" + Object.GetDebugName(m_Player) + " failed src1 check with cmd=" + typename.EnumToString(HandEventID, GetEventID()) + " src1=" + InventoryLocation.DumpToStringNullSafe(GetSrc()));
542 return false; // stale packet
543 }
545 {
546 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[cheat] HandleInputData man=" + Object.GetDebugName(m_Player) + " failed src2 check with cmd=" + typename.EnumToString(HandEventID, GetEventID()) + " src2=" + InventoryLocation.DumpToStringNullSafe(m_Src2));
547 return false; // stale packet
548 }
549 return true;
550 }
551
552 override bool CheckRequest()
553 {
555 {
556#ifdef DEVELOPER
558 Debug.InventoryHFSMLog("CheckSwapItemsRequest - failed", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CheckRequest", m_Player.ToString());
559#endif
560 }
561 else if (!m_Player.GetHumanInventory().CanAddSwappedEntity(m_Src, m_Src2, m_Dst, m_Dst2))
562 {
563#ifdef DEVELOPER
565 Debug.InventoryHFSMLog("CanAddSwappedEntity - failed", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CheckRequest", m_Player.ToString());
566#endif
567 }
568 else
569 return true;
570
571 return false;
572 }
573
574 override bool CanPerformEvent()
575 {
576 if (GameInventory.CanForceSwapEntitiesEx(GetSrc().GetItem(), m_Dst, m_Src2.GetItem(), m_Dst2))
577 return true;
578
579#ifdef DEVELOPER
581 Debug.InventoryHFSMLog("CANNOT perform", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CanPerformEvent", m_Player.ToString());
582#endif
583 return false;
584 }
585
587 {
588 return TryAcquireTwoInventoryJuncturesFromServer(player, m_Src, m_Src2, m_Dst, m_Dst2);
589 }
590
591 override string DumpToString()
592 {
593 return "{ HandEventSwap id=" + typename.EnumToString(HandEventID, GetEventID()) + " pl=" + Object.GetDebugName(m_Player) + " src1=" + InventoryLocation.DumpToStringNullSafe(m_Src) + " src2=" + InventoryLocation.DumpToStringNullSafe(m_Src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(m_Dst) + " dst2=" + InventoryLocation.DumpToStringNullSafe(m_Dst2) + " }";
594 }
595
597 {
599 player.ForceStandUpForHeavyItemsSwap(m_Src.GetItem(), m_Src2.GetItem());
600 }
601
602 override bool ReserveInventory()
603 {
604 if (!m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst.GetItem(), m_Dst, GameInventory.c_InventoryReservationTimeoutShortMS))
605 return false;
606 if (!m_Player.GetHumanInventory().AddInventoryReservationEx(m_Dst2.GetItem(), m_Dst2, GameInventory.c_InventoryReservationTimeoutShortMS))
607 {
608 m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst.GetItem(), m_Dst);
609 return false;
610 }
611 return true;
612 }
613
615 {
616 m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst.GetItem(), m_Dst);
617 m_Player.GetHumanInventory().ClearInventoryReservationEx(m_Dst2.GetItem(), m_Dst2);
618 }
619};
620
621class HandEventForceSwap extends HandEventSwap
622{
624
625 override bool CheckRequest()
626 {
627 bool test1 = false;
628 EntityAI inHands = m_Player.GetHumanInventory().GetEntityInHands();
629 if (GetSrcEntity() && inHands && m_Dst && m_Dst.IsValid())
630 {
632#ifdef DEVELOPER
634 {
635 if (!test1)
636 Debug.InventoryHFSMLog("CheckSwapItemsRequest failed", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CheckRequest", m_Player.ToString());
637 }
638#endif
639 }
640 return test1;
641 }
642
643 override bool CanPerformEvent()
644 {
645 bool test2 = GameInventory.CanForceSwapEntitiesEx(m_Src.GetItem(), m_Dst, m_Src2.GetItem(), m_Dst2); // null here means 'do not search for dst2' (already have valid one from constructor)
646#ifdef DEVELOPER
648 {
649 if (!test2)
650 Debug.InventoryHFSMLog("CanForceSwapEntitiesEx failed", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CanPerformEvent", m_Player.ToString());
651 }
652#endif
653 return test2;
654 }
655};
656
657class HandEventDestroy extends HandEventBase
658{
660
661 override bool IsServerSideOnly() { return true; }
662};
663
664class HandEventCreated extends HandEventBase
665{
667};
668
669class HandEventDestroyed extends HandEventBase
670{
672};
673
675{
676 string m_Type;
678
680
682 {
683 super.ReadFromContext(ctx);
684 ctx.Read(m_Type);
685 Error("[hndfsm] HandEventDestroyAndReplaceWithNew - Cannot serialize lambda (read)");
686 }
688 {
689 super.WriteToContext(ctx);
690 ctx.Write(m_Type);
691 Error("[hndfsm] HandEventDestroyAndReplaceWithNew - Cannot serialize lambda (write)");
692 }
693
694 override bool IsServerSideOnly() { return true; }
695
697 {
699 dst.SetHands(m_Player, GetSrcEntity());
700 return dst;
701 }
702
703 override string DumpToString()
704 {
705 string res = "{ HandEvenReplaceWithNewBase id=" + typename.EnumToString(HandEventID, GetEventID()) + " pl=" + Object.GetDebugName(m_Player) + " src=" + InventoryLocation.DumpToStringNullSafe(GetSrc()) + " lambda=" + m_Lambda + " dst=" + InventoryLocation.DumpToStringNullSafe(GetDst()) + " }";
706 return res;
707 }
708};
709
714
715class HandEventDestroyAndReplaceWithNewElsewhere extends HandEventDestroyAndReplaceWithNew
716{
718};
719
720class HandEventDestroyElsewhereAndReplaceWithNewInHands extends HandEventReplaceWithNewBase
721{
723};
724
725class HandEventReplaced extends HandEventBase
726{
728};
729
730// anim events
731
732class HandAnimEventChanged extends HandEventBase
733{
734 void HandAnimEventChanged(Man p = null, InventoryLocation src = null) { m_EventID = HandEventID.ANIMEVENT_CHANGE_HIDE; }
735};
736
738{
739 switch (type)
740 {
741 case WeaponEvents.CHANGE_HIDE: return new HandAnimEventChanged(p, src);
742 case WeaponEvents.CHANGE_SHOW: return new HandAnimEventChanged(p, src);
743 }
744 return null;
745}
746
749class HandEventHumanCommandActionFinished extends HandEventBase
750{
751 void HandEventHumanCommandActionFinished(Man p = null, InventoryLocation src = null) { m_EventID = HandEventID.HUMANCOMMAND_ACTION_FINISHED; }
752};
755class HandEventHumanCommandActionAborted extends HandEventBase
756{
757 void HandEventHumanCommandActionAborted(Man p = null, InventoryLocation src = null) { m_EventID = HandEventID.HUMANCOMMAND_ACTION_ABORTED; }
758};
759
761
void syncDebugPrint(string s)
Definition Debug.c:1
InventoryValidationReason
Definition Inventory.c:37
eBleedingSourceType m_Type
DayZPlayer m_Player
Definition Hand_Events.c:42
static HandEventBase HandEventFactory(HandEventID id, Man p=null, InventoryLocation src=null)
bool m_IsRemote
Definition Hand_Events.c:50
JUNCTURE_ACQUIRED
Definition Hand_Events.c:30
static HandEventBase CreateHandEventFromContext(ParamsReadContext ctx)
ERROR
Definition Hand_Events.c:32
int GetAnimationID()
Definition Hand_Events.c:89
bool IsAuthoritative()
Definition Hand_Events.c:55
InventoryLocation GetSrc()
Definition Hand_Events.c:80
ref InventoryLocation m_Src
Definition Hand_Events.c:43
bool m_IsJuncture
Definition Hand_Events.c:49
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
JUNCTURE_DENIED
Definition Hand_Events.c:31
JunctureRequestResult
Definition Hand_Events.c:28
JUNCTURE_NOT_REQUIRED
Definition Hand_Events.c:29
m_EventID
bool CheckRequestEx(InventoryValidation validation)
Definition Hand_Events.c:92
HandEventID GetEventID()
Definition Hand_Events.c:53
HandEventID
events
Definition Hand_Events.c:7
@ FORCESWAP
Definition Hand_Events.c:14
@ HUMANCOMMAND_ACTION_FINISHED
Definition Hand_Events.c:22
@ DESTROYED
Definition Hand_Events.c:17
@ DESTROY
Definition Hand_Events.c:15
@ MOVETO
Definition Hand_Events.c:10
@ UNKNOWN
Definition Hand_Events.c:8
@ TAKE
Definition Hand_Events.c:9
@ REPLACE
Definition Hand_Events.c:18
@ DROP
Definition Hand_Events.c:11
@ REPLACED
Definition Hand_Events.c:21
@ REPLACE2
Definition Hand_Events.c:19
@ REPLACE3
Definition Hand_Events.c:20
@ ANIMEVENT_CHANGE_HIDE
Definition Hand_Events.c:24
@ CREATED
Definition Hand_Events.c:16
@ THROW
Definition Hand_Events.c:12
@ HUMANCOMMAND_ACTION_ABORTED
Definition Hand_Events.c:23
@ SWAP
swapping from ground
Definition Hand_Events.c:13
int m_AnimationID
Definition Hand_Events.c:41
bool IsOwner()
Definition Hand_Events.c:60
void HandEventBase(Man p=null, InventoryLocation src=null)
Definition Hand_Events.c:52
string DumpToString()
EntityAI GetSrcEntity()
Definition Hand_Events.c:81
InventoryLocation GetDst()
Definition Hand_Events.c:88
bool IsProxy()
Definition Hand_Events.c:65
Icon x
Icon y
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)
Definition Junctures.c:2
bool TryAcquireTwoInventoryJuncturesFromServer(notnull Man player, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
Definition Junctures.c:27
EntityAI GetItem()
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Debug.c:14
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:183
script counterpart to engine's class Inventory
Definition Inventory.c:79
const int c_InventoryReservationTimeoutShortMS
Definition Inventory.c:688
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
Definition Inventory.c:1212
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Definition Inventory.c:645
const float c_MaxItemDistanceRadius
anti-cheats
Definition Inventory.c:788
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)
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...
Abstracted event, not to be used, only inherited.
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
void HandEventDestroyAndReplaceWithNewElsewhere(Man p=null, InventoryLocation src=null, ReplaceItemWithNewLambdaBase lambda=NULL)
void HandEventDrop(Man p=null, InventoryLocation src=null)
override void ReadFromContext(ParamsReadContext ctx)
vector GetForce()
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()
InventoryLocation.
static string DumpToStringNullSafe(InventoryLocation loc)
bool ReadFromContext(ParamsReadContext ctx)
static bool IsSyncLogEnable()
Definition Debug.c:759
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:749
base class for transformation operations (creating one item from another)
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
DayZPlayerInstanceType
defined in C++
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
WeaponEvents
events
Definition human.c:943