*
* @param rpMan RPServerManager
* @param data LoadCharacterCommand
*/
public void handleDelayedEvent(RPServerManager rpMan, Object data) {
LoadCharacterCommand cmd = (LoadCharacterCommand) data;
RPObject object = cmd.getObject();
int clientid = cmd.getClientid();
PlayerEntry entry = playerContainer.get(clientid);
if (entry == null) {
return;
}
// does the character exist and belong to the user?
if (object == null) {
logger.warn("could not load object for character " + entry.character + " for user " + cmd.getUsername() + " from database");
rejectClient(cmd.getChannel(), clientid, entry);
return;
}
/* We restore back the character to the world */
playerContainer.getLock().requestWriteLock();
completeLoadingCharacterIntoWorld(rpMan, clientid, cmd.getChannel(), entry, object);
playerContainer.getLock().releaseLock();
}