3#ifndef ENGINE_SERVERBROWSER_H
4#define ENGINE_SERVERBROWSER_H
14#include <unordered_set>
123 static bool ParseLocation(
int *pResult,
const char *pString);
194 return !(*
this == Other);
234 bool HasCountry(
const char *pCountryName)
const;
235 bool HasType(
const char *pTypeName)
const;
243 virtual void Add(
const char *pElement) = 0;
244 virtual void Remove(
const char *pElement) = 0;
247 virtual bool Filtered(
const char *pElement)
const = 0;
326 virtual void Refresh(
int Type,
bool Force =
false) = 0;
Definition: serverbrowser.h:235
Definition: serverbrowser.h:65
int m_CustomSkinColorFeet
Definition: serverbrowser.h:78
int m_Country
Definition: serverbrowser.h:69
int m_CustomSkinColorBody
Definition: serverbrowser.h:77
char m_aSkin[MAX_SKIN_LENGTH]
Definition: serverbrowser.h:75
bool m_Player
Definition: serverbrowser.h:71
int m_Score
Definition: serverbrowser.h:70
char m_aName[MAX_NAME_LENGTH]
Definition: serverbrowser.h:67
bool m_CustomSkinColors
Definition: serverbrowser.h:76
int m_FriendState
Definition: serverbrowser.h:80
char m_aClan[MAX_CLAN_LENGTH]
Definition: serverbrowser.h:68
bool m_Afk
Definition: serverbrowser.h:72
Definition: serverbrowser.h:23
bool m_RequiresLogin
Definition: serverbrowser.h:120
int m_Location
Definition: serverbrowser.h:107
int m_QuickSearchHit
Definition: serverbrowser.h:92
int m_MapSize
Definition: serverbrowser.h:115
char m_aMap[MAX_MAP_LENGTH]
Definition: serverbrowser.h:113
uint64_t m_ReceivedPackets
Definition: serverbrowser.h:86
bool m_LatencyIsEstimated
Definition: serverbrowser.h:108
int m_MaxClients
Definition: serverbrowser.h:96
char m_aAddress[MAX_SERVER_ADDRESSES *NETADDR_MAXSTRSIZE]
Definition: serverbrowser.h:117
int m_NumAddresses
Definition: serverbrowser.h:89
EClientScoreKind m_ClientScoreKind
Definition: serverbrowser.h:101
char m_aCommunityId[MAX_COMMUNITY_ID_LENGTH]
Definition: serverbrowser.h:104
int m_NumPlayers
Definition: serverbrowser.h:99
NETADDR m_aAddresses[MAX_SERVER_ADDRESSES]
Definition: serverbrowser.h:90
ERankState m_HasRank
Definition: serverbrowser.h:110
static int EstimateLatency(int Loc1, int Loc2)
Definition: serverbrowser.cpp:2301
int m_Flags
Definition: serverbrowser.h:100
int m_ServerIndex
Definition: serverbrowser.h:83
@ LOC_AUSTRALIA
Definition: serverbrowser.h:30
@ LOC_EUROPE
Definition: serverbrowser.h:31
@ LOC_NORTH_AMERICA
Definition: serverbrowser.h:32
@ LOC_SOUTH_AMERICA
Definition: serverbrowser.h:33
@ LOC_UNKNOWN
Definition: serverbrowser.h:27
@ LOC_AFRICA
Definition: serverbrowser.h:28
@ LOC_ASIA
Definition: serverbrowser.h:29
@ LOC_CHINA
Definition: serverbrowser.h:38
@ NUM_LOCS
Definition: serverbrowser.h:39
char m_aGameType[16]
Definition: serverbrowser.h:111
char m_aCommunityCountry[MAX_COMMUNITY_COUNTRY_LENGTH]
Definition: serverbrowser.h:105
CClient m_aClients[SERVERINFO_MAX_CLIENTS]
Definition: serverbrowser.h:118
char m_aName[64]
Definition: serverbrowser.h:112
char m_aVersion[32]
Definition: serverbrowser.h:116
int m_NumFilteredPlayers
Definition: serverbrowser.h:119
int m_NumReceivedClients
Definition: serverbrowser.h:87
int m_MapCrc
Definition: serverbrowser.h:114
int m_FriendState
Definition: serverbrowser.h:93
static bool ParseLocation(int *pResult, const char *pString)
Definition: serverbrowser.cpp:2314
int m_Latency
Definition: serverbrowser.h:109
int m_MaxPlayers
Definition: serverbrowser.h:98
EClientScoreKind
Definition: serverbrowser.h:43
@ CLIENT_SCORE_KIND_UNSPECIFIED
Definition: serverbrowser.h:44
@ CLIENT_SCORE_KIND_TIME
Definition: serverbrowser.h:46
@ CLIENT_SCORE_KIND_POINTS
Definition: serverbrowser.h:45
@ CLIENT_SCORE_KIND_TIME_BACKCOMPAT
Definition: serverbrowser.h:47
char m_aCommunityType[MAX_COMMUNITY_TYPE_LENGTH]
Definition: serverbrowser.h:106
int m_NumClients
Definition: serverbrowser.h:97
ERankState
Definition: serverbrowser.h:51
@ RANK_UNAVAILABLE
Definition: serverbrowser.h:52
@ RANK_UNRANKED
Definition: serverbrowser.h:54
@ RANK_RANKED
Definition: serverbrowser.h:53
TRISTATE m_Favorite
Definition: serverbrowser.h:102
int m_Type
Definition: serverbrowser.h:85
TRISTATE m_FavoriteAllowPing
Definition: serverbrowser.h:103
@ MAX_COMMUNITY_ID_LENGTH
Definition: serverbrowser.h:59
@ MAX_COMMUNITY_TYPE_LENGTH
Definition: serverbrowser.h:61
@ MAX_COMMUNITY_COUNTRY_LENGTH
Definition: serverbrowser.h:60
int m_FriendNum
Definition: serverbrowser.h:94
Definition: serverbrowser.h:241
virtual bool Empty() const =0
virtual void Remove(const char *pElement)=0
virtual void Add(const char *pElement)=0
virtual bool Filtered(const char *pElement) const =0
Definition: serverbrowser.h:302
CServerEntry * m_pPrevReq
Definition: serverbrowser.h:309
int m_GotInfo
Definition: serverbrowser.h:306
int64_t m_RequestTime
Definition: serverbrowser.h:304
CServerEntry * m_pNextReq
Definition: serverbrowser.h:310
CServerInfo m_Info
Definition: serverbrowser.h:307
bool m_RequestIgnoreInfo
Definition: serverbrowser.h:305
Definition: serverbrowser.h:263
virtual bool IsGettingServerlist() const =0
virtual int Max(const CServerInfo &Item) const =0
virtual void CleanFilters()=0
virtual SHA256_DIGEST DDNetInfoSha256() const =0
virtual std::vector< const CCommunity * > SelectedCommunities() const =0
virtual bool IsRefreshing() const =0
virtual std::vector< const CCommunity * > FavoriteCommunities() const =0
virtual const CCommunity * Community(const char *pCommunityId) const =0
@ TYPE_INTERNET
Definition: serverbrowser.h:287
@ SORT_NUMFRIENDS
Definition: serverbrowser.h:281
@ SORT_GAMETYPE
Definition: serverbrowser.h:279
@ TYPE_LAN
Definition: serverbrowser.h:288
@ SORT_MAP
Definition: serverbrowser.h:278
@ QUICK_MAPNAME
Definition: serverbrowser.h:285
@ TYPE_FAVORITES
Definition: serverbrowser.h:289
@ QUICK_SERVERNAME
Definition: serverbrowser.h:283
@ TYPE_FAVORITE_COMMUNITY_2
Definition: serverbrowser.h:291
@ SORT_NAME
Definition: serverbrowser.h:276
@ TYPE_FAVORITE_COMMUNITY_5
Definition: serverbrowser.h:294
@ TYPE_FAVORITE_COMMUNITY_1
Definition: serverbrowser.h:290
@ TYPE_FAVORITE_COMMUNITY_3
Definition: serverbrowser.h:292
@ SORT_NUMPLAYERS
Definition: serverbrowser.h:280
@ NUM_TYPES
Definition: serverbrowser.h:295
@ QUICK_PLAYER
Definition: serverbrowser.h:284
@ LAN_PORT_END
Definition: serverbrowser.h:298
@ TYPE_FAVORITE_COMMUNITY_4
Definition: serverbrowser.h:293
@ LAN_PORT_BEGIN
Definition: serverbrowser.h:297
@ SORT_PING
Definition: serverbrowser.h:277
virtual void Refresh(int Type, bool Force=false)=0
static constexpr const char * COMMUNITY_TYPE_NONE
Definition: serverbrowser.h:317
virtual unsigned CurrentCommunitiesHash() const =0
virtual int NumSortedServers() const =0
virtual ICommunityCache & CommunityCache()=0
static constexpr const char * COMMUNITY_ALL
Definition: serverbrowser.h:322
virtual IFilterList & CountriesFilter()=0
static constexpr const char * COMMUNITY_DDNET
Definition: serverbrowser.h:313
virtual IFilterList & CommunitiesFilter()=0
virtual int Players(const CServerInfo &Item) const =0
virtual const IFilterList & CommunitiesFilter() const =0
virtual int NumSortedPlayers() const =0
virtual const CServerInfo * SortedGet(int Index) const =0
virtual IFilterList & TypesFilter()=0
virtual const IFilterList & FavoriteCommunitiesFilter() const =0
static constexpr const char * COMMUNITY_COUNTRY_NONE
Definition: serverbrowser.h:316
virtual const ICommunityCache & CommunityCache() const =0
virtual int GetCurrentType()=0
virtual std::vector< const CCommunity * > CurrentCommunities() const =0
virtual CServerEntry * Find(const NETADDR &Addr)=0
virtual bool DDNetInfoAvailable() const =0
virtual const char * GetTutorialServer()=0
virtual int NumServers() const =0
virtual int LoadingProgression() const =0
static constexpr const char * SEARCH_EXCLUDE_TOKEN
Definition: serverbrowser.h:324
virtual const IFilterList & TypesFilter() const =0
virtual const std::vector< CCommunity > & Communities() const =0
virtual const IFilterList & CountriesFilter() const =0
static constexpr const char * COMMUNITY_NONE
Definition: serverbrowser.h:314
virtual IFilterList & FavoriteCommunitiesFilter()=0
@ MAX_SERVER_ADDRESSES
Definition: protocol.h:86
@ MAX_CLAN_LENGTH
Definition: protocol.h:98
@ SERVERINFO_MAX_CLIENTS
Definition: protocol.h:87
@ MAX_SKIN_LENGTH
Definition: protocol.h:99
@ MAX_NAME_LENGTH
Definition: protocol.h:97
int str_comp(const char *a, const char *b)
Definition: system.cpp:2974
int str_copy(char *dst, const char *src, int dst_size)
Definition: system.cpp:2761
#define MACRO_INTERFACE(Name)
Definition: kernel.h:25
@ MAX_MAP_LENGTH
Definition: map.h:12
static constexpr const char * DDNET_INFO_URL
Definition: serverbrowser.h:18
static constexpr const char * DDNET_INFO_FILE
Definition: serverbrowser.h:17
unsigned str_quickhash(const char *str)
Definition: system.cpp:4070
TRISTATE
Definition: types.h:7
@ NETADDR_MAXSTRSIZE
Definition: types.h:45