2022-08-14 15:43:49 +02:00
|
|
|
#ifndef LISTMANAGER_H
|
|
|
|
#define LISTMANAGER_H
|
|
|
|
#include <networksystem/serverlisting.h>
|
|
|
|
|
|
|
|
class CServerListManager
|
|
|
|
{
|
|
|
|
public:
|
2022-08-27 18:57:56 +02:00
|
|
|
CServerListManager();
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2024-03-10 01:57:04 +01:00
|
|
|
bool RefreshServerList(string& outMessage, size_t& numServers);
|
2022-08-27 18:57:56 +02:00
|
|
|
void ClearServerList(void);
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2023-10-15 10:47:19 +02:00
|
|
|
void ConnectToServer(const string& svIp, const int nPort, const string& svNetKey) const;
|
2022-08-27 18:57:56 +02:00
|
|
|
void ConnectToServer(const string& svServer, const string& svNetKey) const;
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2024-03-10 01:57:04 +01:00
|
|
|
// TODO: make private!
|
2022-08-14 15:43:49 +02:00
|
|
|
vector<NetGameServer_t> m_vServerList;
|
2024-03-10 01:57:04 +01:00
|
|
|
mutable CThreadFastMutex m_Mutex;
|
2022-08-14 15:43:49 +02:00
|
|
|
};
|
|
|
|
|
2024-01-21 21:29:23 +01:00
|
|
|
extern CServerListManager g_ServerListManager;
|
2022-08-14 15:43:49 +02:00
|
|
|
#endif // LISTMANAGER_H
|