2022-08-14 15:43:49 +02:00
|
|
|
#ifndef LISTMANAGER_H
|
|
|
|
#define LISTMANAGER_H
|
|
|
|
#include <networksystem/serverlisting.h>
|
|
|
|
|
|
|
|
enum EHostStatus_t
|
|
|
|
{
|
2022-08-27 18:57:56 +02:00
|
|
|
NOT_HOSTING,
|
|
|
|
HOSTING
|
2022-08-14 15:43:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum EServerVisibility_t
|
|
|
|
{
|
2022-08-27 18:57:56 +02:00
|
|
|
OFFLINE,
|
|
|
|
HIDDEN,
|
|
|
|
PUBLIC
|
2022-08-14 15:43:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CServerListManager
|
|
|
|
{
|
|
|
|
public:
|
2022-08-27 18:57:56 +02:00
|
|
|
CServerListManager();
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2022-08-27 18:57:56 +02:00
|
|
|
size_t RefreshServerList(string& svMessage);
|
|
|
|
void ClearServerList(void);
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2022-08-27 18:57:56 +02:00
|
|
|
void LaunchServer(void) const;
|
|
|
|
void ConnectToServer(const string& svIp, const string& svPort, const string& svNetKey) const;
|
|
|
|
void ConnectToServer(const string& svServer, const string& svNetKey) const;
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2022-08-27 18:57:56 +02:00
|
|
|
void ProcessCommand(const char* pszCommand) const;
|
2022-08-14 15:43:49 +02:00
|
|
|
|
2022-08-27 18:57:56 +02:00
|
|
|
EHostStatus_t m_HostingStatus;
|
2022-08-14 15:43:49 +02:00
|
|
|
EServerVisibility_t m_ServerVisibility;
|
|
|
|
|
|
|
|
NetGameServer_t m_Server;
|
|
|
|
vector<NetGameServer_t> m_vServerList;
|
2022-08-27 18:57:56 +02:00
|
|
|
|
|
|
|
mutable std::mutex m_Mutex;
|
2022-08-14 15:43:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern CServerListManager* g_pServerListManager;
|
|
|
|
#endif // LISTMANAGER_H
|