use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class ThirdPlayerActionMessageDecoder 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(3, index);
}
use of org.apollo.net.codec.game.GamePacketReader in project apollo by apollo-rsps.
the class MouseClickedMessageDecoder method decode.
@Override
public MouseClickedMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int value = (int) reader.getUnsigned(DataType.INT);
long delay = (value >> 20) * 50;
boolean right = (value >> 19 & 0x1) == 1;
int cords = value & 0x3FFFF;
int x = cords % 765;
int y = cords / 765;
return new MouseClickedMessage(delay, right, x, y);
}
Aggregations