* @param message
* The ChooseCharacter message
*/
@Override
public void process(Message message) {
MessageC2SChooseCharacter msg = (MessageC2SChooseCharacter) message;
try {
int clientid = msg.getClientID();
PlayerEntry entry = playerContainer.get(clientid);
/*
* verify event so that we can trust that it comes from our player
* and that it has completed the login stage.
*/
if (!isValidEvent(msg, entry, ClientState.LOGIN_COMPLETE)) {
return;
}
/* We set the character in the entry info */
entry.character = msg.getCharacter();
PlayerEntry oldEntry = playerContainer.getOldEntry(entry);
if ((oldEntry != null) && (oldEntry.state == ClientState.GAME_BEGIN)) {
reownOldEntry(oldEntry, entry);
return;