Commit Graph

78 Commits (ab535c0a8665e6380c5037d7b6f0a507fc91d36a)

Author SHA1 Message Date
Peter Nelson ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
7 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
PeterN afc1ea8135
Codechange: Using alias and std::array for company expense storage. (#11273)
This simplifies passing yearly expenses to functions and use of std algorithms.
9 months ago
Patric Stout 5f9b8aaa95
Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251) 9 months ago
Bouke Haarsma 7e54418022
Codechange: workaround CMake/Xcode duplicate file name issue (#11186)
Having a library with files with the same name isn't supported in CMake's Xcode project file generation: https://gitlab.kitware.com/cmake/cmake/-/issues/20501. One of the files is renamed to work around this bug.
9 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 10 months 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
11 months ago
Rubidium f333372dd1 Codechange: let IConsoleCmdExec accept std::string 11 months ago
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 1 year ago
Patric Stout 36a0818bc5
Remove: buying/selling/owning company shares (#10709) 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Rubidium c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 2 years ago
Michael Lutz a05fd7aa50 Change: [Network] Transfer command data as serialized byte stream without fixed structure.
The data will be transmitted as the length followed by the serialized data. This allows the command
data to be different for every command type in the future.
2 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2 years ago
dP 31cf9e888b
Add: [Network] external chat messages for remote admins (#9563) 3 years ago
Rubidium 92559e6f3a Fix #9388: thread unsafe use of NetworkAdminConsole/IConsolePrint 3 years ago
Patric Stout 63116bd59f
Fix a2051bad: SendCmdNames only sent one name per packet (#9528) 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
rubidium42 8c273ed598 Codechange: [Network] Let admin-console use std::string(_view) 3 years ago
rubidium42 e58581f1f8 Codechange: [Network] Let admin-game script use std::string 3 years ago
rubidium42 8a918ce170 Codechange: [Network] Make admin name and version std::string 3 years ago
rubidium42 fab120ee83 Codechange: [Network] Let chat communication use std::string 3 years ago
rubidium42 ae85af98eb Codechange: Use std::string GetString where convenient 3 years ago
rubidium42 ebe32ad912 Codechange: [Network] Use std::string for the internal handling of admin/rcon passwords 3 years ago
rubidium42 c73d64adf9 Codechange: move passwords in settings to std::string 3 years ago
Patric Stout b136e65cf9
Change: reworked the debug levels for network facility (#9251)
It now follows very simple rules:
0 - Fatal, user should know about this
1 - Error, but we are recovering
2 - Warning, wrong but okay if you don't know
3 - Info, information you might care about
4 -
5 - Debug #1 - High level debug messages
6 - Debug #2 - Low level debug messages
7 - Trace information
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
Rubidium d6000c2ec5 Codechange: differentiate between UDP, TCP and compatibility MTU values 3 years ago
Rubidium a2051bad50 Codechange: move logic whether there is enough space in a packet to write data into the Packet 3 years ago
Patric Stout 05612d60ae Remove: "language" field from server/client
The original idea was that people could find a server they could
talk in their native language on. This isn't really used in that
way. There are several reasons for removing this:

- the client also sends his "language" to the server, but nothing
  is doing anything with this.
- flags are a bad way to represent languages, and over the years
  we had several (rightfully) complaints about this.
- most servers have their language set to "All", and prefix the
  servername with the language it is about. This is a much more
  efficient way to do the same.

All in all, this feature should go back to the drawing board.
Maybe it could work in another form, but this form is not it.
3 years ago
Patric Stout f4bd3fff5e Remove: "map_name" from server announcements / listing
The idea back in the days was nice, but it never resulted in
anything useful. Most servers either read "(loaded game)" or
"Random Map", neither being useful. It was meant for heightmaps,
so you could find a server that was using a specific one .. but
there are many things wrong with that idea. Mostly, servers tend
to save and load savegames from time to time, after which the
original heightmap used was lost.

All in all, removing map_name all together is just better.
3 years ago
Patric Stout 53c28a8ec9 Codechange: [Network] replace _realtime_tick with std::chrono 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 3 years ago
glx 41232f18c1 Codechange: Replace network related FOR_ALL with range-based for loops 5 years ago
glx 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
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.
5 years ago
Niels Martin Hansen 5f8354f358 Change: Make a shortened network revision string for use in server queries 5 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
planetmaker 189dd2dcce (svn r25845) -Add [FS#5756]: [Admin] Send info on bankruptcy quarters also in ADMIN_PACKET_SERVER_COMPANY_INFO (zydeco) 11 years ago
planetmaker 2e390613a6 (svn r25589) -Fix [FS#5646]: Ensure that sent and received length of json strings are the same (based on patch by Xaroth) 11 years ago
planetmaker 7686587f02 (svn r25588) -Feature [FS#5643]: PING and PONG packets for admin port (Xaroth) 11 years ago
planetmaker 4a1bf704ee (svn r25587) -Add FS#5643: Conclude rcon output sent to admin clients with an RCON_END packet (Xaroth) 11 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
frosch 50806b5b3c (svn r24620) -Fix (r24619): Keep admin port API compatibility. 12 years ago
planetmaker f2e94237fc (svn r24619) -Change: Check for bankruptcy on a monthly basis (ZxBioHazardZx) 12 years ago
rubidium 70c7fbd90e (svn r23826) -Fix [FS#4972]: the detailed performance rating window showed the cargo count of the current quarter instead of the last quarter like the tooltip says 13 years ago