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

◆ TryAcquireInventoryJunctureFromServer()

bool TryAcquireInventoryJunctureFromServer ( notnull Man player,
notnull InventoryLocation src,
notnull InventoryLocation dst )

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

3{
4 if (player.NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
5 {
6 if ( ( src.GetItem() && src.GetItem().IsSetForDeletion() ) || ( src.GetParent() && src.GetParent().IsSetForDeletion() ) || ( dst.GetParent() && dst.GetParent().IsSetForDeletion() ) )
7 {
8 return JunctureRequestResult.JUNCTURE_DENIED;
9 }
10
11 if (src.GetItem() && !src.GetItem().CanPutIntoHands(player))
12 {
13 return JunctureRequestResult.JUNCTURE_DENIED;
14 }
15
16 bool test_dst_occupancy = true;
17 if (GetGame().AddInventoryJunctureEx(player, src.GetItem(), dst, test_dst_occupancy, GameInventory.c_InventoryReservationTimeoutMS))
18 {
19 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] juncture needed and acquired, player=" + Object.GetDebugName(player) + " STS = " + player.GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
20 return JunctureRequestResult.JUNCTURE_ACQUIRED; // ok
21 }
22 else
23 {
24 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] juncture request DENIED, player=" + Object.GetDebugName(player) + " STS = " + player.GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
25 return JunctureRequestResult.JUNCTURE_DENIED; // permission to perform juncture denied
26 }
27 }
28 else
29 {
30 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] juncture not required, player=" + Object.GetDebugName(player) + " STS = " + player.GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
31 return JunctureRequestResult.JUNCTURE_NOT_REQUIRED; // juncture not necessary
32 }
33}
void syncDebugPrint(string s)
Определения Debug.c:1
JunctureRequestResult
Определения Hand_Events.c:28
const int c_InventoryReservationTimeoutMS
reservations
Определения Inventory.c:712
script counterpart to engine's class Inventory
Определения Inventory.c:79
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:226
InventoryLocation.
Определения InventoryLocation.c:29
static bool IsSyncLogEnable()
Определения Debug.c:678
Определения Debug.c:594
Определения ObjectTyped.c:2
proto native CGame GetGame()

Перекрестные ссылки GameInventory::c_InventoryReservationTimeoutMS, InventoryLocation::DumpToStringNullSafe(), GetGame(), LogManager::IsSyncLogEnable() и syncDebugPrint().

Используется в HandEventBase::AcquireInventoryJunctureFromServer() и ValidateSyncMove().