ddnet/src/game/client/components
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
..
background.cpp Fix virtual call in Constructor 2020-10-10 12:16:27 +02:00
background.h Rename CURRENT to CURRENT_MAP 2020-10-02 16:21:18 +02:00
binds.cpp Fix composed binds. Close #3771 2021-04-17 17:37:39 +02:00
binds.h Port CConfig API from the upstream (0.7.5) 2021-01-10 17:10:19 +03:00
broadcast.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
broadcast.h Broadcast: Fix display time during demo replay 2019-04-02 23:28:13 +02:00
camera.cpp Add set_view camera position command 2021-01-23 17:36:35 +01:00
camera.h Add set_view camera position command 2021-01-23 17:36:35 +01:00
chat.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
chat.h More colors from chat in console 2021-03-08 01:20:28 +01:00
console.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
console.h More colors from chat in console 2021-03-08 01:20:28 +01:00
controls.cpp Add dummy_reset and remove +resetdummy 2021-03-17 18:09:39 +03:00
controls.h Add dummy_reset and remove +resetdummy 2021-03-17 18:09:39 +03:00
countryflags.cpp Fix leak, initialize UI Element Rect 2020-11-25 13:11:34 +01:00
countryflags.h Use std::sort instead of bubble_sort 2020-10-08 08:00:01 +02:00
damageind.cpp Add angle<->direction conversion functions to vector math (Cleanup) 2021-01-16 03:20:57 +03:00
damageind.h Run clang-format 2020-09-26 21:50:15 +02:00
debughud.cpp Don't crash with debug mode in demo 2020-11-12 22:56:50 +01:00
debughud.h hint for disabling debug mode 2020-11-03 15:06:31 +08:00
effects.cpp Modulize skins, particles, emoticons and game 2020-10-09 09:07:19 +02:00
effects.h Run clang-format 2020-09-26 21:50:15 +02:00
emoticon.cpp Add angle<->direction conversion functions to vector math (Cleanup) 2021-01-16 03:20:57 +03:00
emoticon.h fixed eyewheel (originally from Chairn) 2015-11-15 00:31:24 +01:00
flow.cpp Fix all Multiplication type alerts by CodeQL 2020-10-05 19:03:54 +02:00
flow.h Run clang-format 2020-09-26 21:50:15 +02:00
ghost.cpp Add skin metrics 2020-11-08 10:28:47 +01:00
ghost.h Enable clang-tidy performance-* checks 2020-11-05 11:34:20 +01:00
hud.cpp Center more tees 2021-04-09 20:11:53 +02:00
hud.h Use NUM_DUMMIES for dummy array length 2020-10-18 23:15:25 +02:00
items.cpp always use inferred tuning instead of current one 2021-04-23 13:53:54 +08:00
items.h Replace projectile hack with a new extended snapshot object 2021-01-26 20:58:42 +01:00
killmessages.cpp Center more tees 2021-04-09 20:11:53 +02:00
killmessages.h Recreate kill messages if required 2020-12-13 01:08:34 +01:00
mapimages.cpp Add F-DDrace entities 2020-12-22 12:23:21 +01:00
mapimages.h Add F-DDrace entities 2020-12-22 12:23:21 +01:00
maplayers.cpp Don't render fully transparent quads 2020-12-29 14:59:17 +01:00
maplayers.h Make animations more consistent with high float values 2020-10-05 02:32:50 +02:00
mapsounds.cpp Make animations more consistent with high float values 2020-10-05 02:32:50 +02:00
mapsounds.h Run clang-format 2020-09-26 21:50:15 +02:00
menu_background.cpp Add New Year season theme by mind and use for 2 days 2020-12-28 17:45:04 +01:00
menu_background.h Make menu background camera impl more robust 2020-10-13 15:37:34 +02:00
menus.cpp Add UI Ex class to share common ui implementations 2021-05-26 15:02:33 +02:00
menus.h Add UI Ex class to share common ui implementations 2021-05-26 15:02:33 +02:00
menus_browser.cpp Allow pinging favorites directly, leaking your IP address 2021-05-14 01:01:09 +02:00
menus_demo.cpp Add better support for compose binds in demo menu 2021-05-22 11:31:15 +02:00
menus_ingame.cpp Fix serverbrowser crash 2021-04-20 22:13:59 +02:00
menus_settings.cpp Merge #3804 2021-05-22 09:56:09 +00:00
menus_settings_assets.cpp Remove stack pointer for pID in UIs 2021-05-17 10:02:21 +02:00
menus_start.cpp Support localizing discord link 2021-03-05 17:29:18 +01:00
motd.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
motd.h Run clang-format 2020-09-26 21:50:15 +02:00
nameplates.cpp Differentiate hook symbol 2021-01-12 10:22:39 +01:00
nameplates.h Run clang-format 2020-09-26 21:50:15 +02:00
particles.cpp Respect possible particle size increase, of worst case rotation 2020-12-29 15:58:05 +01:00
particles.h Only render visible particles 2020-12-23 14:55:49 +01:00
players.cpp Add hookcollision color changeable 2021-05-11 14:34:53 +02:00
players.h Run clang-format 2020-09-26 21:50:15 +02:00
race_demo.cpp Fix variable names manually 2020-11-02 22:40:40 +01:00
race_demo.h Clean up ghost and race recorder 2017-10-06 22:01:33 +02:00
scoreboard.cpp Center tees in more places 2021-03-12 21:23:29 +01:00
scoreboard.h Scoreboard same line height and font size for each team (fixes #3216, supersedes #3219) 2020-11-05 12:15:27 +01:00
skins.cpp Differenciate between width and height for body part 2021-05-19 12:10:58 +02:00
skins.h Move PNG loading in SkinDL to fetch thread (fixes #3398) 2020-12-13 00:08:46 +01:00
sounds.cpp Add GUI & Game sound volume sliders 2020-10-11 10:16:38 +02:00
sounds.h Add GUI & Game sound volume sliders 2020-10-11 10:16:38 +02:00
spectator.cpp Center tees in more places 2021-03-12 21:23:29 +01:00
spectator.h Don't change SpectatorID when not spectating, simplify code 2020-09-28 19:55:47 +01:00
statboard.cpp Make statboard work with up to 32 players 2021-02-26 12:46:32 +01:00
statboard.h Run clang-format 2020-09-26 21:50:15 +02:00
voting.cpp Play highlight sound on vote too when authed 2020-12-18 18:38:12 +01:00
voting.h Run clang-format 2020-09-26 21:50:15 +02:00