summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-12-22 23:24:53 +0000
committerdarkvater <darkvater@openttd.org>2004-12-22 23:24:53 +0000
commitc4836bbd70223842a9df4f412444ece44d9b1147 (patch)
tree95d171283345e7b2a5e3ec6b0c9f5aef12844312 /network.c
parent0e3399177eca41ea52ae9032a96cb19ed1610ebb (diff)
downloadopenttd-c4836bbd70223842a9df4f412444ece44d9b1147.tar.xz
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
-Spiced up 'set company_pw' a bit, where if no pw is typed, it shows the current one. -Added a space between company name and player; looks better
Diffstat (limited to 'network.c')
-rw-r--r--network.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/network.c b/network.c
index 3f2d1e9d4..b2d42ca46 100644
--- a/network.c
+++ b/network.c
@@ -1360,6 +1360,20 @@ void NetworkShutDown(void)
#endif
}
+void NetworkChangeCompanyPassword(const char *str)
+{
+ if (strncmp(str, "*", sizeof(_network_player_info[_local_player].password)) == 0) {
+ _network_player_info[_local_player].password[0] = '\0';
+ IConsolePrint(_iconsole_color_warning, "Company password protection removed.");
+ } else {
+ ttd_strlcpy(_network_player_info[_local_player].password, str, sizeof(_network_player_info[_local_player].password));
+ IConsolePrintF(_iconsole_color_warning, "Company protected with password '%s'.", _network_player_info[_local_player].password);
+ }
+
+ if (!_network_server)
+ SEND_COMMAND(PACKET_CLIENT_SET_PASSWORD)(_network_player_info[_local_player].password);
+}
+
#else
void ParseConnectionString(const byte **player, const byte **port, byte *connection_string) {}