Commit graph

63 commits

Author SHA1 Message Date
Robert Müller 034962ae24 Add enum ERankState to replace magic numbers 2023-09-30 13:29:28 +02:00
Robert Müller dcff6d92f0 Add name for enum EClientScoreKind 2023-09-30 13:29:28 +02:00
VoxelDoesCode c4d325e09b Show if your friend is AFK through friends list
resolve mege conflict

AFK -> Afk (for consistency)
2023-09-23 00:54:13 +02:00
Robert Müller 61a9095fc3 Remove unused IServerBrowser::TYPE_NONE, add NUM_TYPES 2023-09-20 17:03:24 +02:00
Robert Müller ce65d57f2e Support dynamic list of "communities" in engine serverbrowser
Replace existing hard-coded support for two "networks" with support for a dynamic list of "communities" which are indexed by a string-ID, though right now the DDNet and KoG communities are still hard-coded. The communities now also support an arbitrary number of associated countries, types and servers. This is a refactoring to prepare for getting the list of communities dynamically from the server and removing the DDNet and KoG tabs from the serverbrowser.
2023-09-18 19:37:04 +02:00
Robert Müller 816f1a5a01 Fix memory leak of server browser entry UI elements
New UI elements were being created for every server info after refreshing the server list. At the same time, old UI elements were not being deleted when the server info objects are deleted. The use of `mutable` for this purpose was also rather unclean.

Now, a separate `std::vector` of UI elements is kept for all server browser entries, instead of associating the UI elements directly with the server info.
2023-09-17 21:37:36 +02:00
Robert Müller 8dfa0b2198 Rename UpdateFilteredPlayers, remove mutable variable 2023-09-17 21:37:32 +02:00
Robert Müller 0a290bc501 Remove unused enum literals 2023-08-30 17:58:21 +02:00
Robert Müller 3ad581aeb8 Ensure proper buffer size is used with DDNet server filter
By passing the buffer size when calling `DDNetFilterAdd` and `DDNetFilterRem`.

Mark functions and pointer parameters as `const`.
2023-06-14 00:04:01 +02:00
Edgar 1ca7870bf2
fix conflicts 2023-05-14 11:22:06 +02:00
Jupeyy 1182180e23 Add skin to serverbrowser player list 2023-01-07 09:20:25 +01:00
Robert Müller fc7c376738 Add ingame and browser buttons to copy server info to clipboard
Add "Copy info" buttons to server browser and ingame menu to copy the server info of the selected/current server to the clipboard.

The margins around the server browser details are improved.

Closes #5440.
2023-01-06 21:23:33 +01:00
heinrich5991 623a8935fb Add client_score_kind field to serverinfo
It specifies whether the scores are to be interpreted as times (string
value starting with "time") or as points (string value starting with
"points").
2022-10-20 00:43:38 +02:00
heinrich5991 150485e3b0 Remove support for legacy 64 player info protocol
It was only being used for "Leak IP" favorites and LAN servers. Since
KoG has upgraded to latest DDNet, there aren't much servers left that
don't understand the new 64 player info protocol.

Keywords: fstd, dtsf
2022-10-12 16:12:02 +02:00
heinrich5991 a97a597592 Inline Is(GameType) functions
They are used for two purposes, coloring gametypes in the serverbrowser
and enabling backward compatibility. These are independent, we shouldn't
add more stuff to the backward compatibility, hence I split them up and
inlined them.
2022-10-11 16:05:46 +02:00
def 317b2df7c0 Support multiple values to search/exclude (fixes #4119) 2022-10-07 18:21:14 +02:00
heinrich5991 6600024f24 Allow multiple addresses per server in the serverbrowser
Support is incomplete for `leak_ip_address_to_all_servers` (will only
ping the first address of each server) and for the `leak_ip` setting
(which will also only ping the first address of each server).
2022-07-10 16:52:07 +02:00
heinrich5991 246f213905 Remove a couple of game/-includes from the engine code 2022-05-13 09:04:39 +02:00
def 3d47274f28 Add tutorial joining code and tutorial map 2022-03-19 23:35:27 +01:00
fokkonaut 8300753fa4 Support 128 players in serverbrowser 2022-01-02 13:41:59 +01:00
Jupeyy a663799188 uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
heinrich5991 9002c9f9a2 Allow pinging favorites directly, leaking your IP address
This is on by default for favorites added in the LAN tab, otherwise off.
2021-05-14 01:01:09 +02:00
heinrich5991 9eca91de74 Special case China as its own continent for ping estimation
It has an exceptionally bad connection to the outside due to the Great
Firewall of China:
https://en.wikipedia.org/w/index.php?title=Great_Firewall&oldid=1019589632
2021-05-14 01:01:08 +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
Jupeyy fb74bcbb55 Don't sort on entry adding 2020-12-22 11:30:20 +01:00
Jupeyy 74515d4b95 UI Elements 2020-10-19 23:52:29 +02:00
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
def 00b66362c3 Allow zooming on city mod 2020-09-24 19:05:30 +02:00
def 7aed6476dc Allow larger map names 2020-06-18 18:29:27 +02:00
def 31ae4c4d5a use pid in file names of temporary files
to prevent race conditions with multiple clients running when saving
maps, config on quit, during upgrade
2020-02-12 23:14:30 +01:00
trml 0b3f3b03b5 Rewrite of prediction code, with additional prediction 2019-04-21 16:12:20 +02:00
def bf576723a3 Add KoG tab in server browser
- As requested by qshar and KoG players
- Similar to DDNet tab
- Info fetched from servers-kog entry from https://info.ddnet.tw/info
- Also supports countries and types
- Doesn't inform whether map has been finished
- Generalized the code a bit but it's still ugly
- Depends on #1533, also shows KoG servers as official/verified
2019-03-24 23:15:40 +01:00
def 4f515bf67e Add symbol for official servers in server browser (fixes #1501)
- Also fix favorites checkbox when removing favorite
- Might need a nicer looking symbol
2019-03-19 07:46:50 +01:00
fokkonaut cf09fbd1ea Merge BW support into IsDDNet 2019-01-14 16:50:06 +01:00
def faf388b853 Fix #1350 2018-10-29 22:03:57 +01:00
fokkonaut 3240f6fbc5 fix bw support 2018-09-28 18:27:51 +02:00
Dennis Felsing e295a121e4 DDNET_INFO(_TMP) 2018-08-23 09:57:35 +02:00
Dennis Felsing e2eb4a66dc Add Filter for connecting players (fixes #1263) 2018-08-21 09:03:48 +02:00
Redix 1c377ed00f Added Fastcap support for ghost and race demo 2017-09-28 16:01:57 +02:00
def 040fc9ca32 Implement right click and middle click on country and type filters
Right click: exclusively activate one
Middle click: reset (reenable all)
2017-08-30 22:36:39 +02:00
def 16f3ddc5a7 Show if user has rank on map in browser (+filter)
UI implementation by timakro
2017-08-30 21:34:04 +02:00
heinrich5991 1d81d56850 Introduce new, vanilla-compatible server info protocol
This means that we have a reliable and fast way to query for extended info,
while also not wasting network bandwidth.

The protocol is designed to be extensible, there's four bytes space for
encoding more request types (currently zeroed), and there's one string in each
response packet and one string for each player available (currently the empty
string).

The protocol itself has no problems with more than 64 players, although the
current client implementation will drop the player info after the 64th player,
because it uses a static array for storage.

Also fixes #130, the player list is just sorted each time new player info
arrives.
2017-03-29 12:56:13 +02:00
Tim Schumacher 4a22e762ff added entities clear for other gametypes 2016-04-29 19:29:19 +02:00
Chairn 3552e1a042 Added eye wheel. Render only on ddrace/race/ictf+/dm+/gctf+ server. 2015-08-30 21:42:16 +02:00
def 5f2c91d160 Fix server browser to refresh first time when initially on news tab 2015-08-25 00:51:01 +02:00
def b6008f5b20 Only refresh serverbrowser when necessary 2015-05-11 21:51:06 +02:00
def 8d945fe968 Exclude DDNet servery by type 2014-12-14 16:45:18 +01:00
def 8b108a2311 Clean up gametype determination 2014-12-10 03:39:15 +01:00
east 202d5d8866 Filter flag grid added 2014-09-19 23:52:09 +02:00
east e732008157 DDNet serverlist added 2014-09-13 16:36:25 +02:00