ddnet/src
bors[bot] efde7523e4
Merge #3772
3772: Add client-side HTTP server info r=def- a=heinrich5991

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.
## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-05-26 21:00:49 +00:00
..
antibot Run clang-format 2020-09-26 21:50:15 +02:00
base Add function to remove directories 2021-05-14 01:00:41 +02:00
engine Merge #3772 2021-05-26 21:00:49 +00:00
game Merge #3772 2021-05-26 21:00:49 +00:00
macos OSX -> macOS 2021-02-12 13:41:41 +01:00
macoslaunch OSX -> macOS 2021-02-12 13:41:41 +01:00
mastersrv Port CConfig API from the upstream (0.7.5) 2021-01-10 17:10:19 +03:00
steam Run clang-format 2020-09-26 21:50:15 +02:00
test Special case China as its own continent for ping estimation 2021-05-14 01:01:08 +02:00
tools Fix duplicate uuid index in maps edited by tools 2021-05-03 12:02:18 +02:00
twping Run clang-format 2020-09-26 21:50:15 +02:00