|
static void | InternalDoBefore (bool top_level, bool test) |
| Prepare for calling a command proc. More...
|
|
static void | InternalDoAfter (CommandCost &res, DoCommandFlag flags, bool top_level, bool test) |
| Process result after calling a command proc. More...
|
|
static std::tuple< bool, bool, bool > | InternalPostBefore (Commands cmd, CommandFlags flags, TileIndex tile, StringID err_message, bool network_command) |
| Decide what to do with the command depending on current game state. More...
|
|
static void | InternalPostResult (const CommandCost &res, TileIndex tile, bool estimate_only, bool only_sending, StringID err_message, bool my_cmd) |
| Process result of executing a command, possibly displaying any error to the player. More...
|
|
static bool | InternalExecutePrepTest (CommandFlags cmd_flags, TileIndex tile, Backup< CompanyID > &cur_company) |
| Prepare for the test run of a command proc call. More...
|
|
static std::tuple< bool, bool, bool > | InternalExecuteValidateTestAndPrepExec (CommandCost &res, CommandFlags cmd_flags, bool estimate_only, bool network_command, Backup< CompanyID > &cur_company) |
| Validate result of test run and prepare for real execution. More...
|
|
static CommandCost | InternalExecuteProcessResult (Commands cmd, CommandFlags cmd_flags, const CommandCost &res_test, const CommandCost &res_exec, Money extra_cash, TileIndex tile, Backup< CompanyID > &cur_company) |
| Process the result of a command test run and execution run. More...
|
|
static void | LogCommandExecution (Commands cmd, StringID err_message, const CommandDataBuffer &args, bool failed) |
| Helper to make a desync log for a command.
|
|
Definition at line 95 of file command_func.h.
Process the result of a command test run and execution run.
- Parameters
-
| cmd | Command that was executed. |
| cmd_flags | Command flags. |
| res_test | Command result of test run. |
| tes_exec | Command result of real run. |
| extra_cash | Additional cash required for successful command execution. |
| tile | Tile of command execution. |
[in,out] | cur_company | Backup of current company at start of command execution. |
- Returns
- Final command result.
Definition at line 341 of file command.cpp.
References _command_proc_table, _current_company, _local_company, _pause_mode, CMD_COMPANY_CTRL, CMD_NO_TEST, CMD_SERVER, CMD_SPECTATOR, CMDT_SERVER_SETTING, COMPANY_SPECTATOR, CommandCost::Failed(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), CompanyProperties::last_build_coordinate, PM_COMMAND_DURING_PAUSE, PM_UNPAUSED, PSM_LEAVE_COMMAND, Backup< T >::Restore(), SetDParam(), SubtractMoneyFromCompany(), BasePersistentStorageArray::SwitchMode(), Backup< T >::Trash(), UpdateSignalsInBuffer(), and Backup< T >::Verify().
std::tuple< bool, bool, bool > CommandHelperBase::InternalExecuteValidateTestAndPrepExec |
( |
CommandCost & |
res, |
|
|
CommandFlags |
cmd_flags, |
|
|
bool |
estimate_only, |
|
|
bool |
network_command, |
|
|
Backup< CompanyID > & |
cur_company |
|
) |
| |
|
staticprotected |
Validate result of test run and prepare for real execution.
- Parameters
-
| cmd_flags | Command flags. |
[in,out] | res | Command result of test run, may be modified. |
| estimate_only | Is this just cost estimation? |
| network_command | Does this command come from the network? |
[in,out] | cur_company | Backup of current company at start of command execution. |
- Returns
- True if test run can go ahead, false on error.
Definition at line 301 of file command.cpp.
References _current_company, _generating_world, _networking, CheckCompanyHasMoney(), CMD_NO_TEST, CMD_SERVER, CMD_SPECTATOR, COMPANY_SPECTATOR, CommandCost::Failed(), PSM_LEAVE_TESTMODE, SetTownRatingTestMode(), and BasePersistentStorageArray::SwitchMode().
Decide what to do with the command depending on current game state.
- Parameters
-
cmd | Command to execute. |
flags | Command flags. |
tile | Tile of command execution. |
err_message | Message prefix to show on error. |
network_command | Does this command come from the network? |
- Returns
- error state + do only cost estimation? + send to network only?
Definition at line 207 of file command.cpp.
References _generating_world, _networking, _pause_mode, _shift_pressed, CMD_NO_EST, IsCommandAllowedWhilePaused(), IsLocalCompany(), PM_UNPAUSED, ShowErrorMessage(), TILE_SIZE, TileX(), TileY(), and WL_INFO.