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

◆ TakeToDst()

override bool TakeToDst ( InventoryMode mode,
notnull InventoryLocation src,
notnull InventoryLocation dst )
protected

Remote inputs are processed in sync juncture once performed on the server - this code below was executing the inventory command before the player simulation timeestamp for remotes which is illegal

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

1899 {
1900 if (GetManOwner().IsAlive() == false)
1901 return super.TakeToDst(mode, src, dst);
1902
1903 #ifdef ENABLE_LOGGING
1905 {
1906 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst), "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
1907 }
1908 #endif
1909
1910 switch (mode)
1911 {
1912 case InventoryMode.SERVER:
1913 if (RedirectToHandEvent(mode, src, dst))
1914 {
1915 #ifdef ENABLE_LOGGING
1917 {
1918 Debug.InventoryMoveLog("RedirectToHandEvent", "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
1919 }
1920 #endif
1921
1922 return true;
1923 }
1924
1925
1926 if (GetDayZPlayerOwner().NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
1927 {
1928 if (g_Game.AddInventoryJunctureEx(GetDayZPlayerOwner(), src.GetItem(), dst, true, GameInventory.c_InventoryReservationTimeoutMS))
1929 {
1930#ifdef ENABLE_LOGGING
1932 {
1933 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " DZPI::Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") got juncture");
1934 }
1935#endif
1936 }
1937 else
1938 {
1939#ifdef ENABLE_LOGGING
1941 {
1942 Debug.InventoryMoveLog("Juncture failed", "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
1943 }
1944
1946 {
1947 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " DZPI::Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") got juncture");
1948 }
1949#endif
1950
1951 return false;
1952 }
1953
1954 }
1955
1958
1960
1961#ifdef ENABLE_LOGGING
1963 {
1964 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " store input for remote - DZPI::Take2Dst(" + typename.EnumToString(InventoryMode, mode) + " server sync move src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
1965 }
1966#endif
1967
1969 //GetDayZPlayerOwner().StoreInputForRemotes(ctx); // @TODO: is this right place? maybe in HandleInputData(server=true, ...)
1970 #ifdef ENABLE_LOGGING
1972 {
1973 Debug.InventoryMoveLog("Success - store input for remote mode - " + typename.EnumToString(InventoryMode, mode) + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst), "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
1974 }
1975 #endif
1976 return true;
1977
1978 case InventoryMode.LOCAL:
1979 LocationSyncMoveEntity(src, dst);
1980 return true;
1981 }
1982 if (!super.TakeToDst(mode,src,dst))
1983 {
1984 return PostDeferredEventTakeToDst(mode,src,dst);
1985 }
1986 return true;
1987 }
void syncDebugPrint(string s)
InventoryCommandType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:3942
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
override bool PostDeferredEventTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения DayZPlayerInventory.c:1989
proto string ToString()
static const int SJ_INVENTORY
Определения DayZPlayerSyncJunctures.c:11
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_InventoryReservationTimeoutMS
reservations
script counterpart to engine's class Inventory
static void SerializeMove(ParamsWriteContext ctx, int type, notnull InventoryLocation src, notnull InventoryLocation dst)
move
Определения InventoryInputUserData.c:5
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:233
InventoryLocation.
Определения InventoryLocation.c:30
static bool IsSyncLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:776
static bool IsInventoryMoveLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:746
Определения ObjectTyped.c:2
Определения gameplay.c:121

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutMS, InventoryLocation::DumpToStringNullSafe(), g_Game, GetDayZPlayerOwner(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), LogManager::IsSyncLogEnable(), PostDeferredEventTakeToDst(), InventoryInputUserData::SerializeMove(), DayZPlayerSyncJunctures::SJ_INVENTORY, syncDebugPrint() и ToString().