use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SwitchTabInterfaceMessageEncoder method encode.
@Override
public GamePacket encode(SwitchTabInterfaceMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(71);
builder.put(DataType.SHORT, message.getInterfaceId());
builder.put(DataType.BYTE, DataTransformation.ADD, message.getTabId());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class UpdateRunEnergyMessageEncoder method encode.
@Override
public GamePacket encode(UpdateRunEnergyMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(110);
builder.put(DataType.BYTE, message.getEnergy());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class UpdateWeightMessageEncoder method encode.
@Override
public GamePacket encode(UpdateWeightMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(240);
builder.put(DataType.SHORT, message.getWeight());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class ServerMessageMessageEncoder method encode.
@Override
public GamePacket encode(ServerChatMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(253, PacketType.VARIABLE_BYTE);
builder.putString(message.getMessage());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SetWidgetTextMessageEncoder method encode.
@Override
public GamePacket encode(SetWidgetTextMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(126, PacketType.VARIABLE_SHORT);
builder.putString(message.getText());
builder.put(DataType.SHORT, DataTransformation.ADD, message.getInterfaceId());
return builder.toGamePacket();
}
Aggregations