use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FirstItemOptionMessageDecoder method decode.
@Override
public ItemOptionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int slot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new ItemOptionMessage(1, interfaceId, id, slot);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FirstObjectActionMessageDecoder method decode.
@Override
public ObjectActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int x = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int y = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new ObjectActionMessage(1, id, new Position(x, y));
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FlashingTabClickedMessageDecoder method decode.
@Override
public FlashingTabClickedMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int tab = (int) reader.getUnsigned(DataType.BYTE);
return new FlashingTabClickedMessage(tab);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class SecondItemOptionMessageDecoder method decode.
@Override
public ItemOptionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int id = (int) reader.getUnsigned(DataType.SHORT);
int slot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new ItemOptionMessage(2, interfaceId, id, slot);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ThirdNpcActionMessageDecoder method decode.
@Override
public NpcActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
return new NpcActionMessage(3, index);
}
Aggregations