46 lines
922 B
C++
46 lines
922 B
C++
#ifndef _HEADER_MATCHMAKING
|
|
#define _HEADER_MATCHMAKING
|
|
|
|
#include <string>
|
|
using std::wstring;
|
|
|
|
typedef unsigned long long NetID;
|
|
typedef signed int ChannelID;
|
|
|
|
enum class ConnectionState
|
|
{
|
|
Invalid = -1,
|
|
Disconnected = 0,
|
|
Connecting = 1,
|
|
Connected = 2,
|
|
};
|
|
|
|
class MatchMakingImpl;
|
|
class IMatchMakingInterface
|
|
{
|
|
protected:
|
|
IMatchMakingInterface(NetID netId);
|
|
|
|
public:
|
|
virtual ~IMatchMakingInterface();
|
|
|
|
void Tick();
|
|
|
|
ConnectionState GetState() const;
|
|
bool IsConnected() const;
|
|
|
|
bool HostMatch(ChannelID channel);
|
|
bool DestroyMatch();
|
|
|
|
virtual void OnConnect() = 0;
|
|
virtual void OnDisconnect() = 0;
|
|
virtual void OnForceJoinSession(NetID netId, ChannelID channelID) = 0;
|
|
|
|
private:
|
|
MatchMakingImpl* m_impl;
|
|
|
|
IMatchMakingInterface(const IMatchMakingInterface& other) = delete;
|
|
IMatchMakingInterface& operator=(const IMatchMakingInterface& other) = delete;
|
|
};
|
|
|
|
#endif |