int messengerPort = getMessengerPort(message);
int totalNumberOfPlayers = getTotalNumberOfPlayers(message);
_logger.info("commandPort = " + commandPort);
_logger.info("eventPort = " + eventPort);
HumanPlayerSwing player = new HumanPlayerSwing(totalNumberOfPlayers, up);
player.setUserPreferences(up);
player.setName(name);
player.setId(playerId);
player.setVisible(true);
ClientCommandNotifier mr = new ClientCommandNotifier(player, ip, commandPort);
Thread mrt = new Thread(mr);
mrt.setName("ClientCommandNotifier" + commandPort);
mrt.start();
MessageReceiver emr;
try {
emr = new MessageReceiver(ip, eventPort);
} catch (UnknownHostException e) {
e.printStackTrace();
return;
} catch (IOException e) {
e.printStackTrace();
return;
}
ClientGameEventNotifier wen = new ClientGameEventNotifier(player, emr);
Thread went = new Thread(wen);
went.setName("ClientGameEventNotifier"+eventPort);
went.start();
IMClient imClient = new IMClient(name, ip, messengerPort);
//imClient.setVisible(true);
player.setImClient(imClient);
}