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

◆ OnInventoryCheck()

override bool OnInventoryCheck ( int userDataType,
ParamsReadContext ctx )
protected

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

3174 {
3175 if (userDataType == INPUT_UDT_INVENTORY_CHECK)
3176 {
3177 bool correct = true;
3178
3179 int count;
3180 array<EntityAI> itemsToRepair = new array<EntityAI>;
3181 InventoryLocation clientIl = new InventoryLocation;
3183
3184
3185 if(!ctx.Read(count))
3186 return false;
3187
3188 for (int i = 0; i < count; i++)
3189 {
3190 if(!clientIl.ReadFromContext(ctx))
3191 {
3192 return false;
3193 }
3194
3195 clientIl.GetItem().GetInventory().GetCurrentInventoryLocation(realIl);
3196
3197 if(clientIl != realIl)
3198 {
3199 itemsToRepair.Insert(clientIl.GetItem());
3200 correct = false;
3201 }
3202 }
3203
3204 if (itemsToRepair.Count())
3205 {
3206 #ifdef DIAG_DEVELOPER
3207 if (PluginInventoryDebug.Cast(GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
3208 {
3209 #endif
3211 #ifdef DIAG_DEVELOPER
3212 }
3213 #endif
3214 }
3215
3216 return correct;
3217 }
3218 return false;
3219 }
const int INPUT_UDT_INVENTORY_CHECK
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:325
static void SendServerInventoryCheck(array< EntityAI > items, DayZPlayer player)
Определения InventoryInputUserData.c:44
bool ReadFromContext(ParamsReadContext ctx)
Определения InventoryLocation.c:310
proto native EntityAI GetItem()
returns item of current inventory location
InventoryLocation.
Определения InventoryLocation.c:30
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

Перекрестные ссылки GetDayZPlayerOwner(), InventoryLocation::GetItem(), GetPlugin(), INPUT_UDT_INVENTORY_CHECK, Serializer::Read(), InventoryLocation::ReadFromContext() и InventoryInputUserData::SendServerInventoryCheck().

Используется в ManBase::OnInputUserDataProcess().