package NET.worlds.network; import NET.worlds.scape.RoomSubscribeInfo; import java.io.IOException; public class SubscribeRoomCmd extends netPacket { public static final byte SUBSCRIBEROOMCMD = 22; protected short _distance; protected short _x; protected short _y; protected short _z; protected short _roomNumber; public SubscribeRoomCmd(RoomSubscribeInfo info, int room) { super(null, 22); this._roomNumber = (short)room; this._distance = (short)(info.d - 100.0F); this._x = (short)info.x; this._y = (short)info.y; this._z = (short)info.z; } @Override int packetSize() { return 10 + super.packetSize(); } @Override void send(ServerOutputStream o) throws IOException { super.send(o); o.writeShort(this._roomNumber); o.writeShort(this._x); o.writeShort(this._y); o.writeShort(this._z); o.writeShort(this._distance); } @Override public String toString(WorldServer serv) { return "SUBSCRIB " + this._roomNumber + ": " + this._distance + "cm @ " + this._x + "," + this._y + "," + this._z; } }