forked from openairlinetycoon/ATDMasterServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ServerBrowser.h
35 lines (27 loc) · 879 Bytes
/
ServerBrowser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
struct ATDRoomsCallbacks;
namespace RakNet {
class RakPeerInterface;
class CloudServer;
}
class ServerBrowser {
private:
RakNet::RakPeerInterface* m_rakPeer = nullptr;
RakNet::RoomsPlugin* m_server = nullptr;
ATDRoomsCallbacks* m_sampleCallbacks;
protected:
friend ATDRoomsCallbacks;
unsigned int m_roomCreations = 0;
unsigned int m_userLogins = 0;
public:
ServerBrowser(RakNet::RakPeerInterface* rakPeer);
~ServerBrowser();
void StartServer();
void ProcessMessages();
[[nodiscard]] DataStructures::List<RakNet::Room*> GetRooms() const;
[[nodiscard]] DataStructures::List<RakNet::RoomMember*> GetUsers() const;
[[nodiscard]] unsigned int GetRoomCreationCount() const;
[[nodiscard]] unsigned int GetUserLoginCount() const;
private:
void LoginToServer(RakNet::Packet* p);
};