(svn r19075) -Codechange: unhackify NetworkChangeCompanyPassword()

This commit is contained in:
smatz
2010-02-10 15:17:27 +00:00
parent 85c856a3ac
commit c736bbb875
6 changed files with 31 additions and 22 deletions

View File

@@ -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.