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

◆ ExecuteSyncMoveCommandClient()

bool ExecuteSyncMoveCommandClient ( ParamsReadContext ctx)
protected

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

1399 {
1402
1403 if (!src.ReadFromContext(ctx))
1404 {
1405 return false;
1406 }
1407 if (!dst.ReadFromContext(ctx))
1408 {
1409 return false;
1410 }
1411
1412#ifdef ENABLE_LOGGING
1414 {
1415 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandClient", GetDayZPlayerOwner().ToString() );
1416 }
1417#endif
1418
1419 EntityAI itemSrc = src.GetItem();
1420 EntityAI itemDst = dst.GetItem();
1421
1422 RemoveMovableOverride(itemSrc);
1423 #ifdef ENABLE_LOGGING
1425 {
1426 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " ExecuteSyncMoveCommandClient t=" + g_Game.GetTime() + "ms received cmd=" + typename.EnumToString(InventoryCommandType, InventoryCommandType.SYNC_MOVE) + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
1427 }
1428 #endif
1429
1430 ClearInventoryReservationEx(itemDst, dst);
1431
1432 //TODO: hotfix solution
1433 if (!MoveCheckExclusionMaskLocal(src,dst))
1434 {
1435#ifdef ENABLE_LOGGING
1437 {
1438 Debug.InventoryMoveLog("Failed - MoveCheckExclusionMaskLocal - condition failed locally STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandClient", GetDayZPlayerOwner().ToString() );
1439 }
1440#endif
1441 return false;
1442 }
1443
1444 if (!GameInventory.LocationTestAddEntity(dst, false, true, true, true, false, false))
1445 {
1446#ifdef ENABLE_LOGGING
1448 {
1449 Debug.InventoryMoveLog("Fail - LocationSyncMoveEntity Can not move entity STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandClient", GetDayZPlayerOwner().ToString() );
1450 }
1451#endif
1452 return false;
1453 }
1454
1455#ifdef ENABLE_LOGGING
1457 {
1458 Debug.InventoryMoveLog("Success - LocationSyncMoveEntity STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandClient", GetDayZPlayerOwner().ToString() );
1459 }
1460#endif
1461 return LocationSyncMoveEntity(src, dst);
1462 }
void syncDebugPrint(string s)
InventoryCommandType
void ClearInventoryReservationEx(ActionData action_data)
Определения ActionBase.c:1120
DayZGame g_Game
Определения DayZGame.c:4074
bool MoveCheckExclusionMaskLocal(notnull InventoryLocation src, notnull InventoryLocation dst)
Local, checks only stuff that is in guaranteed sync.
Определения DayZPlayerInventory.c:4881
void RemoveMovableOverride(EntityAI item)
Определения DayZPlayerInventory.c:3683
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
proto string ToString()
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
static proto native bool LocationTestAddEntity(notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....
script counterpart to engine's class Inventory
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:233
bool ReadFromContext(ParamsReadContext ctx)
Определения InventoryLocation.c:310
proto native EntityAI GetItem()
returns item of current inventory 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

Перекрестные ссылки ClearInventoryReservationEx(), InventoryLocation::DumpToStringNullSafe(), g_Game, GetDayZPlayerOwner(), InventoryLocation::GetItem(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), GameInventory::LocationTestAddEntity(), MoveCheckExclusionMaskLocal(), InventoryLocation::ReadFromContext(), RemoveMovableOverride(), syncDebugPrint() и ToString().

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