DayZ 1.30
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 строка 3728

3729 {
3730 if (GetManOwner().IsAlive() == false)
3731 return super.TakeToDst(mode, src, dst);
3732
3733 #ifdef ENABLE_LOGGING
3735 {
3736 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst), "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
3737 }
3738 #endif
3739
3740 switch (mode)
3741 {
3742 case InventoryMode.SERVER:
3743 if (RedirectToHandEvent(mode, src, dst))
3744 {
3745 #ifdef ENABLE_LOGGING
3747 {
3748 Debug.InventoryMoveLog("RedirectToHandEvent", "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
3749 }
3750 #endif
3751
3752 return true;
3753 }
3754
3755
3756 if (GetDayZPlayerOwner().NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
3757 {
3758 if (g_Game.AddInventoryJunctureEx(GetDayZPlayerOwner(), src.GetItem(), dst, true, GameInventory.c_InventoryReservationTimeoutMS))
3759 {
3760#ifdef ENABLE_LOGGING
3762 {
3763 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " DZPI::Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") got juncture");
3764 }
3765#endif
3766 }
3767 else
3768 {
3769#ifdef ENABLE_LOGGING
3771 {
3772 Debug.InventoryMoveLog("Juncture failed", "n/a" , "n/a", "TakeToDst", GetDayZPlayerOwner().ToString() );
3773 }
3774
3776 {
3777 syncDebugPrint("[syncinv] " + Object.GetDebugName(GetDayZPlayerOwner()) + " STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " DZPI::Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") got juncture");
3778 }
3779#endif
3780
3781 return false;
3782 }
3783
3784 }
3785
3788
3790
3791#ifdef ENABLE_LOGGING
3793 {
3794 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));
3795 }
3796#endif
3797
3799 //GetDayZPlayerOwner().StoreInputForRemotes(ctx); // @TODO: is this right place? maybe in HandleInputData(server=true, ...)
3800 #ifdef ENABLE_LOGGING
3802 {
3803 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() );
3804 }
3805 #endif
3806 return true;
3807
3808 case InventoryMode.LOCAL:
3809 LocationSyncMoveEntity(src, dst);
3810 return true;
3811 }
3812 if (!super.TakeToDst(mode,src,dst))
3813 {
3814 return PostDeferredEventTakeToDst(mode,src,dst);
3815 }
3816 return true;
3817 }
void syncDebugPrint(string s)
InventoryCommandType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:4074
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
override bool PostDeferredEventTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения DayZPlayerInventory.c:3819
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:198
Определения 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:789
static bool IsInventoryMoveLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:759
Определения 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().