Codechange: introduce allow list infrastructure for companies

This commit is contained in:
Rubidium
2024-03-23 11:53:08 +01:00
committed by rubidium42
parent 1250ce8fdc
commit 66354ab9eb
13 changed files with 63 additions and 8 deletions

View File

@@ -980,6 +980,24 @@ CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID
return CommandCost();
}
/**
* Add the given public key to the allow list of this company.
* @param flags Operation to perform.
* @param public_key The public key of the client to add.
* @return The cost of this operation or an error.
*/
CommandCost CmdCompanyAddAllowList(DoCommandFlag flags, const std::string &public_key)
{
if (flags & DC_EXEC) {
if (Company::Get(_current_company)->allow_list.Add(public_key)) {
InvalidateWindowData(WC_CLIENT_LIST, 0);
SetWindowDirty(WC_COMPANY, _current_company);
}
}
return CommandCost();
}
/**
* Change the company manager's face.
* @param flags operation to perform