Added kick function with player name.

This commit is contained in:
lotodore
2007-10-27 18:51:53 +00:00
parent 0d0104107b
commit 8f1e5132d6
4 changed files with 33 additions and 0 deletions
+9
View File
@@ -335,6 +335,15 @@ void Session::kickPlayer(unsigned playerId)
myNetClient->SendKickPlayer(playerId);
}
void Session::kickPlayer(const string &playerName)
{
if (!myNetClient)
return; // only act if client is running.
unsigned playerId;
if (myNetClient->GetPlayerIdFromName(playerName, playerId))
kickPlayer(playerId);
}
bool Session::isNetworkClientRunning() const
{
// This, and every place which calls this, is a HACK.