summaryrefslogtreecommitdiff
path: root/src/console_cmds.cpp
AgeCommit message (Collapse)Author
2021-03-13Fix #8851: don't allow infinite "exec" depth in script, but limit to 10 deepPatric Stout
This means if you execute a script from a script from a script, .. for more than 10 times, it bails out now. This should be sufficient for even the most complex scripts.
2021-03-13Fix: calling "exec" from script never returnedPatric Stout
Example: exec other.script echo hello The "echo" was never executed.
2021-03-10Add: make modal windows update more smoothPatric Stout
Basically, modal windows had their own thread-locking for what drawing was possible. This is a bit nonsense now we have a game-thread. And it makes much more sense to do things like NewGRFScan and GenerateWorld in the game-thread, and not in a thread next to the game-thread. This commit changes that: it removes the threads for NewGRFScan and GenerateWorld, and just runs the code in the game-thread. On regular intervals it allows the draw-thread to do a tick, which gives a much smoother look and feel. It does slow down NewGRFScan and GenerateWorld ever so slightly as it spends more time on drawing. But the slowdown is not measureable on my machines (with 700+ NewGRFs / 4kx4k map and a Debug build). Running without a game-thread means NewGRFScan and GenerateWorld are now blocking.
2021-03-04Fix dddf885f: use IConsoleError to produce console errorsPatric Stout
2021-03-04Add: allow making heightmap screenshot via consolePatric Stout
2021-03-04Feature: allow custom width/height of screenshot via consolePatric Stout
Reworked how the screenshot command works while keeping it backwards compatible. It can now more freely understand arguments, and has the ability to make SC_DEFAULTZOOM screenshots.
2021-02-05Codechange: Apply coding style (#8640)SamuXarick
* Fix: Missing or needed spaces * Codechange: Remove space * Codechange: Remove space * Codechange: More missing spaces * Codechange: Missing spaces * Codechange: Remove space * Codechange: Remove space
2021-01-22Change: Apply some consistency to singleplayer related commentsglx22
2021-01-22Fix: Use the same safety checks as 'stop_ai' for 'reload_ai'glx22
2021-01-13Add: Console command to dump debugging information (#8548)Jonathan G Rennison
2021-01-11Change: change console command "restart" and add "reload"Patric Stout
The current "restart" command is now called "reload", as that is what it does. The old "restart" command is now called "restart", as that is what it did. As this has not been in any official release yet, this shouldn't harm any kitten.
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2020-12-25Fix #6468: don't store version of AIs-started-via-console in namePatric Stout
You can do: "startai myai.3", which starts version 3 of "myai". This is very useful for testing save/load code between different versions of your AI. However, when using this syntax, the AI got saved as "myai.3" as name of the AI, instead of "myai". This caused several problems, like indicating to the user the AI could not be found, but still load the AI. But in all cases, the AI never got the chance to load the saved data, making the whole reason this exists pointless. By splitting the name and version already in the console command, the code becomes simpler and AIs started this way now follow the normal flow after initialization.
2020-12-07Remove: console command "content select all" (#8363)Patric Stout
The intention of this function was that you could download everything after a filter was applied; but this never really took off. Instead, a select few people used this functionality to download every available package on BaNaNaS. This is not in the spirit of this service. Additionally, these few people were good for 70% of the consumed bandwidth of BaNaNaS.
2020-06-08Fix: Display banlist's indexes correctlyMiguel Horta
Bug introduced via commit ab711e6942
2020-02-09Fix #7993: Compile warning in kick/ban debug messagesCharles Pigott
2020-02-06Fix 5880f147: Integer width warningsNiels Martin Hansen
2020-02-04Feature #7756: Allow server to supply a reason to kicked/banned clientsBjarni Thor
This commit adds the missing feature of allowing the server owner to provide a reason for kicking/banning a client, which the client sees in a pop-up window after being kicked. The implementation extends the network protocol by adding a new network action called NETWORK_ACTION_KICKED that is capable of having an error string, unlike the other network error packages. Additionally, the kick function broadcasts a message to all clients about the kicked client and the reason for the kick.
2020-01-26Feature: NewGRF callback profiling (#7868)Niels Martin Hansen
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
2020-01-04Feature: Minimap screenshotTELK
2019-12-21Codechange: Replace FOR_ALL_COMPANIES with range-based for loopsglx
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-09-29Fix: Some typos found using codespellJMcKiern
2019-08-04Add: 'getsysdate' console command (#7658)TELK
Add `getsysdate` console command to display system's local time, which is might be useful to check current time in script logging.
2019-04-29Codechange: Remove Company/OwnerByte typesCharles Pigott
2019-04-10Codechange: Use null pointer literal instead of the NULL macroHenry Wilson
2019-04-09Codechange: If something is a vector of strings, use a vector of strings ↵Michael Lutz
instead of an AutoFreeSmallVector.
2019-04-05Fix #7439: don't overwrite CompanyRemoveReason with ClientID (#7465)glx22
2019-03-26Codechange: Replaced SmallVector::[Begin|End]() with std alternativesHenry Wilson
2019-03-26Codechange: Replaced SmallVector::Get(n) non-const with std::vector::data() + nHenry Wilson
2019-03-26Codechange: Replace SmallVector::Length() with std::vector::size()Henry Wilson
2019-03-20Remove: ENABLE_NETWORK switchPatric Stout
This switch has been a pain for years. Often disabling broke compilation, as no developer compiles OpenTTD without, neither do any of our official binaries. Additionaly, it has grown so hugely in our codebase, that it clearly shows that the current solution was a poor one. 350+ instances of "#ifdef ENABLE_NETWORK" were in the code, of which only ~30 in the networking code itself. The rest were all around the code to do the right thing, from GUI to NewGRF. A more proper solution would be to stub all the functions, and make sure the rest of the code can simply assume network is available. This was also partially done, and most variables were correct if networking was disabled. Despite that, often the #ifdefs were still used. With the recent removal of DOS, there is also no platform anymore which we support where networking isn't working out-of-the-box. All in all, it is time to remove the ENABLE_NETWORK switch. No replacement is planned, but if you feel we really need this option, we welcome any Pull Request which implements this in a way that doesn't crawl through the code like this diff shows we used to.
2019-02-04Add: CompanyCtrlAction enum for CMD_COMPANY_CTRL actionsglx
2018-10-31Doc: Lots and lots of doxymentation fixesCharles Pigott
2018-07-19Feature: Framerate display window (#6822)Niels Martin Hansen
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
2017-09-10(svn r27914) -Fix/Feature: 'unban' console command - fix invalid help text ↵adf88
and be more verbose
2017-09-10(svn r27913) -Fix: 'unban' console command was not handling IPv6 adresses ↵adf88
properly
2016-09-04(svn r27653) -Fix(r27647): Rename FileOperation enum and values to ↵alberth
SaveLoadOperation to avoid nameclash with windows compiler toolkit.
2016-09-04(svn r27651) -Codechange: Introduce methods for setting the name and title ↵alberth
of _file_to_saveload.
2016-09-04(svn r27650) -Codechange: Replace SaveOrLoadMode by FileOperation and ↵alberth
DetailedFileType.
2016-09-04(svn r27649) -Codechange: Introduce detailed file type enum, rebuild ↵alberth
FiosType with it.
2016-09-04(svn r27647) -Codechange: Introduce file operations, and use it to replace ↵alberth
most of SaveLoadDialogMode
2016-09-04(svn r27645) -Add: Give console commands their own file list storage.alberth
2016-09-04(svn r27644) -Codechange: Split GetFiosItem into BuildFileList and FindItem, ↵alberth
and move both to FileList.
2016-09-04(svn r27642) -Codechange: FiosGet* file query functions take a destination ↵alberth
file list.
2016-09-04(svn r27641) -Codechange: Fold the _fios_items file list vector into its own ↵alberth
class.
2016-09-04(svn r27638) -Codechange: Move FiosType enum, move and rename SetFiosType ↵alberth
function.
2016-09-04(svn r27633) -Codechange: Extract _saveload_mode use from BuildFileListalberth
2014-04-25(svn r26509) -Codechange: replace strdup with stredup (the latter ensures ↵rubidium
the return is not NULL)