summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-07 21:28:16 +0000
committerrubidium <rubidium@openttd.org>2009-09-07 21:28:16 +0000
commitbd9670ea4764ee8df4b549f80f2743fb08bd5202 (patch)
treee4594a9313db7486f9c713b4361422f933ed87c6 /src/network
parent673df8c5c79d5a9e6e0eb3525b19b74a4e7843e6 (diff)
downloadopenttd-bd9670ea4764ee8df4b549f80f2743fb08bd5202.tar.xz
(svn r17467) -Change: show the client id in join messages at the server (patch by dihedral)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp5
-rw-r--r--src/network/network_server.cpp2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 02ce168b4..e4e21f1d9 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -227,7 +227,10 @@ void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_se
colour = CC_DEFAULT;
strid = STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW;
break;
- case NETWORK_ACTION_JOIN: strid = STR_NETWORK_MESSAGE_CLIENT_JOINED; break;
+ case NETWORK_ACTION_JOIN:
+ /* Show the Client ID for the server but not for the client. */
+ strid = _network_server ? STR_NETWORK_MESSAGE_CLIENT_JOINED_ID : STR_NETWORK_MESSAGE_CLIENT_JOINED;
+ break;
case NETWORK_ACTION_LEAVE: strid = STR_NETWORK_MESSAGE_CLIENT_LEFT; break;
case NETWORK_ACTION_NAME_CHANGE: strid = STR_NETWORK_MESSAGE_NAME_CHANGE; break;
case NETWORK_ACTION_GIVE_MONEY: strid = self_send ? STR_NETWORK_MESSAGE_GAVE_MONEY_AWAY : STR_NETWORK_MESSAGE_GIVE_MONEY; break;
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 02e26f750..33f7f4df9 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -805,7 +805,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_MAP_OK)
NetworkGetClientName(client_name, sizeof(client_name), cs);
- NetworkTextMessage(NETWORK_ACTION_JOIN, CC_DEFAULT, false, client_name);
+ NetworkTextMessage(NETWORK_ACTION_JOIN, CC_DEFAULT, false, client_name, NULL, cs->client_id);
/* Mark the client as pre-active, and wait for an ACK
* so we know he is done loading and in sync with us */