String playerName = m.getPlayerName();
Client client = sender.getClient();
PlayerInGame kicked = getGame().getClients().get(playerName);
if (kicked == null) {
logger.warn("cannot find player '" + playerName + "'");
client.send(new KickPlayerResponseMessage(ResponseType.failed));
return this;
} else {
Client kickedClient = kicked.getClient();
logger.info("kicking " + kickedClient + " from game '" + getGame() + "'");
client.send(new KickPlayerResponseMessage(ResponseType.ok));
kickedClient.send(new KickedMessage());
return removeClient(kickedClient, "kicked");
}
}