}
if ("".equals(name.trim())) {
name = "Bot" + lisPlayerInfo.getModel().getSize(); //$NON-NLS-1$
}
BotClient c = new TestBot(name, client.getHost(), client.getPort());
c.game.addGameListener(new BotGUI(c));
try {
c.connect();
} catch (Exception e) {
clientgui
.doAlertDialog(
Messages.getString("ChatLounge.AlertBot.title"), Messages.getString("ChatLounge.AlertBot.message")); //$NON-NLS-1$ //$NON-NLS-2$
}
c.retrieveServerInfo();
clientgui.getBots().put(name, c);
} else if (ev.getSource().equals(butRemoveBot)) {
Client c = getPlayerListSelected(lisPlayerInfo);
if ((c == null) || c.equals(client)) {
clientgui
.doAlertDialog(
Messages
.getString("ChatLounge.ImproperCommand"), Messages.getString("ChatLounge.SelectBo")); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
c.die();
clientgui.getBots().remove(c.getName());
} else if (ev.getSource() == butConditions) {
// Display the game options dialog.
clientgui.getPlanetaryConditionsDialog().update(
client.game.getPlanetaryConditions());
clientgui.getPlanetaryConditionsDialog().setVisible(true);