private void onReceivePlayerAuthRequest(byte[] data) throws IOException
{
if(isAuthed())
{
PlayerAuthRequest par = new PlayerAuthRequest(data);
PlayerAuthResponse authResponse;
if(Config.DEBUG)
{
_log.info("auth request received for Player " + par.getAccount());
}
SessionKey key = LoginController.getInstance().getKeyForAccount(par.getAccount());
if(key != null && key.equals(par.getKey()))
{
if(Config.DEBUG)
{
_log.info("auth request: OK");
}
LoginController.getInstance().removeAuthedLoginClient(par.getAccount());
authResponse = new PlayerAuthResponse(par.getAccount(), true);
}
else
{
if(Config.DEBUG)
{
_log.info("auth request: NO");
_log.info("session key from self: " + key);
_log.info("session key sent: " + par.getKey());
}
authResponse = new PlayerAuthResponse(par.getAccount(), false);
}
sendPacket(authResponse);
par = null;
authResponse = null;