use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class SecondNpcActionMessageDecoder method decode.
@Override
public NpcActionMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getSigned(DataType.SHORT, DataTransformation.ADD);
return new NpcActionMessage(2, index);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class SecondPlayerActionMessageDecoder 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(2, index);
}
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);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ArrowKeyMessageDecoder method decode.
@Override
public ArrowKeyMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int roll = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
int yaw = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new ArrowKeyMessage(roll, yaw);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class DialogueContinueMessageDecoder method decode.
@Override
public DialogueContinueMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT);
return new DialogueContinueMessage(interfaceId);
}
Aggregations