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

◆ HandleTakeToDst()

void HandleTakeToDst ( DeferredEvent deferred_event)
protected

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

3836 {
3837 DeferredTakeToDst deferred_take_to_dst = DeferredTakeToDst.Cast(deferred_event);
3838 if( deferred_take_to_dst )
3839 {
3840 #ifdef ENABLE_LOGGING
3842 {
3843 Debug.InventoryHFSMLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
3844 }
3845 #endif
3846
3847 deferred_take_to_dst.ClearInventoryReservation(this);
3848
3850 {
3851 inventoryDebugPrint("[inv] I::Take2Dst(" + typename.EnumToString(InventoryMode, deferred_take_to_dst.m_mode) + ") src=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_src) + " dst=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_dst));
3852 }
3853
3854 switch (deferred_take_to_dst.m_mode)
3855 {
3856 case InventoryMode.PREDICTIVE:
3857 #ifdef ENABLE_LOGGING
3859 {
3860 Debug.InventoryHFSMLog("PREDICTIVE STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
3861 }
3862 #endif
3863
3864 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
3865 {
3866 #ifdef DIAG_DEVELOPER
3867 if (PluginInventoryDebug.Cast(GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
3868 {
3869 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3870 }
3871 else
3872 {
3873 #endif
3874 InventoryInputUserData.SendInputUserDataMove(InventoryCommandType.SYNC_MOVE, deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3875 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3876 #ifdef DIAG_DEVELOPER
3877 }
3878 #endif
3879 }
3880 else
3881 {
3882 #ifdef ENABLE_LOGGING
3884 {
3885 Debug.InventoryMoveLog("Can not move entity (PREDICTIVE) STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " item = " + deferred_take_to_dst.m_dst.GetItem() + " dst=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_dst), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
3886 }
3887 #endif
3888 }
3889 break;
3890 case InventoryMode.JUNCTURE:
3891 #ifdef ENABLE_LOGGING
3893 {
3894 Debug.InventoryHFSMLog("JUNCTURE STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
3895 }
3896 #endif
3897
3898 if (LocationCanMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst))
3899 {
3900 #ifdef DIAG_DEVELOPER
3901 if (PluginInventoryDebug.Cast(GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
3902 {
3903 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3904 }
3905 else
3906 {
3907 #endif
3908 DayZPlayer player = g_Game.GetPlayer();
3909 player.GetHumanInventory().AddInventoryReservationEx(deferred_take_to_dst.m_dst.GetItem(), deferred_take_to_dst.m_dst, GameInventory.c_InventoryReservationTimeoutShortMS);
3910 EnableMovableOverride(deferred_take_to_dst.m_dst.GetItem());
3911 InventoryInputUserData.SendInputUserDataMove(InventoryCommandType.SYNC_MOVE, deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
3912 #ifdef DIAG_DEVELOPER
3913 }
3914 #endif
3915 }
3916 else
3917 {
3918 #ifdef ENABLE_LOGGING
3920 {
3921 Debug.InventoryMoveLog("Can not move entity (JUNCTURE) STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " item = " + deferred_take_to_dst.m_dst.GetItem() + " dst=" + InventoryLocation.DumpToStringNullSafe(deferred_take_to_dst.m_dst), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
3922 }
3923 #endif
3924 }
3925 break;
3926 case InventoryMode.LOCAL:
3927 #ifdef ENABLE_LOGGING
3929 {
3930 Debug.InventoryHFSMLog("LOCAL ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
3931 }
3932 #endif
3933 break;
3934 case InventoryMode.SERVER:
3935 #ifdef ENABLE_LOGGING
3937 {
3938 Debug.InventoryHFSMLog("SERVER ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
3939 }
3940 #endif
3941 break;
3942 default:
3943 Error("HandEvent - Invalid mode");
3944 break;
3945 }
3946 }
3947 }
void inventoryDebugPrint(string s)
InventoryCommandType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
DayZGame g_Game
Определения DayZGame.c:4074
void EnableMovableOverride(EntityAI item)
Определения DayZPlayerInventory.c:3690
void DeferredTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения DayZPlayerInventory.c:15
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
proto string ToString()
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:326
Определения DayZPlayerImplement.c:87
static void InventoryHFSMLog(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:208
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_InventoryReservationTimeoutShortMS
script counterpart to engine's class Inventory
static void SendInputUserDataMove(int type, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения InventoryInputUserData.c:13
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:233
InventoryLocation.
Определения InventoryLocation.c:30
static bool IsInventoryHFSMLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:779
static bool IsInventoryMoveLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:759
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutShortMS, DeferredTakeToDst(), InventoryLocation::DumpToStringNullSafe(), EnableMovableOverride(), Error(), g_Game, GetDayZPlayerOwner(), GetPlugin(), inventoryDebugPrint(), Debug::InventoryHFSMLog(), Debug::InventoryMoveLog(), LogManager::IsInventoryHFSMLogEnable(), LogManager::IsInventoryMoveLogEnable(), InventoryInputUserData::SendInputUserDataMove() и ToString().

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