|
OpenTTD Source 20260208-master-g43af8e94d0
|
Command definitions related to companies. More...
Go to the source code of this file.
Functions | |
| CommandCost | CmdCompanyCtrl (DoCommandFlags flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id) |
| Control the companies: add, delete, etc. | |
| CommandCost | CmdCompanyAllowListCtrl (DoCommandFlags flags, CompanyAllowListCtrlAction action, const std::string &public_key) |
| Add or remove the given public key to the allow list of this company. | |
| CommandCost | CmdGiveMoney (DoCommandFlags flags, Money money, CompanyID dest_company) |
| Transfer funds (money) from one company to another. | |
| CommandCost | CmdRenameCompany (DoCommandFlags flags, const std::string &text) |
| Change the name of the company. | |
| CommandCost | CmdRenamePresident (DoCommandFlags flags, const std::string &text) |
| Change the name of the president. | |
| CommandCost | CmdSetCompanyManagerFace (DoCommandFlags flags, uint style, uint32_t bits) |
| Change the company manager's face. | |
| CommandCost | CmdSetCompanyColour (DoCommandFlags flags, LiveryScheme scheme, bool primary, Colours colour) |
| Change the company's company-colour. | |
Command definitions related to companies.
Definition in file company_cmd.h.
| CommandCost CmdCompanyAllowListCtrl | ( | DoCommandFlags | 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 1028 of file company_cmd.cpp.
References _current_company, CALCA_ADD, CALCA_REMOVE, CMD_ERROR, Execute, InvalidateWindowData(), NETWORK_PUBLIC_KEY_LENGTH, SetWindowDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WC_CLIENT_LIST, and WC_COMPANY.
| CommandCost CmdCompanyCtrl | ( | DoCommandFlags | 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 |
| reason | The reason why the company is being removed. |
| client_id | ClientID |
Definition at line 886 of file company_cmd.cpp.
References _company_manager_face, _local_company, _network_own_client_id, _network_server, _networking, AI::BroadcastNewEvent(), CCA_DELETE, CCA_NEW, CCA_NEW_AI, ChangeOwnershipOfCompanyItems(), NetworkClientInfo::client_id, NetworkClientInfo::client_playas, CloseWindowById(), CMD_ERROR, COMPANY_SPECTATOR, CompanyAdminRemove(), CRR_END, DoStartupNewCompany(), Execute, NetworkClientInfo::GetByClientID(), GetEncodedString(), INVALID_OWNER, InvalidateWindowClassesData(), InvalidateWindowData(), CompanyProperties::is_ai, MarkWholeScreenDirty(), NetworkAdminCompanyNew(), NetworkServerNewCompany(), NetworkUpdateClientInfo(), Game::NewEvent(), ParseCompanyManagerFaceCode(), SetLocalCompany(), AI::Stop(), SyncCompanySettings(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WC_CLIENT_LIST, WC_COMPANY_LEAGUE, WC_GAME_OPTIONS, WC_MAIN_TOOLBAR, WC_NETWORK_STATUS_WINDOW, WC_SCRIPT_LIST, WC_SCRIPT_SETTINGS, and WN_NETWORK_STATUS_WINDOW_JOIN.
| CommandCost CmdGiveMoney | ( | DoCommandFlags | 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 1323 of file company_cmd.cpp.
References _current_company, _networking, _settings_game, CMD_ERROR, CompanyProperties::current_loan, Execute, EXPENSES_OTHER, CommandCost::GetCost(), GetDrawStringCompanyColour(), GetString(), CompanyProperties::money, SubtractMoneyFromCompany(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
| CommandCost CmdRenameCompany | ( | DoCommandFlags | 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 1198 of file company_cmd.cpp.
References _current_company, AI::BroadcastNewEvent(), CMD_ERROR, CompanyAdminUpdate(), Execute, GetString(), InvalidateWindowClassesData(), IsUniqueCompanyName(), MarkWholeScreenDirty(), MAX_LENGTH_COMPANY_NAME_CHARS, CompanyProperties::name, Game::NewEvent(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Utf8StringLength(), WC_COMPANY, and WID_C_COMPANY_NAME.
| CommandCost CmdRenamePresident | ( | DoCommandFlags | 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 1247 of file company_cmd.cpp.
References _current_company, AI::BroadcastNewEvent(), CMD_ERROR, CompanyAdminUpdate(), Execute, GetString(), InvalidateWindowClassesData(), IsUniquePresidentName(), MarkWholeScreenDirty(), MAX_LENGTH_PRESIDENT_NAME_CHARS, CompanyProperties::name, CompanyProperties::name_1, Game::NewEvent(), CompanyProperties::president_name, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Utf8StringLength(), WC_COMPANY, and WID_C_PRESIDENT_NAME.
| CommandCost CmdSetCompanyColour | ( | DoCommandFlags | 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 1099 of file company_cmd.cpp.
References _company_colours, _current_company, BuildOwnerLegend(), CMD_ERROR, CompanyProperties::colour, CompanyAdminUpdate(), Execute, InvalidateWindowData(), MarkWholeScreenDirty(), Livery::Primary, Livery::Secondary, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), UpdateCompanyLiveries(), UpdateObjectColours(), WC_COMPANY_VALUE, WC_DELIVERED_CARGO, WC_INCOME_GRAPH, WC_LINKGRAPH_LEGEND, WC_OPERATING_PROFIT, WC_PERFORMANCE_HISTORY, and WC_SMALLMAP.
| CommandCost CmdSetCompanyManagerFace | ( | DoCommandFlags | flags, |
| uint | style, | ||
| uint32_t | bits ) |
Change the company manager's face.
| flags | operation to perform |
| style | The style of the company manager face. |
| bits | The bits of company manager face. |
Definition at line 1062 of file company_cmd.cpp.
References _current_company, CompanyManagerFace::bits, CMD_ERROR, Execute, IsValidCompanyManagerFace(), MarkWholeScreenDirty(), SetCompanyManagerFaceStyle(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().