Commit Graph

560 Commits

Author SHA1 Message Date
Jonathan G Rennison b2572c7ca8 Fix #12563: Race condition setting finish flag in WinHTTP 2024-05-23 19:31:45 +02:00
Rubidium 457d51fc49 Cleanup: remove company password hashing and anything related to it 2024-05-07 00:03:15 +02:00
Rubidium ca4bef1504 Cleanup: remove company password related network packets 2024-05-07 00:03:15 +02:00
Rubidium 66354ab9eb Codechange: introduce allow list infrastructure for companies 2024-05-07 00:03:15 +02:00
Peter Nelson 532ce1a907
Codechange: Use Recv/Send_bytes for md5sum. (#12602)
Use existing functions to handle serialisation of arrays instead of indexed for-loop.
2024-05-01 18:55:54 +01:00
Peter Nelson a28ab8cac2
Codechange: Replace C-style casts to size_t with static_cast. (#12455)
* Codechange: Replace C-style casts to size_t with static_cast.

This touches only simple value-type casts.

* Codechange: Replace static_cast<size_t>(-1) with SIZE_MAX

Co-authored-by: Rubidium <rubidium@openttd.org>
2024-04-19 20:34:36 +01:00
rubidium42 442daf58da Codechange: replace lengthof with std::size in Windows specific code 2024-04-10 23:17:13 +02:00
Peter Nelson 54be756aae
Codechange: Pass NewGRF strings as std::string_view instead of char *. (#12461) 2024-04-09 08:40:27 +01:00
Rubidium d5e28a904d Fix fb9d4af: use different nonces for key exchange and stream encryption 2024-03-31 15:14:16 +02:00
Rubidium 8e12bd35ae Fix: server shutdown and newgame packets should be stable
The server sends shutdown and newgame (reboot) packets to any connected client.
This can be useful, so you can tell clients that are trying to join that the
server is restarting. However, that means that packets can be sent before a
version check has been done.
So, these packets should be in the stable packet range instead of the one that
is unstable and guarded by a version check.
2024-03-25 22:50:05 +01:00
Rubidium c01bf06ee1 Codefix: some minor errors in tcp-game protocol documentation 2024-03-24 06:40:38 +01:00
Rubidium 1cf8799810 Feature: encrypt the connection between game server and client 2024-03-17 19:48:34 +01:00
Rubidium d26629c15b Codechange: make encoded length of packet size and type more explicit 2024-03-17 19:48:34 +01:00
Rubidium 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
Rubidium dd532cbc77 Codechange: add setting for authorized/secret/public keys 2024-03-17 19:09:22 +01:00
Patric Stout f08da1d373
Codechange: the "no revision detected" string is with four zeros (norev0000) (#12328) 2024-03-17 13:17:35 +00:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidium fe12d38024 Codechange: split initiating of joining and identification of the client 2024-03-16 13:35:41 +01:00
Rubidium 15d02f51ed Codechange: use span to send bytes to Packet and add span recv function 2024-03-16 12:27:06 +01:00
Rubidium 6eff879e49 Codechange: pass the socket handler that is going to send the packet into the packet 2024-03-16 10:39:22 +01:00
Patric Stout 3e625b5b1a
Add: track savegame size to report with survey (#12304) 2024-03-16 08:58:56 +01:00
Patric Stout 5b3bfe4c4c
Fix fdfcb09: for content service, fallback to TCP downloads when HTTP stalls (#12056) 2024-02-11 20:24:28 +01:00
Rubidium 3534214dfc Codechange: use reference instead of pointer for CommandPacket 2024-02-05 18:57:58 +01:00
Rubidium cb588d8d3f Codechange: use std::vector for the incoming command queue 2024-02-05 18:57:58 +01:00
Rubidium 63708609fb Codechange: define the size of the PacketType enumerations 2024-02-05 17:10:35 +01:00
Rubidium 6f77c2eaa2 Codechange: use size_t for the MTU limits and remove default parameter 2024-02-05 17:10:35 +01:00
Rubidium 72a44b0df6 Codechange: use references for handling received TCP packets 2024-02-05 16:30:49 +01:00
Rubidium 8add0bf8ec Codechange: use references for game info serialization 2024-02-05 16:30:49 +01:00
Rubidium 84623d2123 Codechange: use references for UDP packets 2024-02-05 16:30:49 +01:00
Rubidium 031a9d4e26 Codechange: use std::unique_ptr for the Packets created to send via TCP 2024-02-05 16:30:49 +01:00
Rubidium 36e1b32ccf Codechange: use std::deque of std::unique_ptr to queue packets 2024-02-05 16:30:49 +01:00
Rubidium c77a45ed86 Codechange: use std::unique_ptr for receiving network packets 2024-02-05 16:30:49 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Loïc Guilloux 0e738dda88
Fix #11948: [Win32] Convert error messages to utf8 (#11951) 2024-02-02 16:30:23 +01:00
Patric Stout 89520f5665
Add: show in multiplayer the amount of hours a game has been unpaused (#11886) 2024-01-27 12:35:09 +01:00
Rubidium 2d77f09a81 Codechange: use std::shared_ptr for vector of TCPConnecters 2024-01-20 23:03:44 +01:00
Rubidium 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 2024-01-17 19:48:22 +01:00
Patric Stout 6550682b49
Codechange: minor bits and pieces related to fmt::format() (#11806)
- Don't make run-time formatting what can be done compile-time.
- Be explicit about run-time formatting.
- Fix datetime printing.
2024-01-16 21:10:34 +00:00
Rubidium 564441e822 Remove: Debug redirect over network
It does not work for dedicated servers because upon starting the process to
resolve the address to redirect to gets killed. Also with all the async going
on in the network code, the debug redirection will start very late in the
process.
2024-01-14 22:14:31 +01:00
Loïc Guilloux 93ba6d6776
Fix: compilation without precompiled headers (#11770) 2024-01-14 13:27:03 +01:00
Rubidium 3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
Patric Stout 28e2576589
Fix: race-condition when quitting the game with libcurl (#11688)
There could be a callback in _new_http_callbacks that is not
processed yet. All callbacks in _http_callbacks were cancelled,
but not the ones in _new_http_callbacks
2024-01-05 18:48:21 +00:00
Rubidium e3f49ee7a0 Codechange: coding style fixes 2024-01-04 16:23:54 +01:00
Jonathan G Rennison 0075364c89 Fix: curl_global_cleanup called before libcurl HTTP thread exited 2024-01-04 13:41:24 +01:00
Jonathan G Rennison 51ef416b49 Fix: libcurl HTTP thread race at uninit preventing thread exit 2024-01-04 13:41:24 +01:00
Patric Stout aef49e9933
Fix: race-conditions in GUI updates when downloading HTTP files (#11639) 2024-01-02 22:05:25 +01:00
Patric Stout 11ba951250
Fix: race-condition when creating new HTTP requests from different threads (#11638) 2023-12-29 12:45:23 +01:00
Rubidium 2072e532f7 Codechange: replace NULL with nullptr 2023-12-26 07:18:52 +01:00
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.
2023-11-06 20:29:35 +00:00
Rubidium 37f84b7372 Codechange: replace x.size() != 0 with !x.empty() 2023-10-20 23:05:43 +02:00