use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class IdAssignmentMessageEncoder method encode.
@Override
public GamePacket encode(IdAssignmentMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(126);
builder.put(DataType.BYTE, message.isMembers() ? 1 : 0);
builder.put(DataType.SHORT, DataOrder.LITTLE, message.getId());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class RemoveTileItemMessageEncoder method encode.
@Override
public GamePacket encode(RemoveTileItemMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(156);
builder.put(DataType.BYTE, DataTransformation.ADD, message.getPositionOffset());
builder.put(DataType.SHORT, message.getId());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SendObjectMessageEncoder method encode.
@Override
public GamePacket encode(SendObjectMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(151);
builder.put(DataType.BYTE, DataTransformation.ADD, message.getPositionOffset());
builder.put(DataType.SHORT, DataOrder.LITTLE, message.getId());
builder.put(DataType.BYTE, DataTransformation.SUBTRACT, message.getType() << 2 | message.getOrientation());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SetWidgetItemModelMessageEncoder method encode.
@Override
public GamePacket encode(SetWidgetItemModelMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(246);
builder.put(DataType.SHORT, DataOrder.LITTLE, message.getInterfaceId());
builder.put(DataType.SHORT, message.getZoom());
builder.put(DataType.SHORT, message.getModelId());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class FriendServerStatusMessageEncoder method encode.
@Override
public GamePacket encode(FriendServerStatusMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(221);
builder.put(DataType.BYTE, message.getStatusCode());
return builder.toGamePacket();
}
Aggregations