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

◆ ExecuteHandEventCommandRemote()

bool ExecuteHandEventCommandRemote ( inout Serializer ctx)
protected

kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote

'HandEventBase.CheckRequestEx' updates failure reason

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

2265 {
2266 HandEventBase e = HandEventBase.CreateHandEventFromContext(ctx);
2267
2268 e.m_IsJuncture = true;
2269 e.m_IsRemote = true;
2270
2271 EntityAI itemSrc = e.GetSrcEntity();
2272 EntityAI itemDst = e.GetSecondSrcEntity();
2273
2274#ifdef ENABLE_LOGGING
2276 {
2277 Debug.InventoryMoveLog("STS = " + e.m_Player.GetSimulationTimeStamp() + " event= " + e.DumpToString(), "HAND_EVENT" , "n/a", "ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2278 }
2279#endif
2280
2281 if (!itemSrc)
2282 {
2284 if (itemDst && (e.GetEventID() == HandEventID.SWAP || e.GetEventID() == HandEventID.FORCESWAP)) //presumed swap, replace with take
2285 {
2286 InventoryLocation srcNew = new InventoryLocation();
2287 srcNew.Copy(e.GetSrc());
2288 e = HandEventBase.HandEventFactory(HandEventID.TAKE, e.m_Player, srcNew);
2289
2290 Error("[syncinv] ExecuteHandEventCommandRemote remote swap event REPLACED with TAKE (cmd=HAND_EVENT, event=" + e.DumpToString() + "), src item is null! Continuing.");
2291 }
2292 else
2293 {
2294#ifdef ENABLE_LOGGING
2296 {
2297 Debug.InventoryMoveLog("Failed - CheckRequestSrc", "HAND_EVENT" , "n/a", "ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2298 }
2299#endif
2300
2301 Error("[syncinv] ExecuteHandEventCommandRemote remote input (cmd=HAND_EVENT, event=" + e.DumpToString() + ") dropped, item not in bubble");
2302
2303 return true;
2304 }
2305 }
2306
2307 if (itemSrc)
2308 {
2309 //???
2310 RemoveMovableOverride(itemSrc);
2311 }
2312 if (itemDst)
2313 {
2314 //???
2315 RemoveMovableOverride(itemDst);
2316 }
2317
2318 InventoryValidation validation = new InventoryValidation();
2319 validation.m_IsJuncture = true;
2320 validation.m_IsRemote = false;
2321 validation.m_Mode = InventoryMode.JUNCTURE;
2322
2323 if (!e.CheckRequestEx(validation))//??? This should be remove in refactor, but for drop it has some functionality
2324 {
2325#ifdef ENABLE_LOGGING
2327 {
2328 Debug.InventoryMoveLog("Failed - CheckRequest", "HAND_EVENT" , "n/a", "ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2329 }
2330#endif
2331
2333
2334 ctx = new ScriptInputUserData();
2336
2337#ifdef ENABLE_LOGGING
2339 {
2340 syncDebugPrint("[cheat] ExecuteHandEventCommandRemote man=" + Object.GetDebugName(GetManOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " is cheating with cmd=" + typename.EnumToString(InventoryCommandType, InventoryCommandType.HAND_EVENT) + " event=" + e.DumpToString());
2341 }
2342#endif
2343
2344 return true;
2345 }
2346
2347#ifdef ENABLE_LOGGING
2349 {
2350 Debug.InventoryMoveLog("Success", "HAND_EVENT" , "n/a", "ExecuteHandEventCommandRemote", e.m_Player.ToString() );
2351 }
2352#endif
2353
2354 return e.m_Player.GetHumanInventory().ProcessHandEvent(e);
2355 }
void syncDebugPrint(string s)
InventoryCommandType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void RemoveMovableOverride(EntityAI item)
Определения DayZPlayerInventory.c:3683
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
HandEventID
events
Определения Hand_Events.c:7
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:198
Определения 3_Game/DayZ/tools/Debug.c:2
override EntityAI GetSecondSrcEntity()
Определения Hand_Events.c:610
override string DumpToString()
Определения Hand_Events.c:333
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:212
static void SerializeHandEvent(ParamsWriteContext ctx, HandEventBase e)
hand
Определения InventoryInputUserData.c:105
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location
InventoryLocation.
Определения InventoryLocation.c:30
static bool IsSyncLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:789
static bool IsInventoryMoveLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:759
Определения ObjectTyped.c:2
Определения gameplay.c:121
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки InventoryLocation::Copy(), HandEventBase::DumpToString(), Error(), GetDayZPlayerOwner(), HandEventBase::GetSecondSrcEntity(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Mode, RemoveMovableOverride(), InventoryInputUserData::SerializeHandEvent() и syncDebugPrint().

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