summaryrefslogtreecommitdiff
path: root/src/network/network_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network_client.cpp')
-rw-r--r--src/network/network_client.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 9a6db0d2e..09103da78 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -1030,7 +1030,7 @@ void NetworkClientSendChat(NetworkAction action, DestType type, int dest, const
SEND_COMMAND(PACKET_CLIENT_CHAT)(action, type, dest, msg, data);
}
-void NetworkClientSetPassword(const char *password)
+static void NetworkClientSetPassword(const char *password)
{
SEND_COMMAND(PACKET_CLIENT_SET_PASSWORD)(password);
}
@@ -1054,6 +1054,24 @@ bool NetworkClientPreferTeamChat(const NetworkClientInfo *cio)
}
/**
+ * Sets/resets company password
+ * @param password new password, "" or "*" resets password
+ * @return new password
+ */
+const char *NetworkChangeCompanyPassword(const char *password)
+{
+ if (strcmp(password, "*") == 0) password = "";
+
+ if (!_network_server) {
+ NetworkClientSetPassword(password);
+ } else {
+ HashCurrentCompanyPassword(password);
+ }
+
+ return password;
+}
+
+/**
* Check if max_companies has been reached on the server (local check only).
* @return true if the max value has been reached or exceeded, false otherwise.
*/