Search in sources :

Example 6 with ItemActionMessage

use of org.apollo.game.message.impl.ItemActionMessage in project apollo by apollo-rsps.

the class FifthItemActionMessageDecoder method decode.

@Override
public ItemActionMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int slot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    return new ItemActionMessage(5, interfaceId, id, slot);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) ItemActionMessage(org.apollo.game.message.impl.ItemActionMessage)

Example 7 with ItemActionMessage

use of org.apollo.game.message.impl.ItemActionMessage in project apollo by apollo-rsps.

the class FirstItemActionMessageDecoder method decode.

@Override
public ItemActionMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int slot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    return new ItemActionMessage(1, interfaceId, id, slot);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) ItemActionMessage(org.apollo.game.message.impl.ItemActionMessage)

Example 8 with ItemActionMessage

use of org.apollo.game.message.impl.ItemActionMessage in project apollo by apollo-rsps.

the class FirstItemActionMessageDecoder method decode.

@Override
public ItemActionMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT);
    int slot = (int) reader.getUnsigned(DataType.SHORT);
    return new ItemActionMessage(1, interfaceId, id, slot);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) ItemActionMessage(org.apollo.game.message.impl.ItemActionMessage)

Example 9 with ItemActionMessage

use of org.apollo.game.message.impl.ItemActionMessage in project apollo by apollo-rsps.

the class SecondItemActionMessageDecoder method decode.

@Override
public ItemActionMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int slot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    return new ItemActionMessage(2, interfaceId, id, slot);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) ItemActionMessage(org.apollo.game.message.impl.ItemActionMessage)

Example 10 with ItemActionMessage

use of org.apollo.game.message.impl.ItemActionMessage in project apollo by apollo-rsps.

the class SecondItemActionMessageDecoder method decode.

@Override
public ItemActionMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
    int slot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    return new ItemActionMessage(2, interfaceId, id, slot);
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) ItemActionMessage(org.apollo.game.message.impl.ItemActionMessage)

Aggregations

ItemActionMessage (org.apollo.game.message.impl.ItemActionMessage)10 GamePacketReader (org.apollo.net.codec.game.GamePacketReader)10