diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-22 09:36:08 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-22 09:36:08 +0000 |
commit | 49b15759b7a492d778898f56131321ffe92afb40 (patch) | |
tree | a94971bcafe29b07a11b660a94931c37ef8e09e0 /src | |
parent | c11524901b338a53eee2a9f0ae9caa834a5ee76c (diff) |
Broadcast name changes
Diffstat (limited to 'src')
-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); } } |