ddnet/src/game/client
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
..
components Merge #3772 2021-05-26 21:00:49 +00:00
prediction Merge #3826 2021-05-23 08:16:57 +00:00
animstate.cpp Fix clang-analyzer-core.UndefinedBinaryOperatorResult 2020-10-14 15:45:47 +02:00
animstate.h Manual preparation for cleaner clang-format 2020-09-26 21:41:01 +02:00
component.h Port CConfig API from the upstream (0.7.5) 2021-01-10 17:10:19 +03:00
gameclient.cpp Respect tunezone for characters 2021-05-13 00:57:50 +08:00
gameclient.h Respect tunezone for characters 2021-05-13 00:57:50 +08:00
lineinput.cpp Update DoEditBox logic to be the same as chat 2020-10-26 01:44:10 +08:00
lineinput.h Fix IME stuck when 0-len TEXTEDITING event is missing. 2020-10-25 23:48:12 +08:00
projectile_data.cpp force tunezone 2021-04-23 11:01:38 +08:00
projectile_data.h force tunezone 2021-04-23 11:01:38 +08:00
race.cpp Enable modernize-loop-convert clang-tidy check 2020-11-02 22:40:24 +01:00
race.h Fix all the header guards and adjust the script a little 2018-07-06 16:11:38 +02:00
render.cpp Merge branch 'master' into pr_color_picker 2020-12-13 20:40:33 +03:00
render.h Merge branch 'master' into pr_color_picker 2020-12-13 20:40:33 +03:00
render_map.cpp Don't render fully transparent quads 2020-12-29 14:59:17 +01:00
skin.h Different comparators for skins in UI (no case) and regular skins (with case) 2021-03-23 13:39:54 +01:00
ui.cpp Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
ui.h Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
ui_ex.cpp Add UI Ex class to share common ui implementations 2021-05-26 15:02:33 +02:00
ui_ex.h Add UI Ex class to share common ui implementations 2021-05-26 15:02:33 +02:00