2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2011-03-27 16:00:54 +00:00
|
|
|
#ifndef ENGINE_CLIENT_SERVERBROWSER_H
|
|
|
|
#define ENGINE_CLIENT_SERVERBROWSER_H
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-16 17:50:46 +00:00
|
|
|
#include <base/system.h>
|
|
|
|
|
2021-04-21 14:54:42 +00:00
|
|
|
#include <engine/console.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <engine/serverbrowser.h>
|
2017-09-03 15:36:51 +00:00
|
|
|
#include <engine/shared/memheap.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-23 18:16:18 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2023-09-30 10:24:12 +00:00
|
|
|
typedef struct _json_value json_value;
|
2022-06-16 17:50:46 +00:00
|
|
|
class CNetClient;
|
|
|
|
class IConfigManager;
|
2022-05-23 18:16:18 +00:00
|
|
|
class IConsole;
|
|
|
|
class IEngine;
|
|
|
|
class IFavorites;
|
|
|
|
class IFriends;
|
2018-07-11 20:46:04 +00:00
|
|
|
class IServerBrowserHttp;
|
2021-04-17 14:05:24 +00:00
|
|
|
class IServerBrowserPingCache;
|
2022-05-23 18:16:18 +00:00
|
|
|
class IStorage;
|
2018-07-11 20:46:04 +00:00
|
|
|
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
class CCommunityServer
|
|
|
|
{
|
|
|
|
char m_aCommunityId[CServerInfo::MAX_COMMUNITY_ID_LENGTH];
|
|
|
|
char m_aCountryName[CServerInfo::MAX_COMMUNITY_COUNTRY_LENGTH];
|
|
|
|
char m_aTypeName[CServerInfo::MAX_COMMUNITY_TYPE_LENGTH];
|
|
|
|
|
|
|
|
public:
|
|
|
|
CCommunityServer(const char *pCommunityId, const char *pCountryName, const char *pTypeName)
|
|
|
|
{
|
|
|
|
str_copy(m_aCommunityId, pCommunityId);
|
|
|
|
str_copy(m_aCountryName, pCountryName);
|
|
|
|
str_copy(m_aTypeName, pTypeName);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *CommunityId() const { return m_aCommunityId; }
|
|
|
|
const char *CountryName() const { return m_aCountryName; }
|
|
|
|
const char *TypeName() const { return m_aTypeName; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class CFilterList : public IFilterList
|
|
|
|
{
|
|
|
|
char *m_pFilter;
|
|
|
|
size_t m_FilterSize;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CFilterList(char *pFilter, size_t FilterSize) :
|
|
|
|
m_pFilter(pFilter), m_FilterSize(FilterSize)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Add(const char *pElement) override;
|
|
|
|
void Remove(const char *pElement) override;
|
|
|
|
void Clear() override;
|
|
|
|
bool Filtered(const char *pElement) const override;
|
|
|
|
bool Empty() const override;
|
|
|
|
void Clean(const std::vector<const char *> &vpAllowedElements);
|
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CServerBrowser : public IServerBrowser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
class CServerEntry
|
|
|
|
{
|
|
|
|
public:
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_RequestTime;
|
2021-04-21 14:54:42 +00:00
|
|
|
bool m_RequestIgnoreInfo;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_GotInfo;
|
|
|
|
CServerInfo m_Info;
|
|
|
|
|
|
|
|
CServerEntry *m_pPrevReq; // request list
|
|
|
|
CServerEntry *m_pNextReq;
|
|
|
|
};
|
|
|
|
|
|
|
|
CServerBrowser();
|
2017-09-03 15:36:51 +00:00
|
|
|
virtual ~CServerBrowser();
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// interface functions
|
2022-05-17 20:13:44 +00:00
|
|
|
void Refresh(int Type) override;
|
|
|
|
bool IsRefreshing() const override;
|
|
|
|
bool IsGettingServerlist() const override;
|
|
|
|
int LoadingProgression() const override;
|
2022-12-05 22:00:35 +00:00
|
|
|
void RequestResort() { m_NeedResort = true; }
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
int NumServers() const override { return m_NumServers; }
|
2023-09-30 10:24:12 +00:00
|
|
|
int Players(const CServerInfo &Item) const override;
|
|
|
|
int Max(const CServerInfo &Item) const override;
|
2022-05-17 20:13:44 +00:00
|
|
|
int NumSortedServers() const override { return m_NumSortedServers; }
|
2023-10-01 18:17:55 +00:00
|
|
|
int NumSortedPlayers() const override { return m_NumSortedPlayers; }
|
2022-05-17 20:13:44 +00:00
|
|
|
const CServerInfo *SortedGet(int Index) const override;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2017-09-03 15:36:51 +00:00
|
|
|
const json_value *LoadDDNetInfo();
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
void LoadDDNetInfoJson();
|
|
|
|
void LoadDDNetLocation();
|
|
|
|
void LoadDDNetServers();
|
2023-09-30 10:48:02 +00:00
|
|
|
void UpdateServerFilteredPlayers(CServerInfo *pInfo) const;
|
2023-09-30 10:57:10 +00:00
|
|
|
void UpdateServerFriends(CServerInfo *pInfo) const;
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
void UpdateServerCommunity(CServerInfo *pInfo) const;
|
|
|
|
void UpdateServerRank(CServerInfo *pInfo) const;
|
|
|
|
const char *GetTutorialServer() override;
|
2014-12-14 15:45:18 +00:00
|
|
|
|
2023-09-17 11:31:41 +00:00
|
|
|
const std::vector<CCommunity> &Communities() const override;
|
|
|
|
const CCommunity *Community(const char *pCommunityId) const override;
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
std::vector<const CCommunity *> SelectedCommunities() const override;
|
|
|
|
int64_t DDNetInfoUpdateTime() const override { return m_DDNetInfoUpdateTime; }
|
|
|
|
|
|
|
|
CFilterList &CommunitiesFilter() override { return m_CommunitiesFilter; }
|
|
|
|
CFilterList &CountriesFilter() override { return m_CountriesFilter; }
|
|
|
|
CFilterList &TypesFilter() override { return m_TypesFilter; }
|
|
|
|
const CFilterList &CommunitiesFilter() const override { return m_CommunitiesFilter; }
|
|
|
|
const CFilterList &CountriesFilter() const override { return m_CountriesFilter; }
|
|
|
|
const CFilterList &TypesFilter() const override { return m_TypesFilter; }
|
|
|
|
void CleanFilters() override;
|
2014-12-14 15:45:18 +00:00
|
|
|
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
void CommunitiesFilterClean();
|
|
|
|
void CountriesFilterClean();
|
|
|
|
void TypesFilterClean();
|
2014-12-14 15:45:18 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
2022-12-05 22:00:35 +00:00
|
|
|
void Update();
|
2022-05-23 18:16:18 +00:00
|
|
|
void OnServerInfoUpdate(const NETADDR &Addr, int Token, const CServerInfo *pInfo);
|
|
|
|
void SetHttpInfo(const CServerInfo *pInfo);
|
2021-06-09 15:29:06 +00:00
|
|
|
void RequestCurrentServer(const NETADDR &Addr) const;
|
|
|
|
void RequestCurrentServerWithRandomToken(const NETADDR &Addr, int *pBasicToken, int *pToken) const;
|
2021-04-23 21:12:16 +00:00
|
|
|
void SetCurrentServerPing(const NETADDR &Addr, int Ping);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
void SetBaseInfo(class CNetClient *pClient, const char *pNetVersion);
|
2021-06-02 22:27:00 +00:00
|
|
|
void OnInit();
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2014-01-14 20:40:55 +00:00
|
|
|
void QueueRequest(CServerEntry *pEntry);
|
2014-01-08 05:15:56 +00:00
|
|
|
CServerEntry *Find(const NETADDR &Addr);
|
2022-05-17 20:13:44 +00:00
|
|
|
int GetCurrentType() override { return m_ServerlistType; }
|
2022-10-09 11:43:10 +00:00
|
|
|
bool IsRegistered(const NETADDR &Addr);
|
2014-01-08 05:15:56 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
private:
|
2022-05-23 18:16:18 +00:00
|
|
|
CNetClient *m_pNetClient = nullptr;
|
2023-09-30 10:26:21 +00:00
|
|
|
IConfigManager *m_pConfigManager = nullptr;
|
2022-05-23 18:16:18 +00:00
|
|
|
IConsole *m_pConsole = nullptr;
|
|
|
|
IEngine *m_pEngine = nullptr;
|
|
|
|
IFriends *m_pFriends = nullptr;
|
|
|
|
IFavorites *m_pFavorites = nullptr;
|
|
|
|
IStorage *m_pStorage = nullptr;
|
2010-05-29 07:25:38 +00:00
|
|
|
char m_aNetVersion[128];
|
|
|
|
|
2018-07-11 20:46:04 +00:00
|
|
|
bool m_RefreshingHttp = false;
|
|
|
|
IServerBrowserHttp *m_pHttp = nullptr;
|
2021-04-17 14:05:24 +00:00
|
|
|
IServerBrowserPingCache *m_pPingCache = nullptr;
|
2021-05-13 00:46:28 +00:00
|
|
|
const char *m_pHttpPrevBestUrl = nullptr;
|
2018-07-11 20:46:04 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CHeap m_ServerlistHeap;
|
|
|
|
CServerEntry **m_ppServerlist;
|
|
|
|
int *m_pSortedServerlist;
|
2022-05-23 18:16:18 +00:00
|
|
|
std::unordered_map<NETADDR, int> m_ByAddr;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2023-09-17 11:31:41 +00:00
|
|
|
std::vector<CCommunity> m_vCommunities;
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
std::unordered_map<NETADDR, CCommunityServer> m_CommunityServersByAddr;
|
|
|
|
|
2021-04-24 16:06:42 +00:00
|
|
|
int m_OwnLocation = CServerInfo::LOC_UNKNOWN;
|
2017-09-03 15:36:51 +00:00
|
|
|
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
CFilterList m_CommunitiesFilter;
|
|
|
|
CFilterList m_CountriesFilter;
|
|
|
|
CFilterList m_TypesFilter;
|
|
|
|
|
2017-09-03 15:36:51 +00:00
|
|
|
json_value *m_pDDNetInfo;
|
Add community server filter and icons, remove DDNet and KoG tabs
Remove the DDNet and KoG tabs and replace them with a community filter, which works like the country and type filters. Community information (ID, name, icon SHA256, countries, types, servers, ranked maps) is loaded dynamically from the DDNet info json.
The official checkmark icon is replaced with community icons. The icons are downloaded to the `communityicons` folder in the config directory from a URL specified in the DDNet info json. The icons are only re-downloaded when their SHA256 has changed.
Per default, the Internet tab with all communities is selected. When starting the client for the first time, only the DDNet community is selected. The community, country and type filters can also be used on the Favorites tab now. The LAN tab remains unchanged.
The country and type filters are refactored. Previously, using these filters changed the total number of servers and players that were displayed, as the filter was implemented as a separate step. Now the community, country and type filters work like the other browser filters. This also has the benefit that the server list and DDNet info json are not reloaded each time these filters are changed, as updating the local filtering/sorting is enough now.
The check for finished maps is made more efficient by using an `std::unordered_set` instead of linear search.
Closes #5654.
2023-08-28 20:08:51 +00:00
|
|
|
int64_t m_DDNetInfoUpdateTime;
|
2014-12-14 15:45:18 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CServerEntry *m_pFirstReqServer; // request list
|
|
|
|
CServerEntry *m_pLastReqServer;
|
|
|
|
int m_NumRequests;
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2022-12-05 22:00:35 +00:00
|
|
|
bool m_NeedResort;
|
2023-09-30 10:20:04 +00:00
|
|
|
int m_Sorthash;
|
2022-12-05 22:00:35 +00:00
|
|
|
|
2021-07-08 17:18:01 +00:00
|
|
|
// used instead of g_Config.br_max_requests to get more servers
|
2013-12-31 02:18:37 +00:00
|
|
|
int m_CurrentMaxRequests;
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_NumSortedServers;
|
|
|
|
int m_NumSortedServersCapacity;
|
2023-10-01 18:17:55 +00:00
|
|
|
int m_NumSortedPlayers;
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_NumServers;
|
|
|
|
int m_NumServerCapacity;
|
|
|
|
|
|
|
|
int m_ServerlistType;
|
2021-06-23 05:05:49 +00:00
|
|
|
int64_t m_BroadcastTime;
|
2017-10-14 19:58:23 +00:00
|
|
|
unsigned char m_aTokenSeed[16];
|
|
|
|
|
|
|
|
int GenerateToken(const NETADDR &Addr) const;
|
|
|
|
static int GetBasicToken(int Token);
|
|
|
|
static int GetExtraToken(int Token);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2017-10-14 19:58:23 +00:00
|
|
|
// sorting criteria
|
2010-05-29 07:25:38 +00:00
|
|
|
bool SortCompareName(int Index1, int Index2) const;
|
|
|
|
bool SortCompareMap(int Index1, int Index2) const;
|
|
|
|
bool SortComparePing(int Index1, int Index2) const;
|
|
|
|
bool SortCompareGametype(int Index1, int Index2) const;
|
|
|
|
bool SortCompareNumPlayers(int Index1, int Index2) const;
|
2011-03-20 14:33:49 +00:00
|
|
|
bool SortCompareNumClients(int Index1, int Index2) const;
|
2020-08-24 21:23:37 +00:00
|
|
|
bool SortCompareNumPlayersAndPing(int Index1, int Index2) const;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
void Filter();
|
|
|
|
void Sort();
|
|
|
|
int SortHash() const;
|
|
|
|
|
2021-07-08 17:18:01 +00:00
|
|
|
void CleanUp();
|
|
|
|
|
2018-07-11 20:46:04 +00:00
|
|
|
void UpdateFromHttp();
|
2022-05-23 18:16:18 +00:00
|
|
|
CServerEntry *Add(const NETADDR *pAddrs, int NumAddrs);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void RemoveRequest(CServerEntry *pEntry);
|
|
|
|
|
2021-06-09 15:29:06 +00:00
|
|
|
void RequestImpl(const NETADDR &Addr, CServerEntry *pEntry, int *pBasicToken, int *pToken, bool RandomToken) const;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2021-04-21 14:54:42 +00:00
|
|
|
void RegisterCommands();
|
|
|
|
static void Con_LeakIpAddress(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
|
2023-10-06 11:02:56 +00:00
|
|
|
void SetInfo(CServerEntry *pEntry, const CServerInfo &Info) const;
|
2022-01-22 12:44:22 +00:00
|
|
|
void SetLatency(NETADDR Addr, int Latency);
|
Add icon URL, remove `servers-key`/`ranks-key` from community JSON
Previously:
```json
{
"ddnet": {
"name": "DDraceNetwork",
"servers-key": "servers",
"ranks-key": "maps",
"icon-sha256": "162313eeb954e34495ad03066fee1418ed3c963e76cc83dff993e1c7856c742b"
}
}
```
Now:
```json
[
{
"id": "ddnet",
"name": "DDraceNetwork",
"icon": {
"sha256": "162313eeb954e34495ad03066fee1418ed3c963e76cc83dff993e1c7856c742b",
"url": "https://info.ddnet.org/icons/ddnet.png"
},
"ranks": [
…
],
"servers": {
…
}
}
]
```
Special case `ddnet` to look for the `servers`, `maps` in the top-level
and `kog` to look for `servers-kog` in the top-level.
2023-11-18 20:52:51 +00:00
|
|
|
|
|
|
|
static bool ParseCommunityFinishes(CCommunity *pCommunity, const json_value &Finishes);
|
|
|
|
static bool ParseCommunityServers(CCommunity *pCommunity, const json_value &Servers);
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|