Peter Nelson
69e20e79ab
Codechange: Add const versions of GetItem/GetGroup, and sprinkle liberally.
...
Non-const version of GetItem is not needed.
12 months ago
Peter Nelson
233aac567b
Codechange: Use std::list instead of C-linked list for ini files.
...
This removes self-management of memory with new/delete and allows simpler iteration.
12 months ago
Peter Nelson
8bd06807e4
Codechange: Pass initializer list instead of null-terminated list of group types.
12 months ago
Peter Nelson
1fecbeff76
Codechange: Remove create parameter from IniLoadFile::GetGroup.
...
GetGroup now only returns nullptr if the group does not exist.
Use GetOrCreateGroup to create a group.
This avoids creating groups while reading ini files.
12 months ago
Peter Nelson
c47a0e1578
Codechange: Correct scope of IniItem for for-loop.
12 months ago
Peter Nelson
6ce7195ef1
Codechange: Split GetGroup into GetGroup/GetOrCreateGroup.
...
This follows the pattern used for GetItem/GetOrCreateItem, and allows use
of references where we know the group must exist.
12 months ago
Peter Nelson
54b1a067eb
Codechange: Test for nullptr instead of treating pointer as boolean.
12 months ago
Peter Nelson
d3c5ae2648
Codechange: Add CreateGroup/CreateItem methods for ini files.
...
This abstracts the internals a bit.
12 months ago
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
1 year ago
Patric Stout
37e2f99c09
Change: store crash logs in JSON format ( #11232 )
1 year ago
Tyler Trahan
701a61c9af
Codechange: Delete date_type.h
1 year ago
Tyler Trahan
77173a6a10
Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes
1 year ago
MasonGulu
0be27778af
Add: alternative setting for right-click close window option to exclude pinned windows ( #10204 )
1 year ago
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
1 year ago
Patric Stout
4f4810dc28
Fix: store autosave settings under the new names
1 year ago
Patric Stout
790c1b1b02
Codechange: refactor setting conversions and make sure it only happens once
...
By forcing it only happens once, the first time you upgrade to
a newer client, means you are free to jump between older and newer
versions after that. As they will not resync, the newer setting
can take on any of the (newer) values, without breaking the old
client. And when going to an old client and back, it doesn't
change it back to the converted value anymore.
1 year ago
Patric Stout
ece50d5a1d
Codechange: use BoolSettingDesc to parse settings in conversion code
1 year ago
Jonathan G Rennison
864d3c9c16
Fix: CMD_CHANGE_SETTING did not reject SF_NO_NETWORK_SYNC settings ( #11009 )
1 year ago
PeterN
64d6ad50f9
Codechange: Split GetItem with GetOrCreateItem. ( #10952 )
...
`IniGroup::GetItem()` returns nullptr if the item does not exist, but does not if the create parameter is set to true. Resolve CodeQL warnings with `GetOrCreateItem()` which returns a reference to the item instead.
1 year ago
Rubidium
4fdde00e25
Codechange: use std::string to create the GRF parameter list
1 year ago
Rubidium
f4b0ac2bd4
Codechange: use std::string for formatting settings
1 year ago
Peter Nelson
6b87fe6540
Codechange: Use std::array for GRF(File|Config) parameters.
...
This simplifies comparison, copying and assignment operations.
1 year ago
Rubidium
acec34a0fe
Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex
1 year ago
Rubidium
d9a04ba446
Codechange: make the MD5 hash/digest/checksum variables a std::array
1 year ago
Rubidium
9f2fc860ad
Codechange: use std::optional<std::string> for changing the script over char *
1 year ago
Rubidium
0fd9eb0faa
Codechange: use std::string for script info/library finding
1 year ago
Rubidium
a312a6c1b2
Codechange: make md5sumToString std::string compatible
1 year ago
Patric Stout
c6c3d0e6fa
Fix: no_http_content_downloads and use_relay_service as private settings ( #10762 )
...
Basically, we don't need to know those values when people send in
crash reports.
1 year ago
Tyler Trahan
6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar ( #10753 )
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
Charles Pigott
80bd5ad727
Codechange: Use std::strto* variants everywhere ( #10720 )
1 year ago
Charles Pigott
b282664242
Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives
1 year ago
Tyler Trahan
646a7e625b
Change: Use seconds for Linkgraph update settings ( #10610 )
1 year ago
Rubidium
4e65ec1dc4
Codechange: do not declare functions in blocks
2 years ago
Jonathan G Rennison
7c3c92f8b8
Fix #10155 : SyncCompanySettings sending old instead of new setting values ( #10158 )
2 years ago
Jonathan G Rennison
3b3c9c1c3a
Fix #10129 : Use after free in GRFLoadConfig invalid GRF error path ( #10130 )
2 years ago
Loïc Guilloux
d62c5667cf
Fix #9766 : Don't write uninitialised data in config file ( #9767 )
3 years ago
Michael Lutz
d85348b1d1
Codechange: Template the command callback function type to allow unpacked arguments.
3 years ago
Michael Lutz
13528bfcd0
Codechange: Un-bitstuff all remaining commands.
3 years ago
Michael Lutz
ccefa76a46
Codechange: Template DoCommandPInternal.
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
7048e1522f
Codechange: Move flags in CommandProc in front of the command arguments.
3 years ago
Michael Lutz
33ca4f2b99
Codechange: Let the compile generate the master command table out of templated command traits.
...
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
3 years ago
Michael Lutz
a38bbefe1b
Codechange: Untangle command code, flags and error string for DoCommand*.
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
Loïc Guilloux
8d2162ba2d
Fix b6a116a: convert server_advertise to server_game_type in config file ( #9515 )
3 years ago
Rubidium
c71f06e59b
Feature: parse the console settings the same way as config settings
...
Now you can use things like `set server_game_type public` instead of having to
guess the number, which would not be written into the configuration file nor
would it be shown when doing `set server_game_type`.
3 years ago
Rubidium
178ea3196b
Remove: includes to network/core/config.h from headers when only three cpp files need it
3 years ago
Rubidium
f6955a304c
Fix: ensure no more than the allowed number of NewGRFs are loaded from the configuration
3 years ago