return false;
}
AuthRequestMessageBody armb = new AuthRequestMessageBody(clientSession.getClientLoginData());
IMessage areqm = MessageFactory.createMessage(clientSession, null, armb);
send(areqm.pack());
String aresmText = readInputLine();
IMessage aresm = MessageFactory.parseMessage(aresmText);
if (aresm == null) {
return false; // didn't receive interpretable message
}
AuthResponseMessageBody aresmb = AuthResponseMessageBody
.parseBody(aresm.getBody());
if (aresmb == null) {
return false; // didn't receive interpretable message body
}
clientSession.authenticatedToServer(
this,
new MasterServerImpl(aresm.getSender().getGuid()),
aresmb.getPlayer());
return true;
}