Commit Graph

2580 Commits (66cac92028e714fbc18e2650bc3d5dc50f1ba204)

Author SHA1 Message Date
William Davis 879de9781b Change: Use gender-neutral pronouns in console command messages (and comments) (#9203)
(cherry picked from commit 881e1da51d)
3 years ago
rubidium42 59a817f21f Fix: [Network] Reading beyond the length of the server's ID when hashing password
Under normal circumstances the server's ID is 32 characters excluding '\0', however this can be changed at the server. This ID is sent to the server for company name hashing. The client reads it into a statically allocated buffer of 33 bytes, but fills only the bytes it received from the server. However, the hash assumes all 33 bytes are set, thus potentially reading uninitialized data, or a part of the server ID of a previous game in the hashing routine.
It is still reading from memory assigned to the server ID, so nothing bad happens, except that company passwords might not work correctly.

(cherry picked from commit 56aa6d0edd)
3 years ago
Peter Nelson a469b4f395 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed.
(cherry picked from commit 4791ff2862)
3 years ago
Loïc Guilloux 88bc7bd235 Fix: [MinGW] Set minimum OS version to Windows XP (#9135)
(cherry picked from commit 356bbbb90a)
3 years ago
Jonathan G Rennison a9515456cb Merge branch 'master' into jgrpp
# Conflicts:
#	src/network/core/os_abstraction.h
#	src/network/core/tcp_content.h
#	src/network/core/udp.cpp
#	src/table/currency_settings.ini
#	src/table/settings.h.preamble
3 years ago
Patric Stout 8fa53f543a
Change: [Network] lower TCP connect() timeout to 3s (#9112)
Currently we use default OS timeout for TCP connections, which
is around 30s. 99% of the users will never notice this, but there
are a few cases where this is an issue:

- If you have a broken IPv6 connection, using Content Service is
  first tried over IPv6. Only after 30s it times out and tries
  IPv4. Nobody is waiting for that 30s.
- Upcoming STUN support has several methods of establishing a
  connection between client and server. This requires feedback
  from connect() to know if any method worked (they have to be
  tried one by one). With 30s, this would take a very long time.

What is good to mention, is that there is no good value here. Any
value will have edge-cases where the experience is suboptimal. But
with 3s we support most of the stable connections, and if it fails,
the user can just retry. On the other side of the spectrum, with 30s,
it means the user has no possibility to use the service. So worst case
we annoy a few users with them having the retry vs annoying a few
users which have no means of resolving the situation.
3 years ago
rubidium42 015e3b412e Cleanup: remove #ifdefs for compiling the old content server 3 years ago
rubidium42 84985c1223 Codechange: [Network] Do not leak os_abstraction.h via fios.h 3 years ago
rubidium42 cbad518bf3 Codechange: [Network] Do not leak os_abstraction.h via network_func 3 years ago
rubidium42 cf8c1aa860 Change: [Network] Use string error messages instead of numeric error numbers that need to be looked up 3 years ago
rubidium42 65c5a64719 Fix: [Network] errno and strerror do not handle network errors on Windows 3 years ago
Charles Pigott 43b6f6915b Fix 8a95fee4: Missing initialiser in Packet constructor 3 years ago
Jonathan G Rennison 8eb27e1ac7 Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/lang/japanese.txt
#	src/network/core/config.h
#	src/network/core/packet.cpp
#	src/network/core/tcp.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/toolbar_gui.cpp
#	src/vehicle_gui_base.h
3 years ago
Jonathan G Rennison 66fda55ec4 Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/network/core/packet.cpp
#	src/network/core/packet.h
#	src/network/core/tcp.cpp
#	src/network/core/udp.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/toolbar_gui.cpp
#	src/vehicle_gui_base.h
3 years ago
rubidium42 5afb090082 Change: [Network] Remove now defunct savegame transfer packet limiter 3 years ago
Rubidium a3c9eca722 Change: use 32 KiB packets to send requests to the content server 3 years ago
Rubidium 21f58ab437 Change: use 32 KiB packets to transfer the savegame 3 years ago
Rubidium d6000c2ec5 Codechange: differentiate between UDP, TCP and compatibility MTU values 3 years ago
Rubidium 8b302761d4 Codechange: allow different limits in packet sizes 3 years ago
rubidium42 65818db1f4 Fix: [Network] Prevent stalling save game transfer when compression is slow 3 years ago
Jonathan G Rennison 253772e9af Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	COMPILING.md
#	src/console.cpp
#	src/console_cmds.cpp
#	src/console_internal.h
#	src/rev.cpp.in
3 years ago
Jonathan G Rennison ba418f9d0d Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/simplified_chinese.txt
#	src/network/core/tcp_content.cpp
#	src/network/core/udp.cpp
#	src/network/network_server.cpp
#	src/saveload/linkgraph_sl.cpp
#	src/table/gameopt_settings.ini
3 years ago
Jonathan G Rennison 1e4161ff56 Merge branch 'master' into jgrpp
# Conflicts:
#	src/group_gui.cpp
3 years ago
Patric Stout fda1a590f6 Change: use icons to indicate you/host in Online Players GUI 3 years ago
Patric Stout a924b2ff81 Add: move "New Company" inside the Online Players GUI 3 years ago
Patric Stout c2e116a3d3 Change: track hover position on Online Players GUI
Especially if there are many players online, trying to chat with
the right one can be a visual challenge. This can be solved by
highlighting the row you are on. This visual cue is often enough
for humans to find the right row.
3 years ago
Patric Stout 54f69deb0c Add: ask for confirmation on admin actions in network games 3 years ago
Patric Stout ff708c2c65 Add: admin menu for companies in multiplayer games
You can now easily do:
- a password reset (unlock)
- remove an empty company (reset company)
3 years ago
Patric Stout 5266359424 Feature: rework in-game Online Players GUI
The GUI now more clearly shows some basic information about the
server you joined, your client name (and the ability to change it),
and what players are in which company.

It also contains useful buttons to press to join companies, chat
with other people, and for admins to kick/ban people.

Additionally, renamed "advertised" to "visibility"; this has to
do with future additions, but also because it is more clear in
wording.
3 years ago
Rubidium 75386873b7 Codechange: use std::vector instead of a fixed size array for Packets 3 years ago
Rubidium 450178d780 Codechange: add accessor for the packet type to Packet and make the internal state of Packet private 3 years ago
Rubidium 3abefdf561 Codechange: remove public access to the next pointer in Packet 3 years ago
Rubidium f71fb0f54a Codechange: encapsulate reading the size of a Packet 3 years ago
Rubidium 6f161f6559 Codechange: encapsulate the logic about how many bytes can be sent from a buffer in to a Packet 3 years ago
Rubidium 38d15fc9b7 Codechange: move the logic shrinking of the packets into the Packet itself 3 years ago
Rubidium d4f027c03b Codechange: encapsulate writing data from Packets into sockets/files/buffers to prevent packet state modifications outside of the Packet 3 years ago
Rubidium 98aa561cf7 Codechange: encapsulate reading data from sockets into Packets to prevent packet state modifications outside of the Packet 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
Rubidium c545cc9d70 Codechange: move more logic about packet size validity and reading into Packet 3 years ago
rubidium42 2999d301ad Add: [Network] Validate the client name when receiving one from the server
This so names from other clients are known valid in the client as well, instead allowing some compromised/bad server to potentially crash clients upon certain expectations.
3 years ago
rubidium42 e1cebe0ea0 Add: [Network] Validate the client name server side, so no clients with invalid names can actually join 3 years ago
rubidium42 2e0f3799a8 Change: [Network] Prevent invalid client names being sent to the server when changing it using the console/settings 3 years ago
rubidium42 bfb0ab3e2f Feature: [Network] Ensure players fill in a name instead of defaulting to "Player" 3 years ago
rubidium42 b14f412117 Codechange: [Network] Introduce function to validate the client name 3 years ago
Jonathan G Rennison 0d262e4d9a Send network client desync log messages to server 3 years ago
Peter Nelson 9aa64b7885 Codechange: Use new widget features on chat message box. 3 years ago
Rubidium bf4fe19a66 Codechange: merge duplicated logic to scroll in lists by key into a single function 3 years ago
Patric Stout ce6a744278 Doc: server name doesn't need to be advertised to be valid
Strictly seen the comment is true, as it says 'e.g.', but it is
misleading. The server name is just that: the name of the server
as configured. No need to mention advertising.
3 years ago
Patric Stout cd757d53ca Codechange: remove always-empty "address" from NetworkContentSocketHandler
When ever you saw this debug lines (which you never should), they
showed an empty address. It is also not very useful to have, as it
always points to a known server anyway.
3 years ago
Patric Stout 31897eaa7d Codechange: split ParseConnectionString into two functions
One also looks for a company, the other doesn't. There were more
uses of the latter than the first, leaving very weird code all
over the place.
3 years ago