(svn r19075) -Codechange: unhackify NetworkChangeCompanyPassword()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -1053,6 +1053,24 @@ bool NetworkClientPreferTeamChat(const NetworkClientInfo *cio)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
Reference in New Issue
Block a user