(svn r21854) -Codechange: refactor the password setting methods to make it possible to change the password of other companies (on the server)

This commit is contained in:
rubidium
2011-01-19 16:47:40 +00:00
parent a5108a1fa2
commit f1e42dc23b
9 changed files with 32 additions and 32 deletions

View File

@@ -151,18 +151,19 @@ byte NetworkSpectatorCount()
}
/**
* Sets/resets company password
* @param password new password, "" or "*" resets password
* @return new password
* Change the company password of a given company.
* @param company_id ID of the company the password should be changed for.
* @param password The unhashed password we like to set ('*' or '' resets the password)
* @return The password.
*/
const char *NetworkChangeCompanyPassword(const char *password)
const char *NetworkChangeCompanyPassword(CompanyID company_id, const char *password, bool already_hashed)
{
if (strcmp(password, "*") == 0) password = "";
if (!_network_server) {
NetworkClientSetCompanyPassword(password);
if (_network_server) {
NetworkServerSetCompanyPassword(company_id, password, already_hashed);
} else {
HashCurrentCompanyPassword(password);
NetworkClientSetCompanyPassword(password);
}
return password;