Commit Graph
85 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 9116f96e2e Codechange: replace char * with std::string_view 2025-04-28 17:53:18 +02:00
Rubidiumandrubidium42 26de3404a4 Codechange: use std::string_view for sending chat messages 2025-04-20 13:31:41 +02:00
Rubidiumandrubidium42 bb259b8e77 Codechange: use std::string_view for sending a remote console command (result) 2025-04-20 13:31:41 +02:00
Rubidiumandrubidium42 d99edf2bbc Codechange: use std::string_view for kicking/banning 2025-04-20 13:31:41 +02:00
Rubidiumandrubidium42 d0ba6ed1f4 Codechange: explicitly initialise network pool item related member variables 2025-02-20 16:58:51 +01:00
Rubidiumandrubidium42 af00b835a1 Codechange: remove transitional supports from the pool 2025-02-16 19:31:37 +01:00
Rubidiumandrubidium42 d55b9cff9d Codechange: strongly type ClientPoolID
Also remove some of the artifical documented limits as they are not true; the
ClientPoolID was not sent over the network, so its size isn't of concern.
2025-02-09 16:52:21 +01:00
Rubidiumandrubidium42 89d0a688a9 Codechange: Use EnumBitSet for pool types 2025-02-01 17:04:04 +01:00
Rubidiumandrubidium42 2c7b3bb55d Codechange: rename ClientIndex to ClientPoolID 2025-02-01 11:15:51 +01:00
Peter NelsonandGitHub afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter NelsonandGitHub 77f4d776c4 Codechange: Remove ZeroedMemoryAllocator from network socket handlers. (#13377)
Prefer member default initialisation instead.
2025-01-28 19:10:00 +00:00
Rubidiumandrubidium42 a9318cf653 Cleanup: remove UI for changing the password 2024-05-07 00:03:15 +02:00
Rubidiumandrubidium42 ca4bef1504 Cleanup: remove company password related network packets 2024-05-07 00:03:15 +02:00
Rubidiumandrubidium42 4af089b9be Feature: console command to change authorized keys 2024-03-17 21:21:33 +01:00
Rubidiumandrubidium42 b7dfa3eb90 Feature: authorized key authentication for rcon 2024-03-17 20:36:25 +01:00
Rubidiumandrubidium42 1cf8799810 Feature: encrypt the connection between game server and client 2024-03-17 19:48:34 +01:00
Rubidiumandrubidium42 5706801ea7 Feature: authenticate to the server without sending the password
Either using password-authentication key exchange or via authorized keys
2024-03-17 19:09:22 +01:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidiumandrubidium42 fe12d38024 Codechange: split initiating of joining and identification of the client 2024-03-16 13:35:41 +01:00
Rubidiumandrubidium42 3534214dfc Codechange: use reference instead of pointer for CommandPacket 2024-02-05 18:57:58 +01:00
Rubidiumandrubidium42 cb588d8d3f Codechange: use std::vector for the incoming command queue 2024-02-05 18:57:58 +01:00
Rubidiumandrubidium42 b3aa8a9c35 Codechange: use std::vector for the outgoing command "queues" 2024-02-05 18:57:58 +01:00
Rubidiumandrubidium42 72a44b0df6 Codechange: use references for handling received TCP packets 2024-02-05 16:30:49 +01:00
Rubidiumandrubidium42 c77a45ed86 Codechange: use std::unique_ptr for receiving network packets 2024-02-05 16:30:49 +01:00
Rubidiumandrubidium42 4b372b6050 Codechange: use std::shared_ptr to manage saveload filters instead of manually trying to avoid double frees 2024-02-03 21:38:33 +01:00
Tyler TrahanandGitHub 28716548d2 Feature: Setting to automatically restart server based on hours played (#11142) 2024-01-26 10:25:25 -05:00
Peter NelsonandPeterN 49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
Rubidiumandrubidium42 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
2023-07-19 19:30:14 +02:00
dPandGitHub 31cf9e888b Add: [Network] external chat messages for remote admins (#9563) 2021-09-19 23:09:06 +02:00
Patric StoutandGitHub 1ef4d3cf19 Remove: COMPANY_INFO packets and related code (#9475) 2021-08-14 23:24:02 +02:00
rubidium42andrubidium42 981cd0197a Codechange: [Network] Use std::string for the client name in the network server 2021-06-15 06:13:00 +02:00
rubidium42andrubidium42 667301e3ec Codechange: [Network] Make hostname/client IP return strings instead of a C-string 2021-06-15 06:13:00 +02:00
rubidium42andrubidium42 fd95736bac Codechange: [Network] Use std::string for server side logic of kicking and banning clients 2021-05-30 00:01:49 +02:00
rubidium42andrubidium42 f0e1cd0129 Codechange: [Network] Let server rcon result use std::string 2021-05-30 00:01:49 +02:00
rubidium42andrubidium42 fab120ee83 Codechange: [Network] Let chat communication use std::string 2021-05-15 10:20:50 +02:00
rubidium42andrubidium42 1de5cdeab8 Codechange: [Network] Use std::string for the internal handling of company passwords 2021-05-14 23:22:04 +02:00
William DavisandGitHub 881e1da51d Change: Use gender-neutral pronouns in console command messages (and comments) (#9203) 2021-05-08 11:02:30 +01:00
Patric StoutandPatric Stout b3003dd163 Add: ability to retrieve game info from server over TCP 2021-04-27 20:18:53 +02:00
Rubidiumandrubidium42 f71fb0f54a Codechange: encapsulate reading the size of a Packet 2021-04-24 20:42:01 +02:00
Patric StoutandPatric Stout 13889b6554 Fix: [Network] don't show "server doesn't respond" while in queue
Send all clients in the queue every game-day a packet that they
are still in the queue.
2021-02-28 12:27:04 +01:00
Patric StoutandPatric Stout 8d199b1bbc Fix: [Network] send map to next client if current client disconnects
Also terminate creating of the savegame, as the client is gone,
there really is no need for that anymore.
2021-02-28 12:27:04 +01:00
Bjarni ThorandCharles Pigott 5880f1479f Feature #7756: Allow server to supply a reason to kicked/banned clients
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-02-04 22:17:39 +00:00
glxandNiels Martin Hansen 41232f18c1 Codechange: Replace network related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Michael Lutz 05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
2019-04-06 11:27:39 +02:00
peter1138andCharles Pigott 07de9d6c3f Codechange: Use override keyword in networking classes. 2019-03-24 17:38:42 +00:00
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.
2019-03-20 19:24:55 +01:00
rubidium 4a52300838 (svn r26576) -Fix [FS#6003]: [Network] AIs would not reset certain network state information upon creation of their company 2014-05-11 12:52:21 +00:00
frosch ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 2014-04-23 20:44:42 +00:00
rubidium 18a3a569fb (svn r26005) -Fix [FS#5478]: crash when transferring savegame from server to client 2013-11-15 22:22:01 +00:00