OpenTTD Source
20241121-master-g67a0fccfad
|
Command definitions related to companies. More...
Go to the source code of this file.
Functions | |
enum ClientID uint32_t enum Colours uint8_t CommandCost | CmdCompanyCtrl (DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id) |
Control the companies: add, delete, etc. More... | |
CommandCost | CmdCompanyAllowListCtrl (DoCommandFlag flags, CompanyAllowListCtrlAction action, const std::string &public_key) |
Add or remove the given public key to the allow list of this company. More... | |
CommandCost | CmdGiveMoney (DoCommandFlag flags, Money money, CompanyID dest_company) |
Transfer funds (money) from one company to another. More... | |
CommandCost | CmdRenameCompany (DoCommandFlag flags, const std::string &text) |
Change the name of the company. More... | |
CommandCost | CmdRenamePresident (DoCommandFlag flags, const std::string &text) |
Change the name of the president. More... | |
CommandCost | CmdSetCompanyManagerFace (DoCommandFlag flags, CompanyManagerFace cmf) |
Change the company manager's face. More... | |
CommandCost | CmdSetCompanyColour (DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour) |
Change the company's company-colour. More... | |
Command definitions related to companies.
Definition in file company_cmd.h.
CommandCost CmdCompanyAllowListCtrl | ( | DoCommandFlag | flags, |
CompanyAllowListCtrlAction | action, | ||
const std::string & | public_key | ||
) |
Add or remove the given public key to the allow list of this company.
flags | Operation to perform. |
action | The action to perform. |
public_key | The public key of the client to add or remove. |
Definition at line 1004 of file company_cmd.cpp.
References _current_company, CALCA_ADD, CALCA_REMOVE, CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), and NETWORK_PUBLIC_KEY_LENGTH.
enum ClientID uint32_t enum Colours uint8_t CommandCost CmdCompanyCtrl | ( | DoCommandFlag | flags, |
CompanyCtrlAction | cca, | ||
CompanyID | company_id, | ||
CompanyRemoveReason | reason, | ||
ClientID | client_id | ||
) |
Control the companies: add, delete, etc.
flags | operation to perform |
cca | action to perform |
company_id | company to perform the action on |
client_id | ClientID |
Definition at line 864 of file company_cmd.cpp.
References _company_manager_face, _local_company, _network_own_client_id, _network_server, _networking, CCA_DELETE, CCA_NEW, CCA_NEW_AI, NetworkClientInfo::client_id, NetworkClientInfo::client_playas, CloseWindowById(), CMD_ERROR, CompanyNewsInformation::company_name, COMPANY_SPECTATOR, CRR_END, DC_EXEC, DoStartupNewCompany(), NetworkClientInfo::GetByClientID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetNumItems(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_COMPANY, InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), MarkWholeScreenDirty(), MAX_COMPANIES, NetworkAdminCompanyNew(), NetworkServerNewCompany(), NetworkUpdateClientInfo(), SetDParam(), SetDParamStr(), SetLocalCompany(), SyncCompanySettings(), WC_COMPANY_LEAGUE, WC_NETWORK_STATUS_WINDOW, and WN_NETWORK_STATUS_WINDOW_JOIN.
CommandCost CmdGiveMoney | ( | DoCommandFlag | flags, |
Money | money, | ||
CompanyID | dest_company | ||
) |
Transfer funds (money) from one company to another.
To prevent abuse in multiplayer games you can only send money to other companies if you have paid off your loan (either explicitly, or implicitly given the fact that you have more money than loan).
flags | operation to perform |
money | the amount of money to transfer; max 20.000.000 |
dest_company | the company to transfer the money to |
Definition at line 1296 of file company_cmd.cpp.
References _current_company, _networking, _settings_game, CMD_ERROR, CompanyProperties::current_loan, DC_EXEC, GameSettings::economy, EXPENSES_OTHER, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), CommandCost::GetCost(), GetString(), EconomySettings::give_money, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), CompanyProperties::money, Backup< T >::Restore(), return_cmd_error, SetDParam(), and SubtractMoneyFromCompany().
CommandCost CmdRenameCompany | ( | DoCommandFlag | flags, |
const std::string & | text | ||
) |
Change the name of the company.
flags | operation to perform |
text | the new name or an empty string when resetting to the default |
Definition at line 1169 of file company_cmd.cpp.
References _current_company, CMD_ERROR, CompanyAdminUpdate(), DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), IsUniqueCompanyName(), MarkWholeScreenDirty(), MAX_LENGTH_COMPANY_NAME_CHARS, CompanyProperties::name, return_cmd_error, and Utf8StringLength().
CommandCost CmdRenamePresident | ( | DoCommandFlag | flags, |
const std::string & | text | ||
) |
Change the name of the president.
flags | operation to perform |
text | the new name or an empty string when resetting to the default |
Definition at line 1212 of file company_cmd.cpp.
References _current_company, CMD_ERROR, CompanyAdminUpdate(), DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), InvalidateWindowClassesData(), IsUniquePresidentName(), MarkWholeScreenDirty(), MAX_LENGTH_PRESIDENT_NAME_CHARS, CompanyProperties::name, CompanyProperties::name_1, CompanyProperties::president_name, return_cmd_error, Utf8StringLength(), and WC_COMPANY.
CommandCost CmdSetCompanyColour | ( | DoCommandFlag | flags, |
LiveryScheme | scheme, | ||
bool | primary, | ||
Colours | colour | ||
) |
Change the company's company-colour.
flags | operation to perform |
scheme | scheme to set |
primary | set first/second colour |
colour | new colour for vehicles, property, etc. |
Definition at line 1070 of file company_cmd.cpp.
CommandCost CmdSetCompanyManagerFace | ( | DoCommandFlag | flags, |
CompanyManagerFace | cmf | ||
) |
Change the company manager's face.
flags | operation to perform |
cmf | face bitmasked |
Definition at line 1037 of file company_cmd.cpp.
References _current_company, CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), IsValidCompanyManagerFace(), and MarkWholeScreenDirty().