DayZ 1.30
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 строка 4435

4436 {
4437 if (!IsProcessing())
4438 {
4439 EntityAI itemInHands = GetEntityInHands();
4440
4442 il.SetHands(GetInventoryOwner(), itemInHands);
4443
4444 InventoryValidation validation = new InventoryValidation();
4445 validation.m_Mode = mode;
4446 if (e.CanPerformEventEx(validation))
4447 {
4448 m_DeferredEvent = new DeferredHandEvent(mode, e);
4449 if (m_DeferredEvent.ReserveInventory(this))
4450 {
4451 return true;
4452 }
4453 }
4454
4455 m_DeferredEvent = null;
4456
4458 if (!g_Game.IsMultiplayer() || g_Game.IsClient())
4459 {
4461 OnInventoryFailure(InventoryCommandType.HAND_EVENT, validation.m_Reason, e.GetSrc(), e.GetDst());
4462 }
4463 else
4464 {
4465 ScriptInputUserData serializer();
4466
4468 serializer.Write(validation.m_Reason);
4469
4470 GetDayZPlayerOwner().SendSyncJuncture(DayZPlayerSyncJunctures.SJ_INVENTORY_FAILURE, serializer);
4471 }
4472 }
4473
4474 return false;
4475 }
InventoryCommandType
DayZGame g_Game
Определения DayZGame.c:4074
m_DeferredEvent
bool IsProcessing()
Определения DayZPlayerInventory.c:4639
override void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
Определения DayZPlayerInventory.c:643
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
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().