use of org.apollo.game.message.impl.MouseClickedMessage 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);
}
use of org.apollo.game.message.impl.MouseClickedMessage 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