Search in sources :

Example 41 with GamePacketBuilder

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();
}
Also used : GamePacketBuilder(org.apollo.net.codec.game.GamePacketBuilder)

Example 42 with GamePacketBuilder

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();
}
Also used : GamePacketBuilder(org.apollo.net.codec.game.GamePacketBuilder)

Example 43 with GamePacketBuilder

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();
}
Also used : GamePacketBuilder(org.apollo.net.codec.game.GamePacketBuilder)

Example 44 with GamePacketBuilder

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();
}
Also used : GamePacketBuilder(org.apollo.net.codec.game.GamePacketBuilder)

Example 45 with GamePacketBuilder

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();
}
Also used : GamePacketBuilder(org.apollo.net.codec.game.GamePacketBuilder)

Aggregations

GamePacketBuilder (org.apollo.net.codec.game.GamePacketBuilder)93 Position (org.apollo.game.model.Position)9 Item (org.apollo.game.model.Item)6 HintIconMessage (org.apollo.game.message.impl.HintIconMessage)4 SegmentType (org.apollo.game.sync.seg.SegmentType)4 SynchronizationSegment (org.apollo.game.sync.seg.SynchronizationSegment)4 EquipmentDefinition (org.apollo.cache.def.EquipmentDefinition)2 GroupedRegionUpdateMessage (org.apollo.game.message.impl.GroupedRegionUpdateMessage)2 Type (org.apollo.game.message.impl.HintIconMessage.Type)2 MobHintIconMessage (org.apollo.game.message.impl.MobHintIconMessage)2 PositionHintIconMessage (org.apollo.game.message.impl.PositionHintIconMessage)2 RegionUpdateMessage (org.apollo.game.message.impl.RegionUpdateMessage)2 Appearance (org.apollo.game.model.Appearance)2 Skill (org.apollo.game.model.entity.Skill)2 Inventory (org.apollo.game.model.inv.Inventory)2 SlottedItem (org.apollo.game.model.inv.SlottedItem)2 AddNpcSegment (org.apollo.game.sync.seg.AddNpcSegment)2 AddPlayerSegment (org.apollo.game.sync.seg.AddPlayerSegment)2 GamePacket (org.apollo.net.codec.game.GamePacket)2 MessageEncoder (org.apollo.net.release.MessageEncoder)2