Commit Graph

664 Commits (53f83c31b01e798299b98aaf5ccaf61aa99b8109)

Author SHA1 Message Date
Rubidium 275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 1 year ago
Rubidium c518293135 Codechange: replace printf with fmt::print 1 year ago
Rubidium 07860e67e2 Codechange: use fmt::format_to to format the help message 1 year ago
Rubidium acec34a0fe Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex 1 year ago
Peter Nelson 83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 1 year ago
Patric Stout 7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
1 year ago
Rubidium 9f2fc860ad Codechange: use std::optional<std::string> for changing the script over char * 1 year ago
Rubidium a312a6c1b2 Codechange: make md5sumToString std::string compatible 1 year ago
Peter Nelson 00bf42353a Codechange: Place gamelog into its own class, along with internal data.
Data is now stored in vectors to avoid manual memory management and
passing lengths around.
1 year ago
Rubidium 1f3b7e2efd Codechange: use std::string instead of stredup for saveload error messages 1 year ago
Rubidium ee723f26ba Codechange: Make FileToSaveLoad's title std::string and simplify assignments 1 year ago
Rubidium ef3beef7e9 Codechange: use fmt::format_to instead of seprintf to write the savegame info 1 year ago
Patric Stout f5fad88723
Change: base autosaves intervals on real time (instead of game time) (#10655)
There are two fundamental issues with autosave:
- When fast-forwarding, it saves way too often
- When paused, it never saves

Both makes no sense. Autosaves are meant to prevent you from
accidentally losing your work. The emphasis on "your" work.

To solve both issues, the autosave now works on real time. You
can select every 10 / 30 / 60 / 120 minutes, which are similar to
what the setting was in game-months.

When you pause, autosaving will stop. Unless you make any change
to the game; then it will continue to make autosaves, even so
the game is paused. Unpausing / pausing resets this mechanism.
1 year ago
Charles Pigott 80bd5ad727
Codechange: Use std::strto* variants everywhere (#10720) 1 year ago
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 1 year ago
Rubidium f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Rubidium f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 1 year ago
PeterN d5f9e04a55
Change: Failure to load a savegame is critical. (#10682)
Marking the error message critical ensures it is queued if multiple errors occured.
1 year ago
Patric Stout ed83c4b0da
Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
1 year ago
Patric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 1 year ago
Patric Stout 5e1bcee39b Codechange: introduce a framework for all our timers
IntervalTimer and TimeoutTimer use RAII, and can be used to replace
all the time-based timeouts, lag-detection, "execute every N" we
have.
As it uses RAII, you can safely use it as static variable, class
member, temporary variable, etc. As soon as it goes out-of-scope,
it will be safely removed.
This allows for much easier to read code when it comes to intervals.
1 year ago
Rubidium 24b5033a06 Fix #10568: "can savegame be loaded check" failed in dedicated server
* If loading fails, it usually returns SL_REINIT which doesn't trigger check
 * If savegame has NewGRFs, it complains NewGRFs are not allowed in intro game
1 year ago
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 1 year ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago
Peter Nelson 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2 years ago
Jonathan G Rennison 0fae0599b7 Fix: Data race on effect volume setting with mixer thread 2 years ago
krysclarke 21cea308f9
Codechange: Move Sound Driver parameter name listings (#10127) 2 years ago
Charles Pigott 9059215b3b Fix #10073: Stop truncating output of list_ai and friends commands 2 years ago
Peter Nelson f6ad8e1c9c Change: Rename some freetype things to fontcache.
The font cache supports more than just FreeType as a font provider, but still used freetype in some naming.

This now uses more suitable terms.
2 years ago
Niels Martin Hansen c6953f13e4 Fix #9940: Print debuglevel parse errors to console when changed from console 2 years ago
Niels Martin Hansen 470c902bdc Fix #9918: Reset industy last production year on scenario start 2 years ago
Niels Martin Hansen 2cdb0cb084 Codechange: Factor out OnStartScenario function 2 years ago
Niels Martin Hansen 0dce7bf85d Add: Commandline option to skip NewGRF scanning 2 years ago
Tyler Trahan ec90fb4c99 Fix #6544: Don't join AI company when loading network game in singleplayer 2 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 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
Rubidium 92559e6f3a Fix #9388: thread unsafe use of NetworkAdminConsole/IConsolePrint 3 years ago
Patric Stout 579f393374
Add: open Online Players GUI on starting/joining a server (#9479) 3 years ago
Loïc Guilloux 460991ecf4
Feature: Persistant rotation of numbered auto/netsave after restart (#9397)
It was always starting from 0 on openttd restart.
Now the most recent auto/netsave number will be used as a base to generate the next filename.
3 years ago
glx22 afea5e85ae Fix 433f74e: GetString() requires a language pack 3 years ago
Stephan a70aa5df49
Add #9188: netsave now keeps multiple version around, similar to autosave (#9395) 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
rubidium42 e588923bff Codechange: add std::string accepting SetDParamStr to ErrorMessageData 3 years ago
Patric Stout ed3946e295
Add: '-X' option to ignore global folders in the search path (#9341)
This is extreme useful for automated testing. Without this, OpenTTD
will always look in your personal-dir (like ~/.local/share/openttd
or %USER%\Documents\OpenTTD). For most users this is exactly what
we want, that there is a shared place for all their files.

However, for automated testing this is rather annoying, as your
local development files influence the automated test. As such,
'-X' counters this, and only gives the local folders. This is
especially useful in combination with '-x' and '-c'.
3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 3 years ago
rubidium42 297d6e20bf Codechange: [Network] Pass passwords as std::string to the network code 3 years ago
rubidium42 c73d64adf9 Codechange: move passwords in settings to std::string 3 years ago