{
if (event.getHandle().get().getPlayerState() == PlayerState.LoadingInstance)
{
LOGGER.debug("Starting instance load.");
ClientBean client = event.getHandle().get();
// create a new entity of the character of this client
// NOTE THAT FOR IDENTIFICATION PURPOSES, WE USE THE CLIENTS UID FOR
// ITS CHARACTER ENTITY AS WELL!
WorldPosition pos = getRandomSpawn();
Entity player = CharacterFactory.createCharacter(event.getHandle().getUid(), client.getCharacter(), pos, entityManager);
client.setEntity(player);
client.setAgentIDs(player.get(AgentIdentifiers.class));
// using the attachment now looks a bit ugly,
// because we use the components here directly
// (this should not happen with other components!)
InstanceLoadView.instanceHead(client.getChannel());
InstanceLoadView.charName(client.getChannel(), client.getCharacter().getName());
InstanceLoadView.districtInfo(client.getChannel(), client.getAgentIDs().localID, world);
}
}