|
OpenTTD Source 20260218-master-g2123fca5ea
|
Implementation of the console hooks. More...
#include "stdafx.h"#include "core/string_consumer.hpp"#include "console_internal.h"#include "debug.h"#include "engine_func.h"#include "landscape.h"#include "saveload/saveload.h"#include "network/core/network_game_info.h"#include "network/network.h"#include "network/network_func.h"#include "network/network_base.h"#include "network/network_admin.h"#include "network/network_client.h"#include "command_func.h"#include "settings_func.h"#include "fios.h"#include "fileio_func.h"#include "fontcache.h"#include "screenshot.h"#include "genworld.h"#include "strings_func.h"#include "viewport_func.h"#include "window_func.h"#include "timer/timer.h"#include "company_func.h"#include "gamelog.h"#include "ai/ai.hpp"#include "ai/ai_config.hpp"#include "newgrf.h"#include "newgrf_profiling.h"#include "console_func.h"#include "engine_base.h"#include "road.h"#include "rail.h"#include "game/game.hpp"#include "3rdparty/fmt/chrono.h"#include "company_cmd.h"#include "misc_cmd.h"#include "network/network_content.h"#include "table/strings.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| class | ConsoleFileList |
| File list storage for the console, for caching the last 'ls' command. More... | |
| struct | ConsoleContentCallback |
| Asynchronous callback. More... | |
Enumerations | |
| enum | ConNetworkAuthorizedKeyAction : uint8_t { CNAKA_LIST , CNAKA_ADD , CNAKA_REMOVE } |
Functions | |
| template<typename T> | |
| static std::optional< T > | ParseType (std::string_view arg) |
| Parse an integer using ParseInteger and convert it to the requested type. | |
| static bool | NetworkAvailable (bool echo) |
| Check network availability and inform in console about failure of detection. | |
| static ConsoleHookResult | ConHookServerOnly (bool echo) |
| Check whether we are a server. | |
| static ConsoleHookResult | ConHookClientOnly (bool echo) |
| Check whether we are a client in a network game. | |
| static ConsoleHookResult | ConHookNeedNetwork (bool echo) |
| Check whether we are in a multiplayer game. | |
| static ConsoleHookResult | ConHookNeedNonDedicatedNetwork (bool echo) |
| Check whether we are in a multiplayer game and are playing, i.e. | |
| static ConsoleHookResult | ConHookNoNetwork (bool echo) |
| Check whether we are in singleplayer mode. | |
| static ConsoleHookResult | ConHookServerOrNoNetwork (bool echo) |
| Check if are either in singleplayer or a server. | |
| static ConsoleHookResult | ConHookNewGRFDeveloperTool (bool echo) |
| Check whether NewGRF developer tools are enabled. | |
| static bool | ConResetEngines (std::span< std::string_view > argv) |
| Reset status of all engines. | |
| static bool | ConResetEnginePool (std::span< std::string_view > argv) |
| Reset status of the engine pool. | |
| static bool | ConZoomToLevel (std::span< std::string_view > argv) |
| Zoom map to given level. | |
| static bool | ConScrollToTile (std::span< std::string_view > argv) |
| Scroll to a tile on the map. | |
| static bool | ConSave (std::span< std::string_view > argv) |
| Save the map to a file. | |
| static bool | ConSaveConfig (std::span< std::string_view > argv) |
| Explicitly save the configuration. | |
| static bool | ConLoad (std::span< std::string_view > argv) |
| Load a savegame. | |
| static bool | ConLoadScenario (std::span< std::string_view > argv) |
| Load a scenario. | |
| static bool | ConLoadHeightmap (std::span< std::string_view > argv) |
| Load a heightmap. | |
| static bool | ConRemove (std::span< std::string_view > argv) |
| Remove a savegame file from disk. | |
| static bool | ConListFiles (std::span< std::string_view > argv) |
| List all the files in the current dir via console. | |
| static bool | ConListScenarios (std::span< std::string_view > argv) |
| List all the scenarios. | |
| static bool | ConListHeightmaps (std::span< std::string_view > argv) |
| List all the heightmaps. | |
| static bool | ConChangeDirectory (std::span< std::string_view > argv) |
| Change the dir via console. | |
| static bool | ConPrintWorkingDirectory (std::span< std::string_view > argv) |
| Print the current working directory. | |
| static bool | ConClearBuffer (std::span< std::string_view > argv) |
| Clear the console's buffer. | |
| static bool | ConKickOrBan (std::string_view arg, bool ban, std::string_view reason) |
| Helper to kick or ban a user. | |
| static bool | ConKick (std::span< std::string_view > argv) |
| Kick a user from a network game. | |
| static bool | ConBan (std::span< std::string_view > argv) |
| Ban a user from a network game. | |
| static bool | ConUnBan (std::span< std::string_view > argv) |
| Unban a user from a network game. | |
| static bool | ConBanList (std::span< std::string_view > argv) |
| Show the list of banned clients. | |
| static bool | ConPauseGame (std::span< std::string_view > argv) |
| Manually pause the game. | |
| static bool | ConUnpauseGame (std::span< std::string_view > argv) |
| Manually unpause the game. | |
| static bool | ConRcon (std::span< std::string_view > argv) |
| Run a console command on the server. | |
| static bool | ConStatus (std::span< std::string_view > argv) |
| Get the status of connected clients. | |
| static bool | ConServerInfo (std::span< std::string_view > argv) |
| Get information like client/company count/limits for the server. | |
| static bool | ConClientNickChange (std::span< std::string_view > argv) |
| Change the name of a client. | |
| static std::optional< CompanyID > | ParseCompanyID (std::string_view arg) |
| Helper to parse a company ID. | |
| static bool | ConJoinCompany (std::span< std::string_view > argv) |
| As client, join a company. | |
| static bool | ConMoveClient (std::span< std::string_view > argv) |
| Move a client to a specific company. | |
| static bool | ConResetCompany (std::span< std::string_view > argv) |
| Remove a company from the game. | |
| static bool | ConNetworkClients (std::span< std::string_view > argv) |
| List the clients. | |
| static bool | ConNetworkReconnect (std::span< std::string_view > argv) |
| Connect to the last client you were connected to. | |
| static bool | ConNetworkConnect (std::span< std::string_view > argv) |
| Connect to a specific server. | |
| static bool | ConExec (std::span< std::string_view > argv) |
| Run a local script file. | |
| static bool | ConSchedule (std::span< std::string_view > argv) |
| Schedule the execution of a script. | |
| static bool | ConReturn (std::span< std::string_view > argv) |
| End the execution of the current script. | |
| bool | CloseConsoleLogIfActive () |
| std::span< const GRFFile > | GetAllGRFFiles () |
| void | ConPrintFramerate () |
| Print performance statistics to game console. | |
| void | ShowFramerateWindow () |
| Open the general framerate window. | |
| static bool | ConScript (std::span< std::string_view > argv) |
| Enable or disable logging of console output. | |
| static bool | ConEcho (std::span< std::string_view > argv) |
| Simply print the arguments. | |
| static bool | ConEchoC (std::span< std::string_view > argv) |
| Print the arguments in a particular colour. | |
| static bool | ConNewGame (std::span< std::string_view > argv) |
| Start/create a new game. | |
| static bool | ConRestart (std::span< std::string_view > argv) |
| Restart the game. | |
| static bool | ConReload (std::span< std::string_view > argv) |
| Reload a game from the loaded savegame/scenario/heightmap. | |
| static void | PrintLineByLine (const std::string &full_string) |
| Print a text buffer line by line to the console. | |
| template<typename F, typename ... Args> | |
| bool | PrintList (F list_function, Args... args) |
| Helper to print a list to the console. | |
| static bool | ConListAILibs (std::span< std::string_view > argv) |
| List all AI libraries. | |
| static bool | ConListAI (std::span< std::string_view > argv) |
| List all AI scripts. | |
| static bool | ConListGameLibs (std::span< std::string_view > argv) |
| List all game script libraries. | |
| static bool | ConListGame (std::span< std::string_view > argv) |
| List all game scripts. | |
| static bool | ConStartAI (std::span< std::string_view > argv) |
| Start a new AI. | |
| static bool | ConReloadAI (std::span< std::string_view > argv) |
| Reload/restart an AI. | |
| static bool | ConStopAI (std::span< std::string_view > argv) |
| Stop a currently running AI. | |
| static bool | ConRescanAI (std::span< std::string_view > argv) |
| Rescan the folder structure for new/changed AIs and libraries. | |
| static bool | ConRescanGame (std::span< std::string_view > argv) |
| Rescan the folder structure for new/changed game scripts and libraries. | |
| static bool | ConRescanNewGRF (std::span< std::string_view > argv) |
| Rescan the folder structure for new/changed NewGRFs. | |
| static bool | ConGetSeed (std::span< std::string_view > argv) |
| Get the seed that was used to create this game. | |
| static bool | ConGetDate (std::span< std::string_view > argv) |
| Get the current game date. | |
| static bool | ConGetSysDate (std::span< std::string_view > argv) |
| Get the current system date. | |
| static bool | ConAlias (std::span< std::string_view > argv) |
| Create an alias for a command. | |
| static bool | ConScreenShot (std::span< std::string_view > argv) |
| Make a screenshot. | |
| static bool | ConInfoCmd (std::span< std::string_view > argv) |
| Get debug information about a command. | |
| static bool | ConDebugLevel (std::span< std::string_view > argv) |
| Change the debug levels of the game. | |
| static bool | ConExit (std::span< std::string_view > argv) |
| Exit the game, i.e. | |
| static bool | ConPart (std::span< std::string_view > argv) |
| Part the game, i.e. | |
| static bool | ConHelp (std::span< std::string_view > argv) |
| Show generic help and specific help for commands. | |
| static bool | ConListCommands (std::span< std::string_view > argv) |
| List all registered commands that are not hidden. | |
| static bool | ConListAliases (std::span< std::string_view > argv) |
| List all registered aliases. | |
| static bool | ConCompanies (std::span< std::string_view > argv) |
| List all companies. | |
| static bool | ConSay (std::span< std::string_view > argv) |
| Say something to all clients in a network game. | |
| static bool | ConSayCompany (std::span< std::string_view > argv) |
| Say something to all clients in your company in a network game. | |
| static bool | ConSayClient (std::span< std::string_view > argv) |
| Say something to a specific client in a network game. | |
| static void | PerformNetworkAuthorizedKeyAction (std::string_view name, NetworkAuthorizedKeys *authorized_keys, ConNetworkAuthorizedKeyAction action, const std::string &authorized_key, CompanyID company=CompanyID::Invalid()) |
| static bool | ConNetworkAuthorizedKey (std::span< std::string_view > argv) |
| Management of authorized keys. | |
| static ContentType | StringToContentType (std::string_view str) |
| Resolve a string to a content type. | |
| static void | OutputContentState (const ContentInfo &ci) |
| Outputs content state information to console. | |
| static bool | ConContent (std::span< std::string_view > argv) |
| Downloading of content from the server. | |
| static bool | ConFont (std::span< std::string_view > argv) |
| Managing the font configuration. | |
| static bool | ConSetting (std::span< std::string_view > argv) |
| Change settings of the current game. | |
| static bool | ConSettingNewgame (std::span< std::string_view > argv) |
| Change settings of for a new game. | |
| static bool | ConListSettings (std::span< std::string_view > argv) |
| List all settings. | |
| static bool | ConGamelogPrint (std::span< std::string_view > argv) |
| Print the gamelog. | |
| static bool | ConNewGRFReload (std::span< std::string_view > argv) |
| Reload all active NewGRFs. | |
| static bool | ConListDirs (std::span< std::string_view > argv) |
| List the locations of all of the game's different sub directories. | |
| static bool | ConNewGRFProfile (std::span< std::string_view > argv) |
| Management of NewGRF profiling. | |
| static bool | ConFramerate (std::span< std::string_view > argv) |
| Show the current framerate statistics. | |
| static bool | ConFramerateWindow (std::span< std::string_view > argv) |
| Show the framerate statistics window. | |
| static std::string | FormatLabel (uint32_t label) |
| Format a label as a string. | |
| static void | ConDumpRoadTypes () |
| List all road types and their configuration. | |
| static void | ConDumpRailTypes () |
| List all rail types and their configuration. | |
| static void | ConDumpCargoTypes () |
| List all cargo types and their configuration. | |
| static bool | ConDumpInfo (std::span< std::string_view > argv) |
| Dump information about some NewGRF types. | |
| void | IConsoleStdLibRegister () |
Variables | |
| static uint | _script_current_depth |
| Depth of scripts running (used to abort execution when ConReturn is encountered). | |
| static std::string | _scheduled_monthly_script |
| Script scheduled to execute by the 'schedule' console command (empty if no script is scheduled). | |
| static const IntervalTimer< TimerGameCalendar > | _scheduled_monthly_timer |
| Timer that runs every month of game time for the 'schedule' console command. | |
| static ConsoleFileList | _console_file_list_savegame {FT_SAVEGAME, true} |
| File storage cache for savegames. | |
| static ConsoleFileList | _console_file_list_scenario {FT_SCENARIO, false} |
| File storage cache for scenarios. | |
| static ConsoleFileList | _console_file_list_heightmap {FT_HEIGHTMAP, false} |
| File storage cache for heightmaps. | |
| static const std::initializer_list< std::pair< std::string_view, NetworkAuthorizedKeys * > > | _console_cmd_authorized_keys |
| All the known authorized keys with their name. | |
Implementation of the console hooks.
Definition in file console_cmds.cpp.
| enum ConNetworkAuthorizedKeyAction : uint8_t |
Definition at line 2125 of file console_cmds.cpp.
|
extern |
Definition at line 64 of file console.cpp.
|
static |
Create an alias for a command.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1748 of file console_cmds.cpp.
References IConsole::AliasGet(), IConsole::AliasRegister(), CC_HELP, IConsoleAlias::cmdline, and IConsolePrint().
|
static |
Ban a user from a network game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 758 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, ConKickOrBan(), and IConsolePrint().
|
static |
Show the list of banned clients.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 816 of file console_cmds.cpp.
References _network_ban_list, CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
Change the dir via console.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 616 of file console_cmds.cpp.
References _console_file_list_savegame, CC_ERROR, CC_HELP, FiosType::detailed, DFT_FIOS_DIR, DFT_FIOS_DRIVE, DFT_FIOS_PARENT, FiosBrowseTo(), and IConsolePrint().
|
static |
Clear the console's buffer.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 662 of file console_cmds.cpp.
References CC_HELP, IConsolePrint(), SetWindowDirty(), and WC_CONSOLE.
|
static |
Change the name of a client.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 934 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, CLIENT_ID_SERVER, NetworkClientInfo::GetByClientID(), IConsolePrint(), NetworkIsValidClientName(), NetworkServerChangeClientName(), ParseType(), and StringConsumer::WHITESPACE_NO_NEWLINE.
|
static |
List all companies.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2014 of file console_cmds.cpp.
References _company_colours, CalculateCompanyValue(), CC_HELP, CC_INFO, GetString(), IConsolePrint(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, and VEH_TRAIN.
|
static |
Downloading of content from the server.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2311 of file console_cmds.cpp.
References _network_content_client, ContentInfo::Autoselected, CC_DEFAULT, CC_ERROR, CC_HELP, CC_WHITE, CONTENT_TYPE_END, IConsolePrint(), OutputContentState(), ParseType(), ContentInfo::Selected, StrContainsIgnoreCase(), StrEqualsIgnoreCase(), and StringToContentType().
|
static |
Change the debug levels of the game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1885 of file console_cmds.cpp.
References CC_DEFAULT, CC_ERROR, CC_HELP, GetDebugString(), IConsolePrint(), and SetDebugString().
|
static |
List all cargo types and their configuration.
Definition at line 2874 of file console_cmds.cpp.
References Armoured, Bulk, CC_DEFAULT, Covered, Express, FormatLabel(), Hazardous, IConsolePrint(), CargoSpec::Iterate(), Liquid, Mail, NonPotable, NotPourable, Oversized, Passengers, PieceGoods, Potable, Powderized, Refrigerated, and Special.
Referenced by ConDumpInfo().
|
static |
Dump information about some NewGRF types.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2933 of file console_cmds.cpp.
References CC_HELP, ConDumpCargoTypes(), ConDumpRailTypes(), ConDumpRoadTypes(), IConsolePrint(), and StrEqualsIgnoreCase().
|
static |
List all rail types and their configuration.
Definition at line 2835 of file console_cmds.cpp.
References Allow90Deg, Catenary, CC_DEFAULT, Disallow90Deg, RailTypeInfo::flags, FormatLabel(), GetRailTypeInfo(), RailTypeInfo::grffile, Hidden, IConsolePrint(), RailTypeInfo::label, RailTypeInfo::name, NoLevelCrossing, NoSpriteCombine, RAILTYPE_BEGIN, RAILTYPE_END, RTSG_GROUND, RailTypeInfo::strings, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by ConDumpInfo().
|
static |
List all road types and their configuration.
Definition at line 2797 of file console_cmds.cpp.
References Catenary, CC_DEFAULT, RoadTypeInfo::flags, FormatLabel(), GetRoadTypeInfo(), RoadTypeInfo::grffile, Hidden, IConsolePrint(), RoadTypeInfo::label, RoadTypeInfo::name, NoHouses, NoLevelCrossing, ROADTYPE_BEGIN, ROADTYPE_END, ROTSG_GROUND, RoadTypeInfo::strings, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and TownBuild.
Referenced by ConDumpInfo().
|
static |
Simply print the arguments.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1324 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
Print the arguments in a particular colour.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1337 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, IConsolePrint(), IsInsideMM(), and ParseInteger().
|
static |
Run a local script file.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1200 of file console_cmds.cpp.
References _script_current_depth, BASE_DIR, CC_ERROR, CC_HELP, FioFOpenFile(), ICON_CMDLN_SIZE, IConsoleCmdExec(), and IConsolePrint().
|
static |
Exit the game, i.e.
exit the complete application. Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1905 of file console_cmds.cpp.
References _settings_client, CC_HELP, DoExitSave(), and IConsolePrint().
|
static |
Managing the font configuration.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2401 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, FontCacheSubSetting::font, FS_BEGIN, FontCache::Get(), GetFontCacheSubSetting(), FontCache::GetFontName(), FontCache::GetFontSize(), FontCache::HasParent(), IConsolePrint(), FontCache::LoadFontCaches(), ParseInteger(), FontCacheSubSetting::size, and StrEqualsIgnoreCase().
|
static |
Show the current framerate statistics.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2752 of file console_cmds.cpp.
References CC_HELP, ConPrintFramerate(), and IConsolePrint().
|
static |
Show the framerate statistics window.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2764 of file console_cmds.cpp.
References _network_dedicated, CC_ERROR, CC_HELP, IConsolePrint(), and ShowFramerateWindow().
|
static |
Print the gamelog.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2520 of file console_cmds.cpp.
References _gamelog, CC_HELP, and IConsolePrint().
|
static |
Get the current game date.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1723 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, TimerGameCalendar::ConvertDateToYMD(), TimerGameCalendar::date, and IConsolePrint().
|
static |
Get the seed that was used to create this game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1710 of file console_cmds.cpp.
References _settings_game, CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
Get the current system date.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1736 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
Show generic help and specific help for commands.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1938 of file console_cmds.cpp.
References IConsole::AliasGet(), CC_DEFAULT, CC_ERROR, IConsole::CmdGet(), IConsoleAlias::cmdline, IConsolePrint(), and IConsoleCmd::proc.
|
static |
Check whether we are a client in a network game.
Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 164 of file console_cmds.cpp.
References _network_server, CC_ERROR, CHR_ALLOW, CHR_DISALLOW, IConsolePrint(), and NetworkAvailable().
|
static |
Check whether we are in a multiplayer game.
Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 179 of file console_cmds.cpp.
References _network_server, _networking, CC_ERROR, CHR_ALLOW, CHR_DISALLOW, IConsolePrint(), ClientNetworkGameSocketHandler::IsConnected(), and NetworkAvailable().
|
static |
Check whether we are in a multiplayer game and are playing, i.e.
we are not the dedicated server. Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 194 of file console_cmds.cpp.
References _network_dedicated, CC_ERROR, CHR_ALLOW, CHR_DISALLOW, IConsolePrint(), and NetworkAvailable().
|
static |
Check whether NewGRF developer tools are enabled.
Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 235 of file console_cmds.cpp.
References _settings_client, CC_ERROR, CHR_DISALLOW, CHR_HIDE, ConHookNoNetwork(), and IConsolePrint().
|
static |
Check whether we are in singleplayer mode.
Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 209 of file console_cmds.cpp.
References _networking, CC_ERROR, CHR_ALLOW, CHR_DISALLOW, and IConsolePrint().
Referenced by ConHookNewGRFDeveloperTool().
|
static |
Check whether we are a server.
Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 149 of file console_cmds.cpp.
References _network_server, CC_ERROR, CHR_ALLOW, CHR_DISALLOW, IConsolePrint(), and NetworkAvailable().
|
static |
Check if are either in singleplayer or a server.
Checks whether the command may be executed.
| echo | Whether to print an error message or not. |
Definition at line 222 of file console_cmds.cpp.
References _network_server, _networking, CC_ERROR, CHR_ALLOW, CHR_DISALLOW, and IConsolePrint().
|
static |
Get debug information about a command.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1862 of file console_cmds.cpp.
References CC_DEFAULT, CC_ERROR, CC_HELP, IConsole::CmdGet(), IConsoleCmd::hook, IConsolePrint(), and IConsoleCmd::name.
|
static |
As client, join a company.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 984 of file console_cmds.cpp.
References _network_own_client_id, _network_server, NetworkClientInfo::CanJoinCompany(), CC_ERROR, CC_HELP, CLIENT_ID_SERVER, NetworkClientInfo::client_playas, COMPANY_SPECTATOR, NetworkClientInfo::GetByClientID(), IConsolePrint(), Company::IsHumanID(), NetworkClientRequestMove(), NetworkServerDoMove(), and ParseCompanyID().
|
static |
Kick a user from a network game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 734 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, ConKickOrBan(), and IConsolePrint().
|
static |
Helper to kick or ban a user.
| arg | The client id or IP address. |
| ban | Whether to ban, when false only a kick is performed. |
| reason | The reason for this action. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 686 of file console_cmds.cpp.
References _redirect_console_to_client, CC_DEFAULT, CC_ERROR, CLIENT_ID_SERVER, NetworkClientInfo::GetByClientID(), IConsolePrint(), NetworkServerKickClient(), NetworkServerKickOrBanIP(), and ParseType().
|
static |
List all AI scripts.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1464 of file console_cmds.cpp.
References CC_HELP, AI::GetConsoleList(), IConsolePrint(), and PrintList().
|
static |
List all AI libraries.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1453 of file console_cmds.cpp.
References CC_HELP, AI::GetConsoleLibraryList(), IConsolePrint(), and PrintList().
|
static |
List all registered aliases.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1996 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, IConsoleAlias::cmdline, IConsolePrint(), and IConsoleAlias::name.
|
static |
List all registered commands that are not hidden.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1978 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, CHR_HIDE, IConsoleCmd::hook, IConsolePrint(), and IConsoleCmd::name.
|
static |
List the locations of all of the game's different sub directories.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. < UI name for the directory
< Index of subdirectory type
< Whether only the default (first existing) directory for this is interesting
Definition at line 2544 of file console_cmds.cpp.
References AI_DIR, AI_LIBRARY_DIR, AUTOSAVE_DIR, BASESET_DIR, CC_DEFAULT, CC_ERROR, CC_HELP, CC_INFO, FileExists(), GAME_DIR, GAME_LIBRARY_DIR, HEIGHTMAP_DIR, IConsolePrint(), NEWGRF_DIR, SAVE_DIR, SCENARIO_DIR, SCREENSHOT_DIR, SOCIAL_INTEGRATION_DIR, and StrEqualsIgnoreCase().
|
static |
List all the files in the current dir via console.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 568 of file console_cmds.cpp.
References _console_file_list_savegame, CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
List all game scripts.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1486 of file console_cmds.cpp.
References CC_HELP, Game::GetConsoleList(), IConsolePrint(), and PrintList().
|
static |
List all game script libraries.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1475 of file console_cmds.cpp.
References CC_HELP, Game::GetConsoleLibraryList(), IConsolePrint(), and PrintList().
|
static |
List all the heightmaps.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 600 of file console_cmds.cpp.
References _console_file_list_heightmap, CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
List all the scenarios.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 584 of file console_cmds.cpp.
References _console_file_list_scenario, CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
List all settings.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2506 of file console_cmds.cpp.
References CC_HELP, IConsoleListSettings(), and IConsolePrint().
|
static |
Load a savegame.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 457 of file console_cmds.cpp.
References _console_file_list_savegame, _file_to_saveload, _switch_mode, FiosType::abstract, CC_ERROR, CC_HELP, FT_SAVEGAME, IConsolePrint(), and SM_LOAD_GAME.
|
static |
Load a heightmap.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 511 of file console_cmds.cpp.
References _console_file_list_heightmap, _file_to_saveload, _switch_mode, FiosType::abstract, CC_ERROR, CC_HELP, FT_HEIGHTMAP, IConsolePrint(), and SM_START_HEIGHTMAP.
|
static |
Load a scenario.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 484 of file console_cmds.cpp.
References _console_file_list_scenario, _file_to_saveload, _switch_mode, FiosType::abstract, CC_ERROR, CC_HELP, FT_SCENARIO, IConsolePrint(), and SM_LOAD_GAME.
|
static |
Move a client to a specific company.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1036 of file console_cmds.cpp.
References _network_dedicated, CC_ERROR, CC_HELP, NetworkClientInfo::client_id, CLIENT_ID_SERVER, NetworkClientInfo::client_playas, COMPANY_SPECTATOR, NetworkClientInfo::GetByClientID(), IConsolePrint(), Company::IsHumanID(), NetworkServerDoMove(), ParseCompanyID(), and ParseType().
|
static |
Management of authorized keys.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2172 of file console_cmds.cpp.
References _console_cmd_authorized_keys, CompanyProperties::allow_list, CC_ERROR, CC_HELP, CC_WARNING, IConsolePrint(), NETWORK_PUBLIC_KEY_LENGTH, NetworkGetPublicKeyOfClient(), ParseInteger(), StrEqualsIgnoreCase(), and StrStartsWithIgnoreCase().
|
static |
List the clients.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1136 of file console_cmds.cpp.
References CC_HELP, IConsolePrint(), and NetworkPrintClients().
|
static |
Connect to a specific server.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1181 of file console_cmds.cpp.
References CC_HELP, COMPANY_NEW_COMPANY, IConsolePrint(), and NetworkClientConnectGame().
|
static |
Connect to the last client you were connected to.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1149 of file console_cmds.cpp.
References _settings_client, CC_DEFAULT, CC_ERROR, CC_HELP, COMPANY_NEW_COMPANY, COMPANY_SPECTATOR, IConsolePrint(), NetworkClientConnectGame(), and ParseCompanyID().
|
static |
Start/create a new game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1357 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, GENERATE_NEW_SEED, IConsolePrint(), ParseInteger(), and StartNewGameWithoutGUI().
|
static |
Management of NewGRF profiling.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2614 of file console_cmds.cpp.
References NewGRFProfiler::AbortTimer(), CC_DEBUG, CC_ERROR, CC_HELP, CC_INFO, CC_WARNING, NewGRFProfiler::grffile, IConsolePrint(), ParseInteger(), NewGRFProfiler::StartTimer(), StrEqualsIgnoreCase(), StrStartsWithIgnoreCase(), and StringConsumer::TryReadIntegerBase().
|
static |
Reload all active NewGRFs.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2532 of file console_cmds.cpp.
References CC_HELP, IConsolePrint(), and ReloadNewGRFData().
|
static |
Part the game, i.e.
go back to the main menu. Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1919 of file console_cmds.cpp.
References _network_dedicated, _switch_mode, CC_ERROR, CC_HELP, IConsolePrint(), and SM_MENU.
|
static |
Manually pause the game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 835 of file console_cmds.cpp.
References _networking, _pause_mode, CC_DEFAULT, CC_ERROR, CC_HELP, IConsolePrint(), and Normal.
|
extern |
Print performance statistics to game console.
Definition at line 1042 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::_pf_data, CC_ERROR, IConsolePrint(), anonymous_namespace{framerate_gui.cpp}::NUM_FRAMERATE_POINTS, PFE_AI0, PFE_DRAWING, PFE_GAMELOOP, PFE_MAX, and PFE_VIDEO.
Referenced by ConFramerate().
|
static |
Print the current working directory.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 646 of file console_cmds.cpp.
References _console_file_list_savegame, CC_DEFAULT, CC_HELP, FiosGetCurrentPath(), and IConsolePrint().
|
static |
Run a console command on the server.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 885 of file console_cmds.cpp.
References _network_server, CC_HELP, IConsoleCmdExec(), IConsolePrint(), and NetworkClientSendRcon().
|
static |
Reload a game from the loaded savegame/scenario/heightmap.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1402 of file console_cmds.cpp.
References _file_to_saveload, _settings_game, _switch_mode, CC_ERROR, CC_HELP, FT_INVALID, FT_NONE, IConsolePrint(), Map::LogX(), Map::LogY(), and SM_RELOADGAME.
|
static |
Reload/restart an AI.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1572 of file console_cmds.cpp.
References _local_company, _network_server, _networking, CC_DEFAULT, CC_ERROR, CC_HELP, Delete, IConsolePrint(), INVALID_CLIENT_ID, Company::IsHumanID(), Manual, NewAI, None, and ParseCompanyID().
|
static |
Remove a savegame file from disk.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 538 of file console_cmds.cpp.
References _console_file_list_savegame, FiosType::abstract, CC_ERROR, CC_HELP, FioRemove(), FT_SAVEGAME, and IConsolePrint().
|
static |
Rescan the folder structure for new/changed AIs and libraries.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1659 of file console_cmds.cpp.
References _network_server, _networking, CC_ERROR, CC_HELP, IConsolePrint(), and AI::Rescan().
|
static |
Rescan the folder structure for new/changed game scripts and libraries.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1677 of file console_cmds.cpp.
References _network_server, _networking, CC_ERROR, CC_HELP, IConsolePrint(), and Game::Rescan().
|
static |
Rescan the folder structure for new/changed NewGRFs.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1695 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, IConsolePrint(), and RequestNewGRFScan().
|
static |
Remove a company from the game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1090 of file console_cmds.cpp.
References CC_DEFAULT, CC_ERROR, CC_HELP, CLIENT_ID_SERVER, NetworkClientInfo::client_playas, Delete, NetworkClientInfo::GetByClientID(), IConsolePrint(), INVALID_CLIENT_ID, Company::IsHumanID(), Manual, NetworkCompanyHasClients(), and ParseCompanyID().
|
static |
Reset status of the engine pool.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 267 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, IConsolePrint(), and EngineOverrideManager::ResetToCurrentNewGRFConfig().
|
static |
Reset status of all engines.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 251 of file console_cmds.cpp.
References CC_HELP, IConsolePrint(), and StartupEngines().
|
static |
Restart the game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1380 of file console_cmds.cpp.
References _settings_game, _switch_mode, CC_HELP, IConsolePrint(), Map::LogX(), Map::LogY(), SM_RESTARTGAME, and StartNewGameWithoutGUI().
|
static |
End the execution of the current script.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1279 of file console_cmds.cpp.
References _script_current_depth, CC_HELP, and IConsolePrint().
|
static |
Save the map to a file.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 417 of file console_cmds.cpp.
References CC_DEFAULT, CC_ERROR, CC_HELP, CC_INFO, DFT_GAME_FILE, IConsolePrint(), SAVE_DIR, SaveOrLoad(), SL_OK, and SLO_SAVE.
|
static |
Explicitly save the configuration.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 443 of file console_cmds.cpp.
References CC_DEFAULT, CC_HELP, IConsolePrint(), and SaveToConfig().
|
static |
Say something to all clients in a network game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2040 of file console_cmds.cpp.
References _network_server, _redirect_console_to_admin, CC_HELP, CLIENT_ID_SERVER, DESTTYPE_BROADCAST, IConsolePrint(), NetworkClientSendChat(), and NetworkServerSendChat().
|
static |
Say something to a specific client in a network game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2092 of file console_cmds.cpp.
References _network_server, _redirect_console_to_admin, CC_ERROR, CC_HELP, CLIENT_ID_SERVER, DESTTYPE_CLIENT, IConsolePrint(), NetworkClientSendChat(), NetworkServerSendChat(), and ParseType().
|
static |
Say something to all clients in your company in a network game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2060 of file console_cmds.cpp.
References _network_server, _redirect_console_to_admin, CC_DEFAULT, CC_ERROR, CC_HELP, CLIENT_ID_SERVER, DESTTYPE_TEAM, IConsolePrint(), NetworkClientSendChat(), NetworkServerSendChat(), and ParseCompanyID().
|
static |
Schedule the execution of a script.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1249 of file console_cmds.cpp.
References _scheduled_monthly_script, BASE_DIR, CC_ERROR, CC_HELP, CC_INFO, FioCheckFileExists(), and IConsolePrint().
|
static |
Make a screenshot.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1769 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, IConsoleClose(), IConsolePrint(), MakeScreenshot(), ParseInteger(), SC_DEFAULTZOOM, SC_HEIGHTMAP, SC_MINIMAP, SC_VIEWPORT, SC_WORLD, and SC_ZOOMEDIN.
|
static |
Enable or disable logging of console output.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1299 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, CC_INFO, IConsolePrint(), and FileHandle::Open().
|
static |
Scroll to a tile on the map.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 363 of file console_cmds.cpp.
References CC_ERROR, CC_HELP, IConsolePrint(), ParseInteger(), ScrollMainWindowToTile(), Map::Size(), Map::SizeX(), Map::SizeY(), and TileXY().
|
static |
Get information like client/company count/limits for the server.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 917 of file console_cmds.cpp.
References _network_game_info, _network_server_invite_code, _settings_client, CC_DEFAULT, CC_HELP, and IConsolePrint().
|
static |
Change settings of the current game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2466 of file console_cmds.cpp.
References CC_HELP, IConsoleGetSetting(), and IConsolePrint().
|
static |
Change settings of for a new game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 2486 of file console_cmds.cpp.
References CC_HELP, IConsoleGetSetting(), and IConsolePrint().
|
static |
Start a new AI.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1497 of file console_cmds.cpp.
References _network_server, _networking, _settings_game, StringConsumer::AnyBytesLeft(), AI::CanStartNew(), CC_ERROR, CC_HELP, ScriptConfig::Change(), AIConfig::GetConfig(), ScriptConfig::HasScript(), IConsolePrint(), INVALID_CLIENT_ID, Pool< Company, CompanyID, 1 >::MAX_SIZE, NewAI, None, StringConsumer::ReadUntilChar(), StringConsumer::SKIP_ONE_SEPARATOR, ScriptConfig::StringToSettings(), and StringConsumer::TryReadIntegerBase().
|
static |
Get the status of connected clients.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 905 of file console_cmds.cpp.
References CC_HELP, IConsolePrint(), and NetworkServerShowStatusToConsole().
|
static |
Stop a currently running AI.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 1616 of file console_cmds.cpp.
References _local_company, _network_server, _networking, CC_DEFAULT, CC_ERROR, CC_HELP, Delete, IConsolePrint(), INVALID_CLIENT_ID, Company::IsHumanID(), Manual, and ParseCompanyID().
|
static |
Unban a user from a network game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 783 of file console_cmds.cpp.
References _network_ban_list, CC_DEFAULT, CC_HELP, IConsolePrint(), and ParseInteger().
|
static |
Manually unpause the game.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 858 of file console_cmds.cpp.
References _networking, _pause_mode, CC_DEFAULT, CC_ERROR, CC_HELP, Error, IConsolePrint(), and Normal.
|
static |
Zoom map to given level.
Entrypoint of a console command.
| argv | The arguments to the command. |
true iff the command is handled correctly, i.e. false to show a help message. Definition at line 316 of file console_cmds.cpp.
References _settings_client, Begin, CC_ERROR, CC_HELP, DoZoomInOutWindow(), End, GetMainWindow(), IConsolePrint(), IsInsideMM(), Max, Min, ParseInteger(), Window::viewport, Viewport::zoom, ZOOM_IN, and ZOOM_OUT.
|
static |
Format a label as a string.
If all elements are visible ASCII (excluding space) then the label will be formatted as a string of 4 characters, otherwise it will be output as an 8-digit hexadecimal value.
| label | Label to format. |
Definition at line 2787 of file console_cmds.cpp.
References GB().
Referenced by ConDumpCargoTypes(), ConDumpRailTypes(), and ConDumpRoadTypes().
|
extern |
Definition at line 66 of file newgrf.cpp.
| void IConsoleStdLibRegister | ( | ) |
Definition at line 2964 of file console_cmds.cpp.
|
inlinestatic |
Check network availability and inform in console about failure of detection.
| echo | Whether to print an error message or not. |
true iff the network is available. Definition at line 136 of file console_cmds.cpp.
References _network_available, CC_ERROR, and IConsolePrint().
Referenced by ConHookClientOnly(), ConHookNeedNetwork(), ConHookNeedNonDedicatedNetwork(), and ConHookServerOnly().
|
static |
Outputs content state information to console.
| ci | the content info |
Definition at line 2300 of file console_cmds.cpp.
References CC_COMMAND, CC_ERROR, CC_INFO, CC_WHITE, CONTENT_TYPE_BEGIN, CONTENT_TYPE_END, FormatArrayAsHex(), IConsolePrint(), ContentInfo::id, lengthof, ContentInfo::md5sum, ContentInfo::name, ContentInfo::state, to_underlying(), ContentInfo::type, and ContentInfo::unique_id.
Referenced by ConContent().
|
static |
Helper to parse a company ID.
Note that 'Company #1' has ID 0.
| arg | The string to get the company ID from. |
Definition at line 976 of file console_cmds.cpp.
References ParseType().
Referenced by ConJoinCompany(), ConMoveClient(), ConNetworkReconnect(), ConReloadAI(), ConResetCompany(), ConSayCompany(), and ConStopAI().
|
static |
Parse an integer using ParseInteger and convert it to the requested type.
| arg | The string to be converted. |
| T | The type to return. |
Definition at line 85 of file console_cmds.cpp.
References ParseInteger().
Referenced by ConClientNickChange(), ConContent(), ConKickOrBan(), ConMoveClient(), ConSayClient(), and ParseCompanyID().
|
static |
Definition at line 2131 of file console_cmds.cpp.
|
static |
Print a text buffer line by line to the console.
Lines are separated by '
'.
| full_string | The multi-line string to print. |
Definition at line 1426 of file console_cmds.cpp.
References CC_DEFAULT, and IConsolePrint().
Referenced by PrintList().
| bool PrintList | ( | F | list_function, |
| Args... | args ) |
Helper to print a list to the console.
| list_function | The function that gets the list. |
| args | The arguments for the list function. |
true, to ease the use in Definition at line 1442 of file console_cmds.cpp.
References PrintLineByLine().
Referenced by ConListAI(), ConListAILibs(), ConListGame(), and ConListGameLibs().
|
extern |
Open the general framerate window.
Definition at line 1026 of file framerate_gui.cpp.
References AllocateWindowDescFront().
Referenced by ConFramerateWindow(), and MenuClickHelp().
|
static |
Resolve a string to a content type.
| str | The string to resolve. |
Definition at line 2262 of file console_cmds.cpp.
References CONTENT_TYPE_AI, CONTENT_TYPE_AI_LIBRARY, CONTENT_TYPE_BASE_GRAPHICS, CONTENT_TYPE_END, CONTENT_TYPE_HEIGHTMAP, CONTENT_TYPE_NEWGRF, CONTENT_TYPE_SCENARIO, and StrEqualsIgnoreCase().
Referenced by ConContent().
|
static |
All the known authorized keys with their name.
Definition at line 2119 of file console_cmds.cpp.
Referenced by ConNetworkAuthorizedKey().
|
static |
File storage cache for heightmaps.
Definition at line 125 of file console_cmds.cpp.
Referenced by ConListHeightmaps(), and ConLoadHeightmap().
|
static |
File storage cache for savegames.
Definition at line 123 of file console_cmds.cpp.
Referenced by ConChangeDirectory(), ConListFiles(), ConLoad(), ConPrintWorkingDirectory(), and ConRemove().
|
static |
File storage cache for scenarios.
Definition at line 124 of file console_cmds.cpp.
Referenced by ConListScenarios(), and ConLoadScenario().
|
static |
Script scheduled to execute by the 'schedule' console command (empty if no script is scheduled).
Definition at line 61 of file console_cmds.cpp.
Referenced by ConSchedule().
|
static |
Timer that runs every month of game time for the 'schedule' console command.
Definition at line 64 of file console_cmds.cpp.
|
static |
Depth of scripts running (used to abort execution when ConReturn is encountered).
Definition at line 58 of file console_cmds.cpp.
Referenced by ConExec(), and ConReturn().