Commit graph

30 commits

Author SHA1 Message Date
heinrich5991 8996d152ab Allow multiple connect addresses
This allows the client to connect to servers that have both an IPv4 and
an IPv6 address, even if the client is only connected to one of the two.
The one faster to answer will be picked.

Timeout codes are now generated based on *all* of the server's
addresses.

Fixes #5158.
2022-07-10 16:57:10 +02:00
heinrich5991 4fb050ccb7 Use STUN to determine UDP connectivity and show diagnostics
These diagnostics are supposed to guide the user to problem resolution.
They're displayed if no packet is received from the server within one
second of connecting.

No message if we don't have STUN servers.

"Trying to determine UDP connectivity..." if no answer has been received
from the STUN server yet and it hasn't timed out yet.

"UDP seems to be filtered." if the STUN request has timed out.

"UDP and TCP IP addresses seem to be different. Try disabling VPN,
proxy or network accelerators." if the STUN request has returned an IP
address different from the one obtained via HTTP from info2.ddnet.tw.

"No answer from server yet." otherwise, if the STUN request has returned
no interesting data, indicating that it's likely the game server's
fault.
2022-05-18 09:21:31 +02:00
ChillerDrgon 18ca71ae55 Close sockets 2022-04-14 11:50:10 +02:00
heinrich5991 1a35595bce Unify buffer handling in UDP sockets across operating systems
Previously, only Linux used an internal buffer (for optimized
receiving). Now all OSs use an internal buffer so that the call to
`net_udp_recv` behaves the same on all platforms.
2022-03-05 14:11:03 +01:00
heinrich5991 a8664a0100 Hide the recvmmsg as an implementation detail 2022-03-04 19:33:06 +01:00
heinrich5991 3211b1de67 Remove unused Flags argument in network code 2022-03-04 19:33:06 +01:00
heinrich5991 471bb441a1 Move NETSOCKET behind a pointer so it can grow 2022-03-04 19:33:06 +01:00
Dennis Felsing cc4be4b3b1 s/errornous/erroneous/g 2022-02-21 15:54:55 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
trml f3b0a1e331 Add ClPredictionMargin 2022-01-09 13:08:11 +01:00
Alexander Akulich 2790270abf Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
Learath 444bd93437 Fix recvmmsg again... 2020-06-19 20:28:55 +03:00
Learath 88ca573682 Serverinfo and Register support for 0.7
Co-authored-by: Tim Schumacher <tim@timakro.de>
2020-06-19 20:28:55 +03:00
def a116ed3dbe Revert "New try at not decompressing unknown packets"
Causes connection problems with old clients
This reverts commit a3b07dbf9c.
2018-12-30 12:22:05 +01:00
def 4b92e72763 Prevent copies 2018-12-17 22:15:41 +01:00
Dennis Felsing 9febf58f37 New try at recvmmsg with some improvements 2018-12-16 22:59:41 +01:00
def a3b07dbf9c New try at not decompressing unknown packets 2018-12-16 22:15:45 +01:00
def d884465710 Revert "Don't decompress packets from unknown IPs"
This reverts commit 9089c2b35a.
2018-12-14 17:12:49 +01:00
Dennis Felsing 9089c2b35a Don't decompress packets from unknown IPs 2018-12-13 16:24:37 +01:00
def 18529fa082 Revert "Implement recvmmsg"
This reverts commit de5fe64be5.
2018-07-29 23:07:59 +02:00
Dennis Felsing de5fe64be5 Implement recvmmsg 2018-07-25 16:06:00 +02:00
heinrich5991 1d81d56850 Introduce new, vanilla-compatible server info protocol
This means that we have a reliable and fast way to query for extended info,
while also not wasting network bandwidth.

The protocol is designed to be extensible, there's four bytes space for
encoding more request types (currently zeroed), and there's one string in each
response packet and one string for each player available (currently the empty
string).

The protocol itself has no problems with more than 64 players, although the
current client implementation will drop the player info after the 64th player,
because it uses a static array for storage.

Also fixes #130, the player list is just sorted each time new player info
arrives.
2017-03-29 12:56:13 +02:00
oy 01527f51c9 let the client check if a connection is still established and for the correct peer address before processing data. Closes #1356 2015-08-22 21:52:02 +02:00
oy f1fc3337f5 prevent that the server uses close messages from clients. Closes #950 2013-02-24 17:32:48 +01:00
oy 06115dd49d added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
oy 34a9ca20a7 added ipv6 support from the old lua branch 2011-03-28 20:11:28 +02:00
Sworddragon fc9211c777 Updated copyrights 2010-11-20 21:26:06 +01:00
oy cabecb7fa9 added output level for console print function, categorised the debug messages and merged them into the new functionality. Closes #8 2010-08-18 00:06:00 +02:00
Magnus Auvinen 72c06a2589 copied refactor to trunk 2010-05-29 07:25:38 +00:00
Renamed from src/engine/e_network_client.cpp (Browse further)