summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/network/network.cpp5
-rw-r--r--src/network/network_server.cpp2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index e2984b159..264c964b3 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1732,6 +1732,7 @@ STR_NETWORK_SERVER_MESSAGE_GAME_UNPAUSED_CONNECT_FAIL :Game unpaused (
############ End of leave-in-this-order
STR_NETWORK_MESSAGE_CLIENT_LEAVING :leaving
STR_NETWORK_MESSAGE_CLIENT_JOINED :*** {RAW_STRING} has joined the game
+STR_NETWORK_MESSAGE_CLIENT_JOINED_ID :*** {RAW_STRING} has joined the game (Client #{2:NUM})
STR_NETWORK_MESSAGE_CLIENT_COMPANY_JOIN :*** {RAW_STRING} has joined company #{2:NUM}
STR_NETWORK_MESSAGE_CLIENT_COMPANY_SPECTATE :*** {RAW_STRING} has joined spectators
STR_NETWORK_MESSAGE_CLIENT_COMPANY_NEW :*** {RAW_STRING} has started a new company (#{2:NUM})
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 */