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

◆ HandleTakeToDst()

void HandleTakeToDst ( DeferredEvent deferred_event)
protected

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

2006 {
2007 DeferredTakeToDst deferred_take_to_dst = DeferredTakeToDst.Cast(deferred_event);
2008 if( deferred_take_to_dst )
2009 {
2010 #ifdef ENABLE_LOGGING
2012 {
2013 Debug.InventoryHFSMLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
2014 }
2015 #endif
2016
2017 deferred_take_to_dst.ClearInventoryReservation(this);
2018
2020 {
2021 inventoryDebugPrint("[inv] I::Take2Dst(" + typename.EnumToString(InventoryMode, deferred_take_to_dst.m_mode) + ") src=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_src) + " dst=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_dst));
2022 }
2023
2024 switch (deferred_take_to_dst.m_mode)
2025 {
2026 case InventoryMode.PREDICTIVE:
2027 #ifdef ENABLE_LOGGING
2029 {
2030 Debug.InventoryHFSMLog("PREDICTIVE ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
2031 }
2032 #endif
2033
2034 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
2035 {
2036 #ifdef DIAG_DEVELOPER
2037 if (PluginInventoryDebug.Cast(GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
2038 {
2039 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
2040 }
2041 else
2042 {
2043 #endif
2044 InventoryInputUserData.SendInputUserDataMove(InventoryCommandType.SYNC_MOVE, deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
2045 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
2046 #ifdef DIAG_DEVELOPER
2047 }
2048 #endif
2049 }
2050 else
2051 {
2052 #ifdef ENABLE_LOGGING
2054 {
2055 Debug.InventoryMoveLog("Can not move entity (PREDICTIVE) STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " item = " + deferred_take_to_dst.m_dst.GetItem() + " dst=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_dst), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
2056 }
2057 #endif
2058 }
2059 break;
2060 case InventoryMode.JUNCTURE:
2061 #ifdef ENABLE_LOGGING
2063 {
2064 Debug.InventoryHFSMLog("JUNCTURE ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
2065 }
2066 #endif
2067
2068 if (LocationCanMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst))
2069 {
2070 #ifdef DIAG_DEVELOPER
2071 if (PluginInventoryDebug.Cast(GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
2072 {
2073 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
2074 }
2075 else
2076 {
2077 #endif
2078 DayZPlayer player = g_Game.GetPlayer();
2079 player.GetHumanInventory().AddInventoryReservationEx(deferred_take_to_dst.m_dst.GetItem(), deferred_take_to_dst.m_dst, GameInventory.c_InventoryReservationTimeoutShortMS);
2080 EnableMovableOverride(deferred_take_to_dst.m_dst.GetItem());
2081 InventoryInputUserData.SendInputUserDataMove(InventoryCommandType.SYNC_MOVE, deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
2082 #ifdef DIAG_DEVELOPER
2083 }
2084 #endif
2085 }
2086 else
2087 {
2088 #ifdef ENABLE_LOGGING
2090 {
2091 Debug.InventoryMoveLog("Can not move entity (JUNCTURE) STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " item = " + deferred_take_to_dst.m_dst.GetItem() + " dst=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_dst), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
2092 }
2093 #endif
2094 }
2095 break;
2096 case InventoryMode.LOCAL:
2097 #ifdef ENABLE_LOGGING
2099 {
2100 Debug.InventoryHFSMLog("LOCAL ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
2101 }
2102 #endif
2103 break;
2104 case InventoryMode.SERVER:
2105 #ifdef ENABLE_LOGGING
2107 {
2108 Debug.InventoryHFSMLog("SERVER ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
2109 }
2110 #endif
2111 break;
2112 default:
2113 Error("HandEvent - Invalid mode");
2114 break;
2115 }
2116 }
2117 }
void inventoryDebugPrint(string s)
InventoryCommandType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:3942
void EnableMovableOverride(EntityAI item)
Определения DayZPlayerInventory.c:1860
void DeferredTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения DayZPlayerInventory.c:15
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
proto string ToString()
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:325
Определения DayZPlayerImplement.c:87
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:207
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:197
Определения 3_Game/DayZ/tools/Debug.c:2
const int c_InventoryReservationTimeoutShortMS
script counterpart to engine's class Inventory
static void SendInputUserDataMove(int type, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения InventoryInputUserData.c:13
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:233
InventoryLocation.
Определения InventoryLocation.c:30
static bool IsInventoryHFSMLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:766
static bool IsInventoryMoveLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:746
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS, DeferredTakeToDst(), InventoryLocation::DumpToStringNullSafe(), EnableMovableOverride(), Error(), g_Game, GetDayZPlayerOwner(), GetPlugin(), inventoryDebugPrint(), Debug::InventoryHFSMLog(), Debug::InventoryMoveLog(), LogManager::IsInventoryHFSMLogEnable(), LogManager::IsInventoryMoveLogEnable(), InventoryInputUserData::SendInputUserDataMove() и ToString().

Используется в HandleInventoryManipulation().