}
// wait for AuthRequestMessage
String armText = readInputLine();
IMessage arm = MessageFactory.parseMessage(armText);
if (arm == null) {
return false; // didn't receive interpretable message
}
AuthRequestMessageBody armb = AuthRequestMessageBody
.parseBody(arm.getBody());
if (armb == null) {
return false; // didn't receive interpretable message body
}
player = serverSession.getAuthControl()
.allowPlayer(armb);
if (player != null) {
AuthResponseMessageBody response = new AuthResponseMessageBody(
true,
player.getGuid(),
player.getNickName());
IMessage aresm = MessageFactory.createMessage(
serverSession,
player,
response);
send(aresm.pack());
serverSession.playerConnected(this);
return true;
}