public void start() { try { this.server = new Server(Globals.PACKET_MAX_SIZE * Globals.PACKET_MAX_PER_CON, Globals.PACKET_MAX_SIZE); Kryo kyro = this.server.getKryo(); kyro.register(byte[].class); this.receiver = new PacketReceiver(); this.server.addListener(new Listener.ThreadedListener(this.receiver)); server.bind(Globals.SERVER_TCP_PORT); server.start(); Globals.log( GameServer.class, "Server listening on port TCP: " + Globals.SERVER_TCP_PORT, Globals.LOG_TYPE_DATA, true); // Globals.log(GameServer.class, "Server listening on port UDP: " + Globals.SERVER_UDP_PORT, // Globals.LOG_TYPE_DATA, true); } catch (IOException ex) { Globals.logError(ex.getStackTrace()[0].toString(), ex, true); System.exit(1); } }
public long getCooldown() { return Globals.nsToMs(this.logic.getTime() - this.skillCastTime); }
public void reduceCooldown(final int ms) { this.skillCastTime -= Globals.msToNs(ms); }