DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandEvent()

override bool HandEvent ( InventoryMode mode,
HandEventBase e )
protected

Let the client know a failure happened

If singleplayer or the client is executing this

См. определение в файле DayZPlayerInventory.c строка 2605

2606 {
2607 if (!IsProcessing())
2608 {
2609 EntityAI itemInHands = GetEntityInHands();
2610
2612 il.SetHands(GetInventoryOwner(), itemInHands);
2613
2614 InventoryValidation validation = new InventoryValidation();
2615 validation.m_Mode = mode;
2616 if (e.CanPerformEventEx(validation))
2617 {
2618 m_DeferredEvent = new DeferredHandEvent(mode, e);
2619 if (m_DeferredEvent.ReserveInventory(this))
2620 {
2621 return true;
2622 }
2623 }
2624
2625 m_DeferredEvent = null;
2626
2628 if (!g_Game.IsMultiplayer() || g_Game.IsClient())
2629 {
2631 OnInventoryFailure(InventoryCommandType.HAND_EVENT, validation.m_Reason, e.GetSrc(), e.GetDst());
2632 }
2633 else
2634 {
2635 ScriptInputUserData serializer();
2636
2638 serializer.Write(validation.m_Reason);
2639
2640 GetDayZPlayerOwner().SendSyncJuncture(DayZPlayerSyncJunctures.SJ_INVENTORY_FAILURE, serializer);
2641 }
2642 }
2643
2644 return false;
2645 }
InventoryCommandType
DayZGame g_Game
Определения DayZGame.c:3942
m_DeferredEvent
bool IsProcessing()
Определения DayZPlayerInventory.c:2809
override void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
Определения DayZPlayerInventory.c:640
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
void DeferredHandEvent(InventoryMode mode, HandEventBase e)
Определения DayZPlayerInventory.c:127
static const int SJ_INVENTORY_FAILURE
Определения DayZPlayerSyncJunctures.c:32
override InventoryLocation GetDst()
Определения Hand_Events.c:215
override bool CanPerformEventEx(InventoryValidation validation)
Определения Hand_Events.c:238
static void SerializeHandEvent(ParamsWriteContext ctx, HandEventBase e)
hand
Определения InventoryInputUserData.c:105
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
InventoryLocation.
Определения InventoryLocation.c:30
InventoryValidationReason m_Reason
Определения gameplay.c:121

Перекрестные ссылки HandEventBase::CanPerformEventEx(), DeferredHandEvent(), g_Game, GetDayZPlayerOwner(), HandEventBase::GetDst(), IsProcessing(), m_DeferredEvent, InventoryValidation::m_Mode, InventoryValidation::m_Reason, OnInventoryFailure(), InventoryInputUserData::SerializeHandEvent(), InventoryLocation::SetHands(), DayZPlayerSyncJunctures::SJ_INVENTORY_FAILURE и Serializer::Write().