49{
50 #ifdef ENABLE_LOGGING
52 {
53 Debug.
InventoryReservationLog(
"STS = " + player.GetSimulationTimeStamp() +
" src1:" + src1.DumpToString() +
" dst1: " + dst1.DumpToString()+
" src2:" + src2.DumpToString() +
" dst2: " + dst2.DumpToString(),
"InventoryJuncture" ,
"n/a",
"TryAcquireTwoInventoryJuncturesFromServer",player.ToString() );
54 }
55 #endif
56
57
58
61 EntityAI srcParent1 = src1.GetParent();
62 EntityAI srcParent2 = src2.GetParent();
63 EntityAI dstParent1 = dst1.GetParent();
64 EntityAI dstParent2 = dst2.GetParent();
65
66 if (!srcItem1)
67 {
70 }
71
72 if (!srcItem2)
73 {
76 }
77
78
80 bool need_j2 = player.NeedInventoryJunctureFromServer(srcItem2, srcParent2, dstParent2);
81 if (need_j1 || need_j2)
82 {
83 if (need_j1)
84 {
85 if ( ( srcItem1 && srcItem1.IsSetForDeletion() ) || ( srcParent1 && srcParent1.IsSetForDeletion() ) || ( dstParent1 && dstParent1.IsSetForDeletion() ) )
86 {
88 }
89
90
91 if (srcItem1 && !srcItem1.CanPutIntoHands(player))
92 {
94 }
95
97 {
98
99
100
101
102
103
105 }
106 }
107
108 if (need_j2)
109 {
110 if ( ( srcItem2 && srcItem2.IsSetForDeletion() ) || ( srcParent2 && srcParent2.IsSetForDeletion() ) || ( dstParent2 && dstParent2.IsSetForDeletion() ) )
111 {
112 if (need_j1)
113 {
114 g_Game.ClearJunctureEx(player, srcItem1);
115 }
117 }
118
119 if (srcItem2 && !srcItem2.CanPutIntoHands(player))
120 {
121 if (need_j1)
122 {
123 g_Game.ClearJunctureEx(player, srcItem1);
124 }
126 }
127
129 {
130
131 if (need_j1)
132 {
133 g_Game.ClearJunctureEx(player, srcItem1);
134
135 }
137 }
138 }
139
141 }
142 else
143 {
144
145
146
147
148
149
152 }
153}
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()