Commit graph

16 commits

Author SHA1 Message Date
def e9ffcc3c50 Fix serverinfo json parser to work with system libjsonparser (fixes #4202)
Debian, Ubuntu, Fedora are using libjsonparser without our own changes,
thus we were doing garbage.
2021-11-17 18:26:16 +01:00
Jupeyy ce9a962030 Rename VERSION to VERSION.txt 2021-10-06 16:13:36 +02:00
heinrich5991 436e202cbd Add client-side HTTP server info
Summary
=======

The idea of this is that clients will not have to ping each server for
server infos which takes long, leaks the client's IP address even to
servers the user does not join and is a DoS vector of the game servers
for attackers.

For the Internet, DDNet and KoG tab, the server list is entirely fetched
from the master server, filtering out servers that don't belong into the
list.

The favorites tab is also supposed to work that way, except for servers
that are marked as "also ping this server if it's not in the master
server list".

The LAN tab continues to broadcast the server info packet to find
servers in the LAN.

How does it work?
=================

The client ships with a list of master server list URLs. On first start,
the client checks which of these work and selects the fastest one.
Querying the server list is a HTTP GET request on that URL. The
response is a JSON document that contains server infos, server addresses
as URLs and an approximate location.

It can also contain a legacy server list which is a list of bare IP
addresses similar to the functionality the old master servers provided
via UDP. This allows us to backtrack on the larger update if it won't
work out.

Lost functionality
==================

(also known as user-visible changes)

Since the client doesn't ping each server in the list anymore, it has no
way of knowing its latency to the servers.

This is alleviated a bit by providing an approximate location for each
server (continent) so the client only has to know its own location for
approximating pings.
2021-05-14 01:00:39 +02:00
def 017b8c3621 Move DDNet-custom json code out of external directory (fixes #2022) 2020-01-01 20:07:04 +01:00
def 2fb5835980 Update json-parser to 1.1.0, zlib to 1.2.11 2017-07-22 11:07:29 +02:00
def 23b6b02534 Remove inlines in json.c to fix VS compilation 2015-08-13 12:26:49 +02:00
Chairn 3f4ed266fb Fix debug compilation on Windows with MinGW.(by Savander) 2015-08-12 00:35:25 +02:00
def 7f8ce3c8dd Rename json.cpp to json.c again 2015-07-01 14:13:06 +02:00
def c65458ca06 Fix compilation on MSVC (by coffee) (fixes #138) 2015-01-20 13:46:26 +01:00
Learath Lea d7771f8f7d Fix debug build on MinGW. Add json_get_boolean. 2015-01-19 22:14:50 +01:00
def d2ef256f06 Final compilation fix for Windows 2014-09-20 14:42:12 +02:00
def 4a703576ab Revert "Now Windows compiling (by Tobii)"
This reverts commit 5b4878d0d4.
2014-09-20 14:41:38 +02:00
def 5b4878d0d4 Now Windows compiling (by Tobii) 2014-09-20 14:30:18 +02:00
def 3b3955632c Hopefully fix Windows compile 2014-09-20 14:20:43 +02:00
east 6ab9279211 json related updates 2014-09-18 16:11:22 +02:00
east d161005658 json parser added 2014-09-18 14:40:29 +02:00