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

◆ HandleRemoteItemManipulation()

bool ManBase::HandleRemoteItemManipulation ( int userDataType,
ParamsReadContext ctx )
inlineprotected

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

6140 {
6141 if (userDataType == INPUT_UDT_ITEM_MANIPULATION)
6142 {
6143 int type = -1;
6144 ItemBase item1 = null;
6145 ItemBase item2 = null;
6146 bool use_stack_max = false;
6147 int slot_id = -1;
6148
6149 if (!ctx.Read(type))
6150 return false;
6151
6152 if (type == 4)
6153 {
6154 if (!ctx.Read(item1))
6155 return false;
6156
6157 InventoryLocation dst = new InventoryLocation;
6158 if (item1 && dst.ReadFromContext(ctx))
6159 {
6160 //Print(InventoryLocation.DumpToStringNullSafe(dst));
6161 bool dummy;
6162 if (ctx.Read(dummy))
6163 item1.SplitItemToInventoryLocation(dst);
6164 else
6165 item1.SplitIntoStackMaxToInventoryLocation(dst);
6166 return true;
6167 }
6168 return false;
6169 }
6170
6171 if (!ctx.Read(item1))
6172 return false;
6173 if (!ctx.Read(item2))
6174 return false;
6175 if (!ctx.Read(use_stack_max))
6176 return false;
6177 if (!ctx.Read(slot_id))
6178 return false;
6179
6180 if (type == -1 && item1 && item2)//combine
6181 {
6182 item1.CombineItems(item2, use_stack_max);
6183 }
6184 else if (type == 1 && item1)
6185 {
6186 if (use_stack_max)
6187 item1.SplitIntoStackMax(item2, slot_id, this);
6188 else
6189 item1.SplitItem(this);
6190 }
6191 else if (type == 2 && item1)
6192 {
6193 int row, col;
6194 if (!ctx.Read(row))
6195 return false;
6196 if (!ctx.Read(col))
6197 return false;
6198 item1.SplitIntoStackMaxCargo(item2, slot_id, row, col);
6199 }
6200 else if (type == 3 && item1)
6201 {
6202 item1.SplitIntoStackMaxHands(this);
6203 }
6204 return true;
6205 }
6206 return false;
6207 }
const int INPUT_UDT_ITEM_MANIPULATION
Определения _constants.c:8
class GP5GasMask extends MaskBase ItemBase
bool ReadFromContext(ParamsReadContext ctx)
Определения InventoryLocation.c:296
proto bool Read(void value_in)

Перекрестные ссылки INPUT_UDT_ITEM_MANIPULATION, Serializer::Read() и InventoryLocation::ReadFromContext().

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