use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FifthPlayerActionMessageDecoder 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(5, index);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class FourthItemOptionMessageDecoder method decode.
@Override
public ItemOptionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int slot = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE);
int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new ItemOptionMessage(4, interfaceId, id, slot);
}
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 ItemOnItemMessageDecoder method decode.
@Override
public ItemOnItemMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int targetSlot = (int) reader.getUnsigned(DataType.SHORT);
int usedSlot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int targetId = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int targetInterface = (int) reader.getUnsigned(DataType.SHORT);
int usedId = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE);
int usedInterface = (int) reader.getUnsigned(DataType.SHORT);
return new ItemOnItemMessage(usedInterface, usedId, usedSlot, targetInterface, targetId, targetSlot);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class AddFriendMessageDecoder method decode.
@Override
public AddFriendMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
String username = NameUtil.decodeBase37(reader.getSigned(DataType.LONG));
return new AddFriendMessage(username);
}
Aggregations