ddnet/src/engine
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
..
client Merge #3772 2021-05-26 21:00:49 +00:00
docs Fix typo 2018-07-10 17:29:02 +08:00
external Add client-side HTTP server info 2021-05-14 01:00:39 +02:00
server Add PINGEX and PONGEX messages that are correlatable 2021-05-14 01:01:08 +02:00
shared Merge #3772 2021-05-26 21:00:49 +00:00
antibot.h Run clang-format 2020-09-26 21:50:15 +02:00
client.h Differenciate better between window modes 2021-03-30 10:07:41 +02:00
config.h Port CConfig API from the upstream (0.7.5) 2021-01-10 17:10:19 +03:00
console.h More colors from chat in console 2021-03-08 01:20:28 +01:00
demo.h Run clang-format 2020-09-26 21:50:15 +02:00
discord.h Put the Discord stuff into its own file 2021-01-31 10:17:21 +01:00
editor.h Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
engine.h Add serverbrowser ping cache 2021-05-14 01:00:41 +02:00
friends.h Run clang-format 2020-09-26 21:50:15 +02:00
ghost.h Update ghost format to v6: Replace CRC with SHA256 2020-10-14 17:08:58 +02:00
graphics.h Merge #3804 2021-05-22 09:56:09 +00:00
input.h Update DoEditBox logic to be the same as chat 2020-10-26 01:44:10 +08:00
kernel.h Run clang-format 2020-09-26 21:50:15 +02:00
keys.h Use scancodes instead of keycodes for input (fixes #796, please test) 2017-07-21 19:53:49 +02:00
map.h Run clang-format 2020-09-26 21:50:15 +02:00
masterserver.h Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
message.h Run clang-format 2020-09-26 21:50:15 +02:00
server.h Make spectators stay specs on map changed 2021-02-23 19:36:52 +03:00
serverbrowser.h Allow pinging favorites directly, leaking your IP address 2021-05-14 01:01:09 +02:00
sound.h Modulize skins, particles, emoticons and game 2020-10-09 09:07:19 +02:00
sqlite.h Add sqlite3 to the client 2021-05-14 01:00:41 +02:00
steam.h Allow joining and inviting others via Steam friend list while ingame 2020-09-06 17:08:38 +02:00
storage.h Give tests their own playground IStorage 2021-05-14 01:00:41 +02:00
textrender.h Merge branch 'master' into pr_color_picker 2020-12-13 20:40:33 +03:00
updater.h Overhauled job system 2017-11-23 15:47:38 +01:00
uuid.h Make sure headers compile standalone 2020-09-26 21:50:27 +02:00
warning.h Add block list for drivers 2020-11-05 21:07:14 +01:00