summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-30 18:20:26 +0000
committerrubidium <rubidium@openttd.org>2008-05-30 18:20:26 +0000
commit2f3b88ef9a217e911c897de49cc616e73a233b59 (patch)
treeae098eb73283ba9ab9875b3df24bbe3b5eb7fef1 /src/settings.cpp
parente81386476f09997485e7f707f3349685e2140a97 (diff)
downloadopenttd-2f3b88ef9a217e911c897de49cc616e73a233b59.tar.xz
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index ff3ff8d86..f0d981ddf 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -25,10 +25,7 @@
#include "screenshot.h"
#include "variables.h"
#include "network/network.h"
-#include "network/network_data.h"
-#include "network/network_client.h"
-#include "network/network_server.h"
-#include "network/network_udp.h"
+#include "network/network_func.h"
#include "settings_internal.h"
#include "command_func.h"
#include "console_func.h"
@@ -1446,23 +1443,7 @@ static int32 UpdateMinPlayers(int32 p1)
static int32 UpdatePlayerName(int32 p1)
{
- NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
-
- if (ci == NULL) return 0;
-
- /* Don't change the name if it is the same as the old name */
- if (strcmp(ci->client_name, _settings_client.network.player_name) != 0) {
- if (!_network_server) {
- SEND_COMMAND(PACKET_CLIENT_SET_NAME)(_settings_client.network.player_name);
- } else {
- if (NetworkFindName(_settings_client.network.player_name)) {
- NetworkTextMessage(NETWORK_ACTION_NAME_CHANGE, CC_DEFAULT, false, ci->client_name, "%s", _settings_client.network.player_name);
- ttd_strlcpy(ci->client_name, _settings_client.network.player_name, sizeof(ci->client_name));
- NetworkUpdateClientInfo(NETWORK_SERVER_INDEX);
- }
- }
- }
-
+ NetworkUpdatePlayerName();
return 0;
}