stats.add("Players logout", 1);
logger.info("Logging out correctly channel: "+entry.channel);
playerContainer.remove(clientid);
/* Send Logout ACK message */
MessageS2CLogoutACK msgLogout = new MessageS2CLogoutACK(msg.getSocketChannel());
msgLogout.setClientID(clientid);
msgLogout.setProtocolVersion(msg.getProtocolVersion());
netMan.sendMessage(msgLogout);
entry.state = ClientState.LOGOUT_ACCEPTED;
} else {
MessageS2CLogoutNACK msgLogout = new MessageS2CLogoutNACK(msg.getSocketChannel());
msgLogout.setClientID(clientid);
msgLogout.setProtocolVersion(msg.getProtocolVersion());
netMan.sendMessage(msgLogout);
}
} catch (Exception e) {
logger.error("error while processing LogoutEvent", e);
}