DayZ 1.27
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 строка 2290

2291 {
2292 if (!IsProcessing())
2293 {
2294 EntityAI itemInHands = GetEntityInHands();
2295
2296 InventoryLocation handInventoryLocation();
2297 handInventoryLocation.SetHands(GetInventoryOwner(), itemInHands);
2298
2299 InventoryValidation validation();
2300 if (e.CanPerformEventEx(validation))
2301 {
2302 m_DeferredEvent = new DeferredHandEvent(mode, e);
2303 if (m_DeferredEvent.ReserveInventory(this))
2304 {
2305 return true;
2306 }
2307 }
2308
2309 m_DeferredEvent = null;
2310
2312 if (!GetGame().IsMultiplayer() || GetGame().IsClient())
2313 {
2315 OnInventoryFailure(InventoryCommandType.HAND_EVENT, validation.m_Reason, e.GetSrc(), e.GetDst());
2316 }
2317 else
2318 {
2319 ScriptInputUserData serializer();
2320
2322 serializer.Write(validation.m_Reason);
2323
2324 GetDayZPlayerOwner().SendSyncJuncture(DayZPlayerSyncJunctures.SJ_INVENTORY_FAILURE, serializer);
2325 }
2326 }
2327
2328 return false;
2329 }
InventoryCommandType
Определения Inventory.c:3
m_DeferredEvent
bool IsProcessing()
Определения DayZPlayerInventory.c:2461
override void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
Определения DayZPlayerInventory.c:665
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:168
void DeferredHandEvent(InventoryMode mode, HandEventBase e)
Определения DayZPlayerInventory.c:127
static const int SJ_INVENTORY_FAILURE
Определения DayZPlayerSyncJunctures.c:32
Определения Building.c:6
override InventoryLocation GetDst()
Определения Hand_Events.c:212
override bool CanPerformEventEx(InventoryValidation validation)
Определения Hand_Events.c:235
static void SerializeHandEvent(ParamsWriteContext ctx, HandEventBase e)
hand
Определения InventoryInputUserData.c:72
InventoryLocation.
Определения InventoryLocation.c:29
Определения Inventory.c:44
Определения gameplay.c:121
proto native CGame GetGame()

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