mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
All interface versions from sdk 1.0 and up are now supported.
This commit is contained in:
parent
d076d12c6e
commit
d3e8a701dd
19 changed files with 1130 additions and 15 deletions
|
|
@ -24,6 +24,16 @@ Steam_Apps::Steam_Apps(Settings *settings, class SteamCallResults *callback_resu
|
|||
this->callback_results = callback_results;
|
||||
}
|
||||
|
||||
// returns 0 if the key does not exist
|
||||
// this may be true on first call, since the app data may not be cached locally yet
|
||||
// If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again
|
||||
int Steam_Apps::GetAppData( AppId_t nAppID, const char *pchKey, char *pchValue, int cchValueMax )
|
||||
{
|
||||
//TODO
|
||||
PRINT_DEBUG("GetAppData %u %s\n", nAppID, pchKey);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Steam_Apps::BIsSubscribed()
|
||||
{
|
||||
PRINT_DEBUG("BIsSubscribed\n");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "base.h"
|
||||
|
||||
class Steam_Apps :
|
||||
public ISteamApps001,
|
||||
public ISteamApps002,
|
||||
public ISteamApps003,
|
||||
public ISteamApps004,
|
||||
|
|
@ -15,6 +16,11 @@ public ISteamApps
|
|||
public:
|
||||
Steam_Apps(Settings *settings, class SteamCallResults *callback_results);
|
||||
|
||||
// returns 0 if the key does not exist
|
||||
// this may be true on first call, since the app data may not be cached locally yet
|
||||
// If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again
|
||||
int GetAppData( AppId_t nAppID, const char *pchKey, char *pchValue, int cchValueMax );
|
||||
|
||||
bool BIsSubscribed();
|
||||
bool BIsLowViolence();
|
||||
bool BIsCybercafe();
|
||||
|
|
|
|||
|
|
@ -295,7 +295,9 @@ ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSte
|
|||
PRINT_DEBUG("GetISteamGameServer %s\n", pchVersion);
|
||||
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return NULL;
|
||||
|
||||
if (strcmp(pchVersion, "SteamGameServer005") == 0) {
|
||||
if (strcmp(pchVersion, "SteamGameServer004") == 0) {
|
||||
return (ISteamGameServer *)(void *)(ISteamGameServer004 *)steam_gameserver;
|
||||
} else if (strcmp(pchVersion, "SteamGameServer005") == 0) {
|
||||
return (ISteamGameServer *)(void *)(ISteamGameServer005 *)steam_gameserver;
|
||||
} else if (strcmp(pchVersion, "SteamGameServer006") == 0) {
|
||||
return (ISteamGameServer *)(void *)(ISteamGameServer008 *)steam_gameserver;
|
||||
|
|
@ -343,7 +345,9 @@ ISteamFriends *Steam_Client::GetISteamFriends( HSteamUser hSteamUser, HSteamPipe
|
|||
PRINT_DEBUG("GetISteamFriends %s\n", pchVersion);
|
||||
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return NULL;
|
||||
|
||||
if (strcmp(pchVersion, "SteamFriends004") == 0) {
|
||||
if (strcmp(pchVersion, "SteamFriends003") == 0) {
|
||||
return (ISteamFriends *)(void *)(ISteamFriends003 *)steam_friends;
|
||||
} else if (strcmp(pchVersion, "SteamFriends004") == 0) {
|
||||
return (ISteamFriends *)(void *)(ISteamFriends004 *)steam_friends;
|
||||
} else if (strcmp(pchVersion, "SteamFriends005") == 0) {
|
||||
return (ISteamFriends *)(void *)(ISteamFriends005 *)steam_friends;
|
||||
|
|
@ -425,19 +429,15 @@ ISteamMatchmaking *Steam_Client::GetISteamMatchmaking( HSteamUser hSteamUser, HS
|
|||
|
||||
if (strcmp(pchVersion, "SteamMatchMaking001") == 0) {
|
||||
//TODO
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking006 *)steam_matchmaking;
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking002 *)steam_matchmaking;
|
||||
} else if (strcmp(pchVersion, "SteamMatchMaking002") == 0) {
|
||||
//TODO
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking006 *)steam_matchmaking;
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking002 *)steam_matchmaking;
|
||||
} else if (strcmp(pchVersion, "SteamMatchMaking003") == 0) {
|
||||
//TODO
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking006 *)steam_matchmaking;
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking003 *)steam_matchmaking;
|
||||
} else if (strcmp(pchVersion, "SteamMatchMaking004") == 0) {
|
||||
//TODO
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking006 *)steam_matchmaking;
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking004 *)steam_matchmaking;
|
||||
} else if (strcmp(pchVersion, "SteamMatchMaking005") == 0) {
|
||||
//TODO
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking006 *)steam_matchmaking;
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking005 *)steam_matchmaking;
|
||||
} else if (strcmp(pchVersion, "SteamMatchMaking006") == 0) {
|
||||
return (ISteamMatchmaking *)(void *)(ISteamMatchmaking006 *)steam_matchmaking;
|
||||
} else if (strcmp(pchVersion, "SteamMatchMaking007") == 0) {
|
||||
|
|
@ -459,6 +459,15 @@ ISteamMatchmakingServers *Steam_Client::GetISteamMatchmakingServers( HSteamUser
|
|||
{
|
||||
PRINT_DEBUG("GetISteamMatchmakingServers %s\n", pchVersion);
|
||||
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return NULL;
|
||||
|
||||
if (strcmp(pchVersion, "SteamMatchMakingServers001") == 0) {
|
||||
return (ISteamMatchmakingServers *)(void *)(ISteamMatchmakingServers001 *)steam_matchmaking_servers;
|
||||
} else if (strcmp(pchVersion, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION) == 0) {
|
||||
return steam_matchmaking_servers;
|
||||
} else {
|
||||
return steam_matchmaking_servers;
|
||||
}
|
||||
|
||||
return steam_matchmaking_servers;
|
||||
}
|
||||
|
||||
|
|
@ -676,7 +685,9 @@ ISteamApps *Steam_Client::GetISteamApps( HSteamUser hSteamUser, HSteamPipe hStea
|
|||
} else {
|
||||
steam_apps_temp = steam_apps;
|
||||
}
|
||||
if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION002") == 0) {
|
||||
if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION001") == 0) {
|
||||
return (ISteamApps *)(void *)(ISteamApps001 *)steam_apps_temp;
|
||||
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION002") == 0) {
|
||||
return (ISteamApps *)(void *)(ISteamApps002 *)steam_apps_temp;
|
||||
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION003") == 0) {
|
||||
return (ISteamApps *)(void *)(ISteamApps003 *)steam_apps_temp;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ struct Avatar_Numbers {
|
|||
};
|
||||
|
||||
class Steam_Friends :
|
||||
public ISteamFriends003,
|
||||
public ISteamFriends004,
|
||||
public ISteamFriends005,
|
||||
public ISteamFriends006,
|
||||
|
|
@ -629,6 +630,12 @@ int GetFriendAvatar( CSteamID steamIDFriend, int eAvatarSize )
|
|||
}
|
||||
}
|
||||
|
||||
int GetFriendAvatar(CSteamID steamIDFriend)
|
||||
{
|
||||
PRINT_DEBUG("Steam_Friends::GetFriendAvatar old\n");
|
||||
return GetFriendAvatar(steamIDFriend, k_EAvatarSize32x32);
|
||||
}
|
||||
|
||||
// requests information about a user - persona name & avatar
|
||||
// if bRequireNameOnly is set, then the avatar of a user isn't downloaded
|
||||
// - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ void Steam_GameServer::ClearAllKeyValues()
|
|||
/// Call this to add/update a key/value pair.
|
||||
void Steam_GameServer::SetKeyValue( const char *pKey, const char *pValue )
|
||||
{
|
||||
PRINT_DEBUG("SetKeyValue\n");
|
||||
PRINT_DEBUG("SetKeyValue %s %s\n", pKey, pValue);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
(*server_data.mutable_values())[std::string(pKey)] = std::string(pValue);
|
||||
}
|
||||
|
|
@ -347,6 +347,10 @@ bool Steam_GameServer::SendUserConnectAndAuthenticate( uint32 unIPClient, const
|
|||
return ticket_manager->SendUserConnectAndAuthenticate(unIPClient, pvAuthBlob, cubAuthBlobSize, pSteamIDUser);
|
||||
}
|
||||
|
||||
void Steam_GameServer::SendUserConnectAndAuthenticate( CSteamID steamIDUser, uint32 unIPClient, void *pvAuthBlob, uint32 cubAuthBlobSize )
|
||||
{
|
||||
SendUserConnectAndAuthenticate(unIPClient, pvAuthBlob, cubAuthBlobSize, NULL);
|
||||
}
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
|
|
@ -380,7 +384,7 @@ void Steam_GameServer::SendUserDisconnect( CSteamID steamIDUser )
|
|||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
bool Steam_GameServer::BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore )
|
||||
{
|
||||
PRINT_DEBUG("BUpdateUserData\n");
|
||||
PRINT_DEBUG("BUpdateUserData %llu %s %u\n", steamIDUser.ConvertToUint64(), pchPlayerName, uScore);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -420,6 +424,12 @@ bool Steam_GameServer::BSetServerType( uint32 unServerFlags, uint32 unGameIP, ui
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Steam_GameServer::BSetServerType( int32 nGameAppId, uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode )
|
||||
{
|
||||
return BSetServerType(unServerFlags, unGameIP, unGamePort, unSpectatorPort, usQueryPort, pchGameDir, pchVersion, bLANMode);
|
||||
}
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
void Steam_GameServer::UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ struct Gameserver_Outgoing_Packet {
|
|||
};
|
||||
|
||||
class Steam_GameServer :
|
||||
public ISteamGameServer004,
|
||||
public ISteamGameServer005,
|
||||
public ISteamGameServer008,
|
||||
public ISteamGameServer009,
|
||||
|
|
@ -189,6 +190,7 @@ public:
|
|||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser );
|
||||
void SendUserConnectAndAuthenticate( CSteamID steamIDUser, uint32 unIPClient, void *pvAuthBlob, uint32 cubAuthBlobSize );
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
|
|
@ -227,6 +229,9 @@ public:
|
|||
bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode );
|
||||
|
||||
bool BSetServerType( int32 nGameAppId, uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode );
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@ struct Chat_Entry {
|
|||
|
||||
|
||||
class Steam_Matchmaking :
|
||||
public ISteamMatchmaking002,
|
||||
public ISteamMatchmaking003,
|
||||
public ISteamMatchmaking004,
|
||||
public ISteamMatchmaking005,
|
||||
public ISteamMatchmaking006,
|
||||
public ISteamMatchmaking007,
|
||||
public ISteamMatchmaking008,
|
||||
|
|
@ -422,6 +426,11 @@ SteamAPICall_t RequestLobbyList()
|
|||
return search_call_api_id;
|
||||
}
|
||||
|
||||
void RequestLobbyList_OLD()
|
||||
{
|
||||
RequestLobbyList();
|
||||
}
|
||||
|
||||
// filters for lobbies
|
||||
// this needs to be called before RequestLobbyList() to take effect
|
||||
// these are cleared on each call to RequestLobbyList()
|
||||
|
|
@ -509,6 +518,11 @@ void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueTo
|
|||
AddRequestLobbyListNumericalFilter(pchKeyToMatch, nValueToMatch, (ELobbyComparison) nComparisonType );
|
||||
}
|
||||
|
||||
void AddRequestLobbyListSlotsAvailableFilter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
|
|
@ -623,6 +637,16 @@ SteamAPICall_t CreateLobby( ELobbyType eLobbyType )
|
|||
return CreateLobby(eLobbyType, 0);
|
||||
}
|
||||
|
||||
void CreateLobby_OLD( ELobbyType eLobbyType )
|
||||
{
|
||||
CreateLobby(eLobbyType);
|
||||
}
|
||||
|
||||
void CreateLobby( bool bPrivate )
|
||||
{
|
||||
CreateLobby(bPrivate ? k_ELobbyTypePrivate : k_ELobbyTypePublic);
|
||||
}
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful
|
||||
|
|
@ -649,6 +673,11 @@ SteamAPICall_t JoinLobby( CSteamID steamIDLobby )
|
|||
return pending_join.api_id;
|
||||
}
|
||||
|
||||
void JoinLobby_OLD( CSteamID steamIDLobby )
|
||||
{
|
||||
JoinLobby(steamIDLobby);
|
||||
}
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
void LeaveLobby( CSteamID steamIDLobby )
|
||||
|
|
@ -1071,6 +1100,10 @@ int GetLobbyMemberLimit( CSteamID steamIDLobby )
|
|||
return limit;
|
||||
}
|
||||
|
||||
void SetLobbyVoiceEnabled( CSteamID steamIDLobby, bool bVoiceEnabled )
|
||||
{
|
||||
PRINT_DEBUG("SetLobbyVoiceEnabled\n");
|
||||
}
|
||||
|
||||
// updates which type of lobby it is
|
||||
// only lobbies that are k_ELobbyTypePublic or k_ELobbyTypeInvisible, and are set to joinable, will be returned by RequestLobbyList() calls
|
||||
|
|
@ -1131,6 +1164,23 @@ CSteamID GetLobbyOwner( CSteamID steamIDLobby )
|
|||
return (uint64)lobby->owner();
|
||||
}
|
||||
|
||||
// asks the Steam servers for a list of lobbies that friends are in
|
||||
// returns results by posting one RequestFriendsLobbiesResponse_t callback per friend/lobby pair
|
||||
// if no friends are in lobbies, RequestFriendsLobbiesResponse_t will be posted but with 0 results
|
||||
// filters don't apply to lobbies (currently)
|
||||
bool RequestFriendsLobbies()
|
||||
{
|
||||
PRINT_DEBUG("RequestFriendsLobbies\n");
|
||||
RequestFriendsLobbiesResponse_t data = {};
|
||||
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||
return true;
|
||||
}
|
||||
|
||||
float GetLobbyDistance( CSteamID steamIDLobby )
|
||||
{
|
||||
PRINT_DEBUG("GetLobbyDistance %llu\n", steamIDLobby.ConvertToUint64());
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
// changes who the lobby owner is
|
||||
// you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ HServerListRequest Steam_Matchmaking_Servers::RequestLANServerList( AppId_t iApp
|
|||
struct Steam_Matchmaking_Request request;
|
||||
request.appid = iApp;
|
||||
request.callbacks = pRequestServersResponse;
|
||||
request.old_callbacks = NULL;
|
||||
request.cancelled = false;
|
||||
request.completed = false;
|
||||
requests.push_back(request);
|
||||
|
|
@ -90,6 +91,71 @@ HServerListRequest Steam_Matchmaking_Servers::RequestSpectatorServerList( AppId_
|
|||
return RequestLANServerList(iApp, pRequestServersResponse);
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestOldServerList(AppId_t iApp, ISteamMatchmakingServerListResponse001 *pRequestServersResponse, EMatchMakingType type)
|
||||
{
|
||||
PRINT_DEBUG("RequestOldServerList %u\n", iApp);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
auto g = std::begin(requests);
|
||||
while (g != std::end(requests)) {
|
||||
if (g->id == ((void *)type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
++g;
|
||||
}
|
||||
|
||||
struct Steam_Matchmaking_Request request;
|
||||
request.appid = iApp;
|
||||
request.callbacks = NULL;
|
||||
request.old_callbacks = pRequestServersResponse;
|
||||
request.cancelled = false;
|
||||
request.completed = false;
|
||||
requests.push_back(request);
|
||||
requests[requests.size() - 1].id = (void *)type;
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse )
|
||||
{
|
||||
PRINT_DEBUG("%s old\n", __FUNCTION__);
|
||||
//TODO
|
||||
RequestOldServerList(iApp, pRequestServersResponse, eInternetServer);
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse001 *pRequestServersResponse )
|
||||
{
|
||||
PRINT_DEBUG("%s old\n", __FUNCTION__);
|
||||
//TODO
|
||||
RequestOldServerList(iApp, pRequestServersResponse, eLANServer);
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse )
|
||||
{
|
||||
PRINT_DEBUG("%s old\n", __FUNCTION__);
|
||||
//TODO
|
||||
RequestOldServerList(iApp, pRequestServersResponse, eFriendsServer);
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse )
|
||||
{
|
||||
PRINT_DEBUG("%s old\n", __FUNCTION__);
|
||||
//TODO
|
||||
RequestOldServerList(iApp, pRequestServersResponse, eFavoritesServer);
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse )
|
||||
{
|
||||
PRINT_DEBUG("%s old\n", __FUNCTION__);
|
||||
//TODO
|
||||
RequestOldServerList(iApp, pRequestServersResponse, eHistoryServer);
|
||||
}
|
||||
|
||||
void Steam_Matchmaking_Servers::RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse )
|
||||
{
|
||||
PRINT_DEBUG("%s old\n", __FUNCTION__);
|
||||
//TODO
|
||||
RequestOldServerList(iApp, pRequestServersResponse, eSpectatorServer);
|
||||
}
|
||||
|
||||
|
||||
// Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress.
|
||||
// RefreshComplete callback is not posted when request is released.
|
||||
|
|
@ -410,6 +476,7 @@ void Steam_Matchmaking_Servers::RunCallbacks()
|
|||
|
||||
r.gameservers_filtered.clear();
|
||||
for (auto &g : gameservers) {
|
||||
PRINT_DEBUG("game_server_check %u %u\n", g.server.appid(), r.appid);
|
||||
if (g.server.appid() == r.appid) {
|
||||
PRINT_DEBUG("REQUESTS server found\n");
|
||||
r.gameservers_filtered.push_back(g);
|
||||
|
|
@ -440,6 +507,20 @@ void Steam_Matchmaking_Servers::RunCallbacks()
|
|||
r.callbacks->RefreshComplete(r.id, eNoServersListedOnMasterServer);
|
||||
}
|
||||
}
|
||||
|
||||
if (r.old_callbacks) {
|
||||
for (auto &g : r.gameservers_filtered) {
|
||||
PRINT_DEBUG("old REQUESTS server responded cb %p\n", r.id);
|
||||
r.old_callbacks->ServerResponded(i);
|
||||
++i;
|
||||
}
|
||||
|
||||
if (i) {
|
||||
r.old_callbacks->RefreshComplete(eServerResponded);
|
||||
} else {
|
||||
r.old_callbacks->RefreshComplete(eNoServersListedOnMasterServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector <struct Steam_Matchmaking_Servers_Direct_IP_Request> direct_ip_requests_temp;
|
||||
|
|
|
|||
|
|
@ -40,11 +40,13 @@ struct Steam_Matchmaking_Request {
|
|||
AppId_t appid;
|
||||
HServerListRequest id;
|
||||
ISteamMatchmakingServerListResponse *callbacks;
|
||||
ISteamMatchmakingServerListResponse001 *old_callbacks;
|
||||
bool completed, cancelled, released;
|
||||
std::vector <struct Steam_Matchmaking_Servers_Gameserver> gameservers_filtered;
|
||||
};
|
||||
|
||||
class Steam_Matchmaking_Servers : public ISteamMatchmakingServers
|
||||
class Steam_Matchmaking_Servers : public ISteamMatchmakingServers,
|
||||
public ISteamMatchmakingServers001
|
||||
{
|
||||
class Settings *settings;
|
||||
class Networking *network;
|
||||
|
|
@ -52,6 +54,7 @@ class Steam_Matchmaking_Servers : public ISteamMatchmakingServers
|
|||
std::vector <struct Steam_Matchmaking_Servers_Gameserver> gameservers;
|
||||
std::vector <struct Steam_Matchmaking_Request> requests;
|
||||
std::vector <struct Steam_Matchmaking_Servers_Direct_IP_Request> direct_ip_requests;
|
||||
void RequestOldServerList(AppId_t iApp, ISteamMatchmakingServerListResponse001 *pRequestServersResponse, EMatchMakingType type);
|
||||
public:
|
||||
Steam_Matchmaking_Servers(class Settings *settings, class Networking *network);
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
|
|
@ -64,6 +67,13 @@ public:
|
|||
HServerListRequest RequestHistoryServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse );
|
||||
HServerListRequest RequestSpectatorServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse );
|
||||
|
||||
void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse );
|
||||
void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse001 *pRequestServersResponse );
|
||||
void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse );
|
||||
void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse );
|
||||
void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse );
|
||||
void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse );
|
||||
|
||||
// Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress.
|
||||
// RefreshComplete callback is not posted when request is released.
|
||||
void ReleaseRequest( HServerListRequest hServerListRequest );
|
||||
|
|
@ -167,6 +177,28 @@ public:
|
|||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
void RefreshServer( HServerListRequest hRequest, int iServer );
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) { return GetServerDetails((HServerListRequest) eType , iServer ); }
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
void CancelQuery( EMatchMakingType eType ) { return CancelQuery((HServerListRequest) eType); }
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
void RefreshQuery( EMatchMakingType eType ) { return RefreshQuery((HServerListRequest) eType); }
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
bool IsRefreshing( EMatchMakingType eType ) { return IsRefreshing((HServerListRequest) eType); }
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
int GetServerCount( EMatchMakingType eType ) { return GetServerCount((HServerListRequest) eType); }
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
void RefreshServer( EMatchMakingType eType, int iServer ) { return RefreshServer((HServerListRequest) eType, iServer); }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue