Commit Graph

287 Commits (ab9d77ebbe5bbe99246dc4491e327cb0ffa798ee)

Author SHA1 Message Date
larryfenn d738cd235f
Change: Automatic screenshot numbering with a filename ending in '#' (#9781) 2 years ago
Charles Pigott 9059215b3b Fix #10073: Stop truncating output of list_ai and friends commands 2 years ago
Charles Pigott 24f3022ee0 Fix #10074: list_ai console commands and friends were missing help text 2 years ago
Niels Martin Hansen c6953f13e4 Fix #9940: Print debuglevel parse errors to console when changed from console 2 years ago
Dave Shifflett 25ae42ae8a
Feature: Add/extend console commands to enable screenshot automation (#9771)
* Add: `zoomto` console command for main viewport

Similar in spirit to `scrollto`, `zoomto` takes an absolute zoom level
from the user and sets the main viewport to that level while respecting
both the absolute minimum and maximum zoom levels supported by the game
and any limitations imposed by the local client settings.

* Add: optional `instant` flag for `scrollto` command

Using this flag has two effects:

- if the user has smooth scrolling enabled, the scroll action will take
  place as if it were not enabled
- the viewport is redrawn immediately, so any successive `screenshot`
  command will actually work correctly

The original positional arguments are processed like same before.
2 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 3 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 3 years ago
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Niels Martin Hansen 5e3ed3a05e Add: Console command to list search directories for various things 3 years ago
Patric Stout 4c1ea4020d
Change: remove the ability to control "max spectators" (#9466)
Soon we will make "join game" join the game as spectator first,
so limiting the amount of spectators makes no sense anymore in
that context. Not sure it ever did make sense.
3 years ago
Patric Stout b6a116a247
Add: allow setting your server visibility to "invite-only" (#9434)
In this mode you do register to the Game Coordinator, but your
server will not show up in the public server listing. You can give
your friends the invite code of the server with which they can
join.
3 years ago
Patric Stout e4d216e44b Feature: join servers based on their invite code
This removes the need to know a server IP to join it. Invite codes
are small (~7 characters) indentifiers for servers, which can be
exchanged with other players to join the servers.
3 years ago
rubidium42 fc63432a11 Codechange: improve style/writing of IConsolePrint strings 3 years ago
rubidium42 75afd25e16 Change: do not print the '-' in front of help messages and make help messages more uniform 3 years ago
rubidium42 eb6cdadc4d Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
3 years ago
rubidium42 efd4ba4797 Change: unify the style of console error messages and convert to fmt
Always start with a capital, do not add "ERROR: " in front of it.
3 years ago
rubidium42 de49727ae8 Change: not performing a command is worthy of an error, not a warning
If a command cannot be executed for whatever reason, it makes no sense to call it a warning. Something has been done wrong.
Also make writing of these error message consistent while changing their "type".
3 years ago
Patric Stout 849a10520c
Change: allow pause/unpause console command in single player too (#9342) 3 years ago
rubidium42 e3717ae903 Codechange: [ContentInfo] Use std::string instead of string buffers 3 years ago
rubidium42 fd95736bac Codechange: [Network] Use std::string for server side logic of kicking and banning clients 3 years ago
rubidium42 8b9f1147df Codechange: [Network] Let server changing a client name use std::string 3 years ago
rubidium42 aa5a8fe28a Codechange: use thread safe time functions
Functions like localtime, gmtime and asctime are not thread safe as they (might) reuse the same buffer. So use the safer _s/_r variant for localtime and gmtime, and use strftime in favour of asctime.
3 years ago
rubidium42 297d6e20bf Codechange: [Network] Pass passwords as std::string to the network code 3 years ago
rubidium42 98283116fa Codechange: [Network] Make company state password std::string 3 years ago
rubidium42 16437b7c0d Codechange: move client name in settings to std::string 3 years ago
rubidium42 cc6c078dec Codechange: move hostnames in settings to std::string 3 years ago
Rubidium 495d73a67f Fix: leaking file descriptors 3 years ago
William Davis 881e1da51d
Change: Use gender-neutral pronouns in console command messages (and comments) (#9203) 3 years ago
Michael Lutz 1f159f79de Fix #9147: Delay making screenshots until the next draw tick as we may not access the video buffer from the game thread. 3 years ago
rubidium42 39c51c35f4 Fix #6598: Do not disconnect before company number validation
NetworkClientConnectGame already does a NetworkDisconnect, so no reason to do it here
3 years ago
rubidium42 3bd416bfdb Change: [Console] Show help when passing invalid company number 3 years ago
PeterN f018471b36
Cleanup: Remove old FiosList helper methods. (#9139) 3 years ago
rubidium42 a61696d6c5 Change: [Network] Encapsulate logic about the connection string to the network code (#23) 3 years ago
Patric Stout be37a2cab8 Codechange: use NetworkAddress instead of two host/port variables where possible
This also means we no longer need last_host/last_port, but can
just use a single last_joined setting.
3 years ago
Patric Stout cb2ef1ea4b Codechange: move all NetworkGameInfo related functions to a single file
It currently was a bit scattered over the place. Part of
NetworkGameInfo is also the GRF Identifiers that goes with it.
3 years ago
rubidium42 cbad518bf3 Codechange: [Network] Do not leak os_abstraction.h via network_func 3 years ago
Loïc Guilloux 888389c28d
Codechange: Use std::string in console commands/aliases registration, and std::map instead our sorted linked list (#9057)
* Codechange: Use std::string in console commands and aliases registration

* Codechange: Use std::map to register console commands

* Codechange: Use std::map to register console aliases

* Cleanup: Remove now unused function
3 years ago
rubidium42 2e0f3799a8 Change: [Network] Prevent invalid client names being sent to the server when changing it using the console/settings 3 years ago
Patric Stout 31897eaa7d Codechange: split ParseConnectionString into two functions
One also looks for a company, the other doesn't. There were more
uses of the latter than the first, leaving very weird code all
over the place.
3 years ago
rubidium42 c4bccd4f70
Fix #8874: show a warning when a NewGRF scan is requested multiple times from the console (#9022) 3 years ago
Patric Stout 5056e963ba Fix #8851: don't allow infinite "exec" depth in script, but limit to 10 deep
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.
3 years ago
Patric Stout 8230cd009d Fix: calling "exec" from script never returned
Example:

exec other.script
echo hello

The "echo" was never executed.
3 years ago
Patric Stout 970fedd78c Add: make modal windows update more smooth
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.
3 years ago
Patric Stout 06a3c0cb26 Fix dddf885f: use IConsoleError to produce console errors 3 years ago
Patric Stout 8c6b5e52fd Add: allow making heightmap screenshot via console 3 years ago
Patric Stout ac5e77ea3b Feature: allow custom width/height of screenshot via console
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.
3 years ago
SamuXarick a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
3 years ago
glx22 6b8ad5a9b1 Change: Apply some consistency to singleplayer related comments 3 years ago
glx22 07385c3662 Fix: Use the same safety checks as 'stop_ai' for 'reload_ai' 3 years ago