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

◆ HandleRemoteItemManipulation()

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

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

6132 {
6133 if (userDataType == INPUT_UDT_ITEM_MANIPULATION)
6134 {
6135 int type = -1;
6136 ItemBase item1 = null;
6137 ItemBase item2 = null;
6138 bool use_stack_max = false;
6139 int slot_id = -1;
6140
6141 if (!ctx.Read(type))
6142 return false;
6143
6144 if (type == 4)
6145 {
6146 if (!ctx.Read(item1))
6147 return false;
6148
6149 InventoryLocation dst = new InventoryLocation;
6150 if (item1 && dst.ReadFromContext(ctx))
6151 {
6152 //Print(InventoryLocation.DumpToStringNullSafe(dst));
6153 bool dummy;
6154 if (ctx.Read(dummy))
6155 item1.SplitItemToInventoryLocation(dst);
6156 else
6157 item1.SplitIntoStackMaxToInventoryLocation(dst);
6158 return true;
6159 }
6160 return false;
6161 }
6162
6163 if (!ctx.Read(item1))
6164 return false;
6165 if (!ctx.Read(item2))
6166 return false;
6167 if (!ctx.Read(use_stack_max))
6168 return false;
6169 if (!ctx.Read(slot_id))
6170 return false;
6171
6172 if (type == -1 && item1 && item2)//combine
6173 {
6174 item1.CombineItems(item2, use_stack_max);
6175 }
6176 else if (type == 1 && item1)
6177 {
6178 if (use_stack_max)
6179 item1.SplitIntoStackMax(item2, slot_id, this);
6180 else
6181 item1.SplitItem(this);
6182 }
6183 else if (type == 2 && item1)
6184 {
6185 int row, col;
6186 if (!ctx.Read(row))
6187 return false;
6188 if (!ctx.Read(col))
6189 return false;
6190 item1.SplitIntoStackMaxCargo(item2, slot_id, row, col);
6191 }
6192 else if (type == 3 && item1)
6193 {
6194 item1.SplitIntoStackMaxHands(this);
6195 }
6196 return true;
6197 }
6198 return false;
6199 }
const int INPUT_UDT_ITEM_MANIPULATION
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().