use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FirstPlayerActionMessageDecoder method decode.
@Override
public PlayerActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
return new PlayerActionMessage(1, index);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FourthPlayerActionMessageDecoder method decode.
@Override
public PlayerActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new PlayerActionMessage(4, index);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ItemOnNpcMessageDecoder method decode.
@Override
public ItemOnNpcMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT);
int id = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE);
int widget = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int slot = (int) reader.getUnsigned(DataType.SHORT);
return new ItemOnNpcMessage(id, index, slot, widget);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class MagicOnPlayerMessageDecoder method decode.
@Override
public MagicOnPlayerMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int spell = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new MagicOnPlayerMessage(index, spell);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class SwitchItemMessageDecoder method decode.
@Override
public SwitchItemMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
boolean inserting = reader.getUnsigned(DataType.BYTE, DataTransformation.NEGATE) == 1;
int oldSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int newSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new SwitchItemMessage(interfaceId, inserting, oldSlot, newSlot);
}
Aggregations