/** * Invoked when the idle status of a session changes. * * @param session The session in question * @param status The new idle status */ public void sessionIdle(IoSession session, IdleStatus status) { Player player = (Player) session.getAttachment(); if (!player.destroyed()) { player.destroy(false); } session.close(); }
public void messageReceived(IoSession session, Object message) { Player player = (Player) session.getAttachment(); if (session.isClosing() || player.destroyed()) { return; } RSCPacket p = (RSCPacket) message; if (p.getID() == 55) player.addInterval(); Instance.loggingService().tell(p, ActorRef.noSender()); packets.add(p); }
/** * Invoked whenever an IO session is closed. This must handle unregistering the disconnecting * player from the engine. * * @param session The IO session which has been closed */ public void sessionClosed(IoSession session) { Player player = (Player) session.getAttachment(); if (!player.destroyed()) { player.destroy(false); } }