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

◆ ExecuteSyncMoveCommandServer()

bool ExecuteSyncMoveCommandServer ( ParamsReadContext ctx)
protected

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

1308 {
1311
1312 if (!src.ReadFromContext(ctx))
1313 return false;
1314 if (!dst.ReadFromContext(ctx))
1315 return false;
1316
1317#ifdef ENABLE_LOGGING
1319 {
1320 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandServer", GetDayZPlayerOwner().ToString() );
1321 }
1322#endif
1323
1324 EntityAI itemSrc = src.GetItem();
1325 EntityAI itemDst = dst.GetItem();
1326
1327RemoveMovableOverride(itemSrc);
1328 #ifdef ENABLE_LOGGING
1330 {
1331 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " ExecuteSyncMoveCommandServer t=" + g_Game.GetTime() + "ms received cmd=" + typename.EnumToString(InventoryCommandType, InventoryCommandType.SYNC_MOVE) + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
1332 }
1333#endif
1334
1335 //MW Should always exist an be same, better add check and after that just one check
1336 bool hasJuncture = false;
1337 if (itemSrc != null && itemDst != null)
1338 {
1339 hasJuncture = g_Game.HasInventoryJuncture(GetDayZPlayerOwner(), itemSrc) && g_Game.HasInventoryJuncture(GetDayZPlayerOwner(), itemDst);
1340 }
1341 else if (itemSrc != null)
1342 {
1343 hasJuncture = g_Game.HasInventoryJuncture(GetDayZPlayerOwner(), itemSrc);
1344 }
1345 else if (itemDst != null)
1346 {
1347 hasJuncture = g_Game.HasInventoryJuncture(GetDayZPlayerOwner(), itemDst);
1348 }
1349
1350 if (!hasJuncture)
1351 {
1352#ifdef ENABLE_LOGGING
1354 {
1355 Debug.InventoryMoveLog("Failed - missing juncture", "SYNC_MOVE", "n/a", "ExecuteSyncMoveCommandServer", GetDayZPlayerOwner().ToString() );
1356 }
1357#endif
1358 return false;
1359 }
1360
1361 //???
1362 CheckForRope(src, dst);
1363
1364 //TODO: hotfix solution
1365 //???
1366 if (!MoveCheckExclusionMaskLocal(src,dst))
1367 {
1368#ifdef ENABLE_LOGGING
1370 {
1371 Debug.InventoryMoveLog("Failed - MoveCheckExclusionMaskLocal - condition failed locally", "SYNC_MOVE", "n/a", "ExecuteSyncMoveCommandServer", GetDayZPlayerOwner().ToString() );
1372 }
1373#endif
1374 return false;
1375 }
1376
1377 if (!GameInventory.LocationCanMoveEntity(src, dst))
1378 {
1379#ifdef ENABLE_LOGGING
1381 {
1382 Debug.InventoryMoveLog("Failed - LocationSyncMoveEntity Can not move entity STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandServer", GetDayZPlayerOwner().ToString() );
1383 }
1384#endif
1385 return false;
1386 }
1387
1388
1389#ifdef ENABLE_LOGGING
1391 {
1392 Debug.InventoryMoveLog("Success - LocationSyncMoveEntity STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "SYNC_MOVE" , "n/a", "ExecuteSyncMoveCommandServer", GetDayZPlayerOwner().ToString() );
1393 }
1394#endif
1395 return LocationSyncMoveEntity(src, dst);
1396 }
void syncDebugPrint(string s)
InventoryCommandType
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 CheckForRope(InventoryLocation src, InventoryLocation dst)
Определения DayZPlayerInventory.c:3698
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 LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
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

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

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