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

◆ HandleTakeToDst()

void HandleTakeToDst ( DeferredEvent deferred_event)
protected

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

1763 {
1764 DeferredTakeToDst deferred_take_to_dst = DeferredTakeToDst.Cast(deferred_event);
1765 if( deferred_take_to_dst )
1766 {
1767 #ifdef ENABLE_LOGGING
1769 {
1770 Debug.InventoryHFSMLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp(), "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
1771 }
1772 #endif
1773
1774 deferred_take_to_dst.ClearInventoryReservation(this);
1775
1777 {
1778 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));
1779 }
1780
1781 switch (deferred_take_to_dst.m_mode)
1782 {
1783 case InventoryMode.PREDICTIVE:
1784 #ifdef ENABLE_LOGGING
1786 {
1787 Debug.InventoryHFSMLog("PREDICTIVE ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString() );
1788 }
1789 #endif
1790
1791 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
1792 {
1793 InventoryInputUserData.SendInputUserDataMove(InventoryCommandType.SYNC_MOVE, deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
1794 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
1795 }
1796 else
1797 {
1798 #ifdef ENABLE_LOGGING
1800 {
1801 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() );
1802 }
1803 #endif
1804 }
1805 break;
1806 case InventoryMode.JUNCTURE:
1807 #ifdef ENABLE_LOGGING
1809 {
1810 Debug.InventoryHFSMLog("JUNCTURE ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
1811 }
1812 #endif
1813
1814 if (LocationCanMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst))
1815 {
1816 DayZPlayer player = GetGame().GetPlayer();
1817 player.GetHumanInventory().AddInventoryReservationEx(deferred_take_to_dst.m_dst.GetItem(), deferred_take_to_dst.m_dst, GameInventory.c_InventoryReservationTimeoutShortMS);
1818 EnableMovableOverride(deferred_take_to_dst.m_dst.GetItem());
1819 InventoryInputUserData.SendInputUserDataMove(InventoryCommandType.SYNC_MOVE, deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
1820 }
1821 else
1822 {
1823 #ifdef ENABLE_LOGGING
1825 {
1826 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());
1827 }
1828 #endif
1829 }
1830 break;
1831 case InventoryMode.LOCAL:
1832 #ifdef ENABLE_LOGGING
1834 {
1835 Debug.InventoryHFSMLog("LOCAL ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
1836 }
1837 #endif
1838 break;
1839 case InventoryMode.SERVER:
1840 #ifdef ENABLE_LOGGING
1842 {
1843 Debug.InventoryHFSMLog("SERVER ", "n/a" , "n/a", "HandleTakeToDst", GetDayZPlayerOwner().ToString());
1844 }
1845 #endif
1846 break;
1847 default:
1848 Error("HandEvent - Invalid mode");
1849 break;
1850 }
1851 }
1852 }
void inventoryDebugPrint(string s)
Определения Debug.c:19
InventoryCommandType
Определения Inventory.c:3
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
void EnableMovableOverride(EntityAI item)
Определения DayZPlayerInventory.c:1617
void DeferredTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения DayZPlayerInventory.c:15
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:168
proto string ToString()
proto native DayZPlayer GetPlayer()
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения Debug.c:147
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения Debug.c:137
Определения Debug.c:2
const int c_InventoryReservationTimeoutShortMS
Определения Inventory.c:713
script counterpart to engine's class Inventory
Определения Inventory.c:79
static void SendInputUserDataMove(int type, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения InventoryInputUserData.c:13
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:226
InventoryLocation.
Определения InventoryLocation.c:29
static bool IsInventoryHFSMLogEnable()
Определения Debug.c:668
static bool IsInventoryMoveLogEnable()
Определения Debug.c:648
Определения Debug.c:594
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

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

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