diff options
-rw-r--r-- | src/core/netserver.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/netserver.cc b/src/core/netserver.cc index a753759..c8c0a9d 100644 --- a/src/core/netserver.cc +++ b/src/core/netserver.cc @@ -325,11 +325,16 @@ void NetServer::parse_incoming_message(NetClient *client, const std::string & me // pif - update player information // pif is the first command expected from the client if (command == "pif") { + std::string oldname(client->player()->name()); client->player()->recieve_client_update(msgstream); if (client->state() == NetClient::Connecting) { client->client_state = NetClient::Connected; server()->player_connect(client->player()); + } else if ((client->state() == NetClient::Connected) && (client->player()->name() != oldname)) { + oldname.append(" renamed to "); + oldname.append(client->player()->name()); + server()->broadcast(oldname); } } |