From c69866123ba83f9dd4619c81eca312dda0559393 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Mon, 11 Oct 2010 22:05:02 +0200 Subject: Implementing show IP for game masters As an upcoming feature the TMW-Athena server sends IP addresses or IP hashes to game masters. The current client freezes if it receives such a packet, therefor the game masters need to use a new client before the server can use it. Normal players are not affected, because they do not get this packet. Showing the IP is optional and can be enable with the chat command "/showip 1". The IP is then shown behind the players name. Reviewed-by: Bertram --- src/being.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index d2dfc855..a3e91147 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -987,16 +987,21 @@ void Being::showName() if (getType() == PLAYER) { - if (config.getValue("showgender", false)) + Player* player = static_cast(this); + if (player) { - Player* player = static_cast(this); - if (player) + if (config.getValue("showgender", false)) { if (player->getGender() == GENDER_FEMALE) mDisplayName += " \u2640"; else mDisplayName += " \u2642"; } + if (Net::getNetworkType() == ServerInfo::TMWATHENA && player_node + && player_node->getShowIp() && player->getIp()) + { + mDisplayName += strprintf(" %s", ipToString(player->getIp())); + } } } else if (getType() == MONSTER) -- cgit v1.2.3-60-g2f50