36{
37 #ifdef ENABLE_LOGGING
39 {
40 Debug.
InventoryReservationLog(
"STS = " + player.GetSimulationTimeStamp() +
" src1:" + src1.DumpToString() +
" dst1: " + dst1.DumpToString()+
" src2:" + src2.DumpToString() +
" dst2: " + dst2.DumpToString(),
"InventoryJuncture" ,
"n/a",
"TryAcquireTwoInventoryJuncturesFromServer",player.ToString() );
41 }
42 #endif
43
44
45
48 EntityAI srcParent1 = src1.GetParent();
49 EntityAI srcParent2 = src2.GetParent();
50 EntityAI dstParent1 = dst1.GetParent();
51 EntityAI dstParent2 = dst2.GetParent();
52
53
55 bool need_j2 = player.NeedInventoryJunctureFromServer(srcItem2, srcParent2, dstParent2);
56 if (need_j1 || need_j2)
57 {
58 if (need_j1)
59 {
60 if ( ( srcItem1 && srcItem1.IsSetForDeletion() ) || ( srcParent1 && srcParent1.IsSetForDeletion() ) || ( dstParent1 && dstParent1.IsSetForDeletion() ) )
61 {
63 }
64
65
66 if (srcItem1 && !srcItem1.CanPutIntoHands(player))
67 {
69 }
70
72 {
73
74
75
76
77
78
80 }
81 }
82
83 if (need_j2)
84 {
85 if ( ( srcItem2 && srcItem2.IsSetForDeletion() ) || ( srcParent2 && srcParent2.IsSetForDeletion() ) || ( dstParent2 && dstParent2.IsSetForDeletion() ) )
86 {
87 if (need_j1)
88 {
89 g_Game.ClearJunctureEx(player, srcItem1);
90 }
92 }
93
94 if (srcItem2 && !srcItem2.CanPutIntoHands(player))
95 {
97 }
98
100 {
101
102 if (need_j1)
103 {
104 g_Game.ClearJunctureEx(player, srcItem1);
105
106 }
108 }
109 }
110
112 }
113 else
114 {
115
116
117
118
119
120
123 }
124}
void syncDebugPrint(string s)
static void InventoryReservationLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
const int c_InventoryReservationTimeoutMS
reservations
script counterpart to engine's class Inventory
static string DumpToStringNullSafe(InventoryLocation loc)
static bool IsInventoryReservationLogEnable()
static bool IsSyncLogEnable()