Add Matchmaking Interface to GameServer.
This commit is contained in:
@@ -55,6 +55,7 @@ void SteamWorksGameServer::Reset(void)
|
|||||||
this->m_pNetworking = NULL;
|
this->m_pNetworking = NULL;
|
||||||
this->m_pStats = NULL;
|
this->m_pStats = NULL;
|
||||||
this->m_pHTTP = NULL;
|
this->m_pHTTP = NULL;
|
||||||
|
this->m_pMatchmaking = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ISteamClient *SteamWorksGameServer::GetSteamClient(void)
|
ISteamClient *SteamWorksGameServer::GetSteamClient(void)
|
||||||
@@ -140,6 +141,22 @@ ISteamHTTP *SteamWorksGameServer::GetHTTP(void)
|
|||||||
return this->m_pHTTP;
|
return this->m_pHTTP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ISteamMatchmaking *SteamWorksGameServer::GetMatchmaking(void)
|
||||||
|
{
|
||||||
|
if (this->m_pMatchmaking == NULL && this->GetSteamClient() != NULL)
|
||||||
|
{
|
||||||
|
HSteamUser hSteamUser;
|
||||||
|
HSteamPipe hSteamPipe;
|
||||||
|
GetUserAndPipe(hSteamUser, hSteamPipe);
|
||||||
|
|
||||||
|
const char *pVersion = STEAMMATCHMAKING_INTERFACE_VERSION;
|
||||||
|
GetGameSpecificConfigInterface("SteamMatchmakingVersion", pVersion);
|
||||||
|
this->m_pMatchmaking = this->GetSteamClient()->GetISteamMatchmaking(hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this->m_pMatchmaking;
|
||||||
|
}
|
||||||
|
|
||||||
void SteamWorksGameServer::GetUserAndPipe(HSteamUser &hSteamUser, HSteamPipe &hSteamPipe)
|
void SteamWorksGameServer::GetUserAndPipe(HSteamUser &hSteamUser, HSteamPipe &hSteamPipe)
|
||||||
{
|
{
|
||||||
hSteamUser = SteamGameServer_GetHSteamUser();
|
hSteamUser = SteamGameServer_GetHSteamUser();
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class SteamWorksGameServer
|
|||||||
ISteamNetworking *GetNetworking(void);
|
ISteamNetworking *GetNetworking(void);
|
||||||
ISteamGameServerStats *GetServerStats(void);
|
ISteamGameServerStats *GetServerStats(void);
|
||||||
ISteamHTTP *GetHTTP(void);
|
ISteamHTTP *GetHTTP(void);
|
||||||
|
ISteamMatchmaking *GetMatchmaking(void);
|
||||||
public:
|
public:
|
||||||
void Reset(void);
|
void Reset(void);
|
||||||
private:
|
private:
|
||||||
@@ -45,6 +46,7 @@ class SteamWorksGameServer
|
|||||||
ISteamNetworking *m_pNetworking;
|
ISteamNetworking *m_pNetworking;
|
||||||
ISteamGameServerStats *m_pStats;
|
ISteamGameServerStats *m_pStats;
|
||||||
ISteamHTTP *m_pHTTP;
|
ISteamHTTP *m_pHTTP;
|
||||||
|
ISteamMatchmaking *m_pMatchmaking;
|
||||||
bool loaded;
|
bool loaded;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user