use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ThirdItemOptionMessageDecoder method decode.
@Override
public ItemOptionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int slot = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int interfaceId = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
return new ItemOptionMessage(3, interfaceId, id, slot);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ThirdItemActionMessageDecoder method decode.
@Override
public ItemActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int slot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new ItemActionMessage(3, interfaceId, id, slot);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ReportAbuseMessageDecoder method decode.
@Override
public ReportAbuseMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
String name = NameUtil.decodeBase37(reader.getSigned(DataType.LONG));
int rule = (int) reader.getUnsigned(DataType.BYTE);
boolean mute = reader.getUnsigned(DataType.BYTE) == 1;
return new ReportAbuseMessage(name, rule, mute);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class SecondObjectActionMessageDecoder method decode.
@Override
public ObjectActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int y = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
int x = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new ObjectActionMessage(2, id, new Position(x, y));
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FourthItemActionMessageDecoder method decode.
@Override
public ItemActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int slot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
int id = (int) reader.getUnsigned(DataType.SHORT);
return new ItemActionMessage(4, interfaceId, id, slot);
}
Aggregations