diff --git a/dll/steam_apps.cpp b/dll/steam_apps.cpp index 2b154fd..6bd52d5 100644 --- a/dll/steam_apps.cpp +++ b/dll/steam_apps.cpp @@ -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"); diff --git a/dll/steam_apps.h b/dll/steam_apps.h index 2c23c68..b46c22a 100644 --- a/dll/steam_apps.h +++ b/dll/steam_apps.h @@ -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(); diff --git a/dll/steam_client.cpp b/dll/steam_client.cpp index 3dd0af5..b1ee2fe 100644 --- a/dll/steam_client.cpp +++ b/dll/steam_client.cpp @@ -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; diff --git a/dll/steam_friends.h b/dll/steam_friends.h index 8d6bc17..576ebca 100644 --- a/dll/steam_friends.h +++ b/dll/steam_friends.h @@ -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 diff --git a/dll/steam_gameserver.cpp b/dll/steam_gameserver.cpp index 54b80b1..bf16d2f 100644 --- a/dll/steam_gameserver.cpp +++ b/dll/steam_gameserver.cpp @@ -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 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, diff --git a/dll/steam_gameserver.h b/dll/steam_gameserver.h index 7268d30..275c716 100644 --- a/dll/steam_gameserver.h +++ b/dll/steam_gameserver.h @@ -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, diff --git a/dll/steam_matchmaking.h b/dll/steam_matchmaking.h index 9e0034c..66a268c 100644 --- a/dll/steam_matchmaking.h +++ b/dll/steam_matchmaking.h @@ -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 diff --git a/dll/steam_matchmaking_servers.cpp b/dll/steam_matchmaking_servers.cpp index 70351b1..23441f3 100644 --- a/dll/steam_matchmaking_servers.cpp +++ b/dll/steam_matchmaking_servers.cpp @@ -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 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 direct_ip_requests_temp; diff --git a/dll/steam_matchmaking_servers.h b/dll/steam_matchmaking_servers.h index 71e2a57..21a643f 100644 --- a/dll/steam_matchmaking_servers.h +++ b/dll/steam_matchmaking_servers.h @@ -40,11 +40,13 @@ struct Steam_Matchmaking_Request { AppId_t appid; HServerListRequest id; ISteamMatchmakingServerListResponse *callbacks; + ISteamMatchmakingServerListResponse001 *old_callbacks; bool completed, cancelled, released; std::vector 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 gameservers; std::vector requests; std::vector 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 diff --git a/sdk_includes/isteamfriends003.h b/sdk_includes/isteamfriends003.h new file mode 100644 index 0000000..148aaa8 --- /dev/null +++ b/sdk_includes/isteamfriends003.h @@ -0,0 +1,82 @@ + +#ifndef ISTEAMFRIENDS003_H +#define ISTEAMFRIENDS003_H +#ifdef STEAM_WIN32 +#pragma once +#endif + + +class ISteamFriends003 +{ +public: + // returns the local players name - guaranteed to not be NULL. + // this is the same name as on the users community profile page + // this is stored in UTF-8 format + // like all the other interface functions that return a char *, it's important that this pointer is not saved + // off; it will eventually be free'd or re-allocated + virtual const char *GetPersonaName() = 0; + + // sets the player name, stores it on the server and publishes the changes to all friends who are online + virtual void SetPersonaName_old( const char *pchPersonaName ) = 0; + + // gets the status of the current user + virtual EPersonaState GetPersonaState() = 0; + + // friend iteration + // takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria + // then GetFriendByIndex() can then be used to return the id's of each of those users + virtual int GetFriendCount( int iFriendFlags ) = 0; + + // returns the steamID of a user + // iFriend is a index of range [0, GetFriendCount()) + // iFriendsFlags must be the same value as used in GetFriendCount() + // the returned CSteamID can then be used by all the functions below to access details about the user + virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0; + + // returns a relationship to a user + virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0; + + // returns the current status of the specified user + // this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user + virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0; + + // returns the name another user - guaranteed to not be NULL. + // same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user + // note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously + // + virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; + + // gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + virtual int GetFriendAvatar( CSteamID steamIDFriend ) = 0; + // returns true if the friend is actually in a game + virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, uint64 *pulGameID, uint32 *punGameIP, uint16 *pusGamePort, uint16 *pusQueryPort ) = 0; + // accesses old friends names - returns an empty string when their are no more items in the history + virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; + + // returns true if the specified user meets any of the criteria specified in iFriendFlags + // iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values + virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0; + + // clan (group) iteration and access functions + virtual int GetClanCount() = 0; + virtual CSteamID GetClanByIndex( int iClan ) = 0; + virtual const char *GetClanName( CSteamID steamIDClan ) = 0; + + // iterators for getting users in a chat room, lobby, game server or clan + // note that large clans that cannot be iterated by the local user + // steamIDSource can be the steamID of a group, game server, lobby or chat room + virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0; + virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0; + + // returns true if the local user can see that steamIDUser is a member or in steamIDSource + virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0; + + // User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI) + virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0; + + // activates the game overlay, with an optional dialog to open ("Friends", "Community", "Players", "Settings") + virtual void ActivateGameOverlay( const char *pchDialog ) = 0; +}; + + +#endif // ISTEAMFRIENDS003_H diff --git a/sdk_includes/isteamgameserver004.h b/sdk_includes/isteamgameserver004.h new file mode 100644 index 0000000..de2f764 --- /dev/null +++ b/sdk_includes/isteamgameserver004.h @@ -0,0 +1,84 @@ + +#ifndef ISTEAMGAMESERVER004_H +#define ISTEAMGAMESERVER004_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +class ISteamGameServer004 +{ +public: + // connection functions + virtual void LogOn() = 0; + virtual void LogOff() = 0; + + // status functions + virtual bool BLoggedOn() = 0; + virtual bool BSecure() = 0; + virtual CSteamID GetSteamID() = 0; + + // Handles receiving a new connection from a Steam user. This call will ask the Steam + // servers to validate the users identity, app ownership, and VAC status. If the Steam servers + // are off-line, then it will validate the cached ticket itself which will validate app ownership + // and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection() + // and must then be sent up to the game server for authentication. + // + // Return Value: true/false depending on whether the call succeeds. 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. + virtual void SendUserConnectAndAuthenticate( CSteamID steamIDUser, uint32 unIPClient, void *pvAuthBlob, uint32 cubAuthBlobSize ) = 0; + + // Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation. + // + // Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect() + // when this user leaves the server just like you would for a real user. + virtual CSteamID CreateUnauthenticatedUserConnection() = 0; + + // Should be called whenever a user leaves our game server, this lets Steam internally + // track which users are currently on which servers for the purposes of preventing a single + // account being logged into multiple servers, showing who is currently on a server, etc. + virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0; + + // Update the data to be displayed in the server browser and matchmaking interfaces for a user + // currently connected to the server. For regular users you must call this after you receive a + // GSUserValidationSuccess callback. + // + // Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player) + virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0; + + // You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once. + // + // To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below. + // + // Input: nGameAppID - The Steam assigned AppID for the game + // unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below) + // unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY) + // unGamePort - The port which the server is listening for client connections on + // unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported + // usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests + // pchGameDir - A unique string identifier for your game + // pchVersion - The current version of the server as a string like 1.0.0.0 + // bLanMode - Is this a LAN only server? + // + // bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used, + // and stop calling it in SteamGameServer_Init()? + virtual bool BSetServerType( int32 nGameAppId, uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort, + uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0; + + // Updates server status values which shows up in the server browser and matchmaking APIs + virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers, + const char *pchServerName, const char *pSpectatorServerName, + const char *pchMapName ) = 0; + + // This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now). + virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0; + + // Sets a string defining the "gametype" for this server, this is optional, but if it is set + // it allows users to filter in the matchmaking/server-browser interfaces based on the value + virtual void SetGameType( const char *pchGameType ) = 0; + + // Ask if a user has a specific achievement for this game, will get a callback on reply + virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0; +}; + +#endif // ISTEAMGAMESERVER004_H diff --git a/sdk_includes/isteammatchmaking.h b/sdk_includes/isteammatchmaking.h index a936b56..407af96 100644 --- a/sdk_includes/isteammatchmaking.h +++ b/sdk_includes/isteammatchmaking.h @@ -891,7 +891,21 @@ struct LobbyCreated_t // used by now obsolete RequestFriendsLobbiesResponse_t // enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 }; +//----------------------------------------------------------------------------- +// Purpose: Response to a RequestFriendsLobbies() call +// One of these callbacks will be received per friend who is in a lobby +// if no friends are in a lobby, then one of these will be called with 0 values +//----------------------------------------------------------------------------- +struct RequestFriendsLobbiesResponse_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 }; + + uint64 m_ulSteamIDFriend; // friend who is in a lobby; 0 if no friends in lobbies are found + uint64 m_ulSteamIDLobby; // lobby that the friend is in; 0 if no friends in lobbies are found + int m_cResultIndex; // result #, [1, m_cResultsTotal] if any are found; 0 if no friends in lobbies are found + int m_cResultsTotal; // total number of results; 0 if no friends in lobbies are found +}; //----------------------------------------------------------------------------- // Purpose: Result of CheckForPSNGameBootInvite diff --git a/sdk_includes/isteammatchmaking002.h b/sdk_includes/isteammatchmaking002.h new file mode 100644 index 0000000..4929aa8 --- /dev/null +++ b/sdk_includes/isteammatchmaking002.h @@ -0,0 +1,126 @@ + +#ifndef ISTEAMMATCHMAKING002_H +#define ISTEAMMATCHMAKING002_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamMatchmaking002 +{ +public: + // game server favorites storage + // saves basic details about a multiplayer game server locally + + // returns the number of favorites servers the user has stored + virtual int GetFavoriteGameCount() = 0; + + // returns the details of the game server + // iGame is of range [0,GetFavoriteGameCount()) + // *pnIP, *pnConnPort are filled in the with IP:port of the game server + // *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections + // *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added + virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; + + // adds the game server to the local list; updates the time played of the server if it already exists in the list + virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0; + + // removes the game server from the local storage; returns true if one was removed + virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; + + /////// + // Game lobby functions + + // Get a list of relevant lobbies + // this is an asynchronous request + // results will be returned by LobbyMatchList_t callback, with the number of servers requested + // if the user is not currently connected to Steam (i.e. SteamUser()->BLoggedOn() returns false) then + // a LobbyMatchList_t callback will be posted immediately with no servers + virtual void RequestLobbyList_OLD() = 0; + + // 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) + // the returned CSteamID::IsValid() will be false if iLobby is out of range + virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; + + // Create a lobby on the Steam servers. + // If bPrivate is true, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID + // of the lobby will need to be communicated via game channels or via InviteUserToLobby() + // this is an asynchronous request + // results will be returned by LobbyCreated_t callback when the lobby has been created; + // local user will the join the lobby, resulting in an additional LobbyEnter_t callback being sent + // operations on the chat room can only proceed once the LobbyEnter_t has been received + virtual void CreateLobby( bool bPrivate ) = 0; + + // Joins an existing lobby + // this is an asynchronous request + // results will be returned by LobbyEnter_t callback when the lobby has been joined + virtual void JoinLobby_OLD( CSteamID steamIDLobby ) = 0; + + // 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 + virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; + + // Invite another user to the lobby + // the target user will receive a LobbyInvite_t callback + // will return true if the invite is successfully sent, whether or not the target responds + // returns false if the local user is not connected to the Steam servers + virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; + + // Lobby iteration, for viewing details of users in a lobby + // only accessible if the lobby user is a member of the specified lobby + // persona information for other lobby members (name, avatar, etc.) will be asynchronously received + // and accessible via ISteamFriends interface + + // returns the number of users in the specified lobby + virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; + // returns the CSteamID of a user in the lobby + // iMember is of range [0,GetNumLobbyMembers()) + virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; + + // Get data associated with this lobby + // takes a simple key, and returns the string associated with it + // "" will be returned if no value is set, or if steamIDLobby is invalid + virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + // Sets a key/value pair in the lobby metadata + // each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data + // this can be used to set lobby names, map, etc. + // to reset a key, just set it to "" + // other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback + virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // As above, but gets per-user data for someone in this lobby + virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; + // Sets per-user metadata (for the local user implicitly) + virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // Broadcasts a chat message to the all the users in the lobby + // users in the lobby (including the local user) will receive a LobbyChatMsg_t callback + // returns true if the message is successfully sent + // pvMsgBody can be binary or text data, up to 4k + // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator + virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; + // Get a chat message as specified in a LobbyChatMsg_t callback + // iChatID is the LobbyChatMsg_t::m_iChatID value in the callback + // *pSteamIDUser is filled in with the CSteamID of the member + // *pvData is filled in with the message itself + // return value is the number of bytes written into the buffer + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // Fetch metadata for a lobby you're not necessarily in right now + // this will send down all the metadata associated with a lobby + // this is an asynchronous call + // returns false if the local user is not connected to the Steam servers + virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0; + + // sets the game server associated with the lobby + // usually at this point, the users will leave the lobby and join the specified game server + // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect + virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; +}; + +#endif // ISTEAMMATCHMAKING002_H diff --git a/sdk_includes/isteammatchmaking003.h b/sdk_includes/isteammatchmaking003.h new file mode 100644 index 0000000..c5507e5 --- /dev/null +++ b/sdk_includes/isteammatchmaking003.h @@ -0,0 +1,151 @@ + +#ifndef ISTEAMMATCHMAKING003_H +#define ISTEAMMATCHMAKING003_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamMatchmaking003 +{ +public: + // game server favorites storage + // saves basic details about a multiplayer game server locally + + // returns the number of favorites servers the user has stored + virtual int GetFavoriteGameCount() = 0; + + // returns the details of the game server + // iGame is of range [0,GetFavoriteGameCount()) + // *pnIP, *pnConnPort are filled in the with IP:port of the game server + // *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections + // *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added + virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; + + // adds the game server to the local list; updates the time played of the server if it already exists in the list + virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0; + + // removes the game server from the local storage; returns true if one was removed + virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; + + /////// + // Game lobby functions + + // Get a list of relevant lobbies + // this is an asynchronous request + // results will be returned by LobbyMatchList_t callback, with the number of servers requested + // if the user is not currently connected to Steam (i.e. SteamUser()->BLoggedOn() returns false) then + // a LobbyMatchList_t callback will be posted immediately with no servers + virtual void RequestLobbyList_OLD() = 0; + + // filters for lobbies + // this needs to be called before RequestLobbyList() to take effect + // these are cleared on each call to RequestLobbyList() + virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0; + // numerical comparison - 0 is equal, -1 is the lobby value is less than nValueToMatch, 1 is the lobby value is greater than nValueToMatch + virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType /* 0 is equal, -1 is less than, 1 is greater than */ ) = 0; + // sets RequestLobbyList() to only returns lobbies which aren't yet full - needs SetLobbyMemberLimit() called on the lobby to set an initial limit + virtual void AddRequestLobbyListSlotsAvailableFilter() = 0; + + // 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) + // the returned CSteamID::IsValid() will be false if iLobby is out of range + virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; + + // Create a lobby on the Steam servers. + // If bPrivate is true, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID + // of the lobby will need to be communicated via game channels or via InviteUserToLobby() + // this is an asynchronous request + // results will be returned by LobbyCreated_t callback when the lobby has been created; + // local user will the join the lobby, resulting in an additional LobbyEnter_t callback being sent + // operations on the chat room can only proceed once the LobbyEnter_t has been received + virtual void CreateLobby( bool bPrivate ) = 0; + + // Joins an existing lobby + // this is an asynchronous request + // results will be returned by LobbyEnter_t callback when the lobby has been joined + // users already in the lobby will receive LobbyChatUpdate_t callback after this user has successfully joined + virtual void JoinLobby_OLD( CSteamID steamIDLobby ) = 0; + + // 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 + virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; + + // Invite another user to the lobby + // the target user will receive a LobbyInvite_t callback + // will return true if the invite is successfully sent, whether or not the target responds + // returns false if the local user is not connected to the Steam servers + virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; + + // Lobby iteration, for viewing details of users in a lobby + // only accessible if the lobby user is a member of the specified lobby + // persona information for other lobby members (name, avatar, etc.) will be asynchronously received + // and accessible via ISteamFriends interface + + // returns the number of users in the specified lobby + virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; + // returns the CSteamID of a user in the lobby + // iMember is of range [0,GetNumLobbyMembers()) + virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; + + // Get data associated with this lobby + // takes a simple key, and returns the string associated with it + // "" will be returned if no value is set, or if steamIDLobby is invalid + virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + // Sets a key/value pair in the lobby metadata + // each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data + // this can be used to set lobby names, map, etc. + // to reset a key, just set it to "" + // other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback + virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // As above, but gets per-user data for someone in this lobby + virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; + // Sets per-user metadata (for the local user implicitly) + virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // Broadcasts a chat message to the all the users in the lobby + // users in the lobby (including the local user) will receive a LobbyChatMsg_t callback + // returns true if the message is successfully sent + // pvMsgBody can be binary or text data, up to 4k + // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator + virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; + // Get a chat message as specified in a LobbyChatMsg_t callback + // iChatID is the LobbyChatMsg_t::m_iChatID value in the callback + // *pSteamIDUser is filled in with the CSteamID of the member + // *pvData is filled in with the message itself + // return value is the number of bytes written into the buffer + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // Fetch metadata for a lobby you're not necessarily in right now + // this will send down all the metadata associated with a lobby + // this is an asynchronous call + // returns false if the local user is not connected to the Steam servers + virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0; + + // sets the game server associated with the lobby + // usually at this point, the users will leave the lobby and join the specified game server + // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect + virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; + // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0; + + // set the limit on the # of users who can join the lobby + virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; + // returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined + virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0; + + virtual void SetLobbyVoiceEnabled( CSteamID steamIDLobby, bool bVoiceEnabled ) = 0; + + // 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) + virtual bool RequestFriendsLobbies() = 0; +}; + +#endif // ISTEAMMATCHMAKING003_H diff --git a/sdk_includes/isteammatchmaking004.h b/sdk_includes/isteammatchmaking004.h new file mode 100644 index 0000000..e9facd6 --- /dev/null +++ b/sdk_includes/isteammatchmaking004.h @@ -0,0 +1,149 @@ + +#ifndef ISTEAMMATCHMAKING004_H +#define ISTEAMMATCHMAKING004_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamMatchmaking004 +{ +public: + // game server favorites storage + // saves basic details about a multiplayer game server locally + + // returns the number of favorites servers the user has stored + virtual int GetFavoriteGameCount() = 0; + + // returns the details of the game server + // iGame is of range [0,GetFavoriteGameCount()) + // *pnIP, *pnConnPort are filled in the with IP:port of the game server + // *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections + // *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added + virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; + + // adds the game server to the local list; updates the time played of the server if it already exists in the list + virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0; + + // removes the game server from the local storage; returns true if one was removed + virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; + + /////// + // Game lobby functions + + // Get a list of relevant lobbies + // this is an asynchronous request + // results will be returned by LobbyMatchList_t callback, with the number of servers requested + // if the user is not currently connected to Steam (i.e. SteamUser()->BLoggedOn() returns false) then + // a LobbyMatchList_t callback will be posted immediately with no servers + virtual void RequestLobbyList_OLD() = 0; + + // filters for lobbies + // this needs to be called before RequestLobbyList() to take effect + // these are cleared on each call to RequestLobbyList() + virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0; + // numerical comparison - 0 is equal, -1 is the lobby value is less than nValueToMatch, 1 is the lobby value is greater than nValueToMatch + virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType /* 0 is equal, -1 is less than, 1 is greater than */ ) = 0; + // sets RequestLobbyList() to only returns lobbies which aren't yet full - needs SetLobbyMemberLimit() called on the lobby to set an initial limit + virtual void AddRequestLobbyListSlotsAvailableFilter() = 0; + + // 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) + // the returned CSteamID::IsValid() will be false if iLobby is out of range + virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; + + // Create a lobby on the Steam servers. + // If bPrivate is true, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID + // of the lobby will need to be communicated via game channels or via InviteUserToLobby() + // this is an asynchronous request + // results will be returned by LobbyCreated_t callback when the lobby has been created; + // local user will the join the lobby, resulting in an additional LobbyEnter_t callback being sent + // operations on the chat room can only proceed once the LobbyEnter_t has been received + virtual void CreateLobby( bool bPrivate ) = 0; + + // Joins an existing lobby + // this is an asynchronous request + // results will be returned by LobbyEnter_t callback when the lobby has been joined + // users already in the lobby will receive LobbyChatUpdate_t callback after this user has successfully joined + virtual void JoinLobby_OLD( CSteamID steamIDLobby ) = 0; + + // 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 + virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; + + // Invite another user to the lobby + // the target user will receive a LobbyInvite_t callback + // will return true if the invite is successfully sent, whether or not the target responds + // returns false if the local user is not connected to the Steam servers + virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; + + // Lobby iteration, for viewing details of users in a lobby + // only accessible if the lobby user is a member of the specified lobby + // persona information for other lobby members (name, avatar, etc.) will be asynchronously received + // and accessible via ISteamFriends interface + + // returns the number of users in the specified lobby + virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; + // returns the CSteamID of a user in the lobby + // iMember is of range [0,GetNumLobbyMembers()) + virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; + + // Get data associated with this lobby + // takes a simple key, and returns the string associated with it + // "" will be returned if no value is set, or if steamIDLobby is invalid + virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + // Sets a key/value pair in the lobby metadata + // each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data + // this can be used to set lobby names, map, etc. + // to reset a key, just set it to "" + // other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback + virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // As above, but gets per-user data for someone in this lobby + virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; + // Sets per-user metadata (for the local user implicitly) + virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // Broadcasts a chat message to the all the users in the lobby + // users in the lobby (including the local user) will receive a LobbyChatMsg_t callback + // returns true if the message is successfully sent + // pvMsgBody can be binary or text data, up to 4k + // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator + virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; + // Get a chat message as specified in a LobbyChatMsg_t callback + // iChatID is the LobbyChatMsg_t::m_iChatID value in the callback + // *pSteamIDUser is filled in with the CSteamID of the member + // *pvData is filled in with the message itself + // return value is the number of bytes written into the buffer + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // Fetch metadata for a lobby you're not necessarily in right now + // this will send down all the metadata associated with a lobby + // this is an asynchronous call + // returns false if the local user is not connected to the Steam servers + virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0; + + // sets the game server associated with the lobby + // usually at this point, the users will leave the lobby and join the specified game server + // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect + virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; + // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0; + + // set the limit on the # of users who can join the lobby + virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; + // returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined + virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0; + + // 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) + virtual bool RequestFriendsLobbies() = 0; +}; + +#endif // ISTEAMMATCHMAKING004_H diff --git a/sdk_includes/isteammatchmaking005.h b/sdk_includes/isteammatchmaking005.h new file mode 100644 index 0000000..95bfe32 --- /dev/null +++ b/sdk_includes/isteammatchmaking005.h @@ -0,0 +1,177 @@ + +#ifndef ISTEAMMATCHMAKING005_H +#define ISTEAMMATCHMAKING005_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamMatchmaking005 +{ +public: + // game server favorites storage + // saves basic details about a multiplayer game server locally + + // returns the number of favorites servers the user has stored + virtual int GetFavoriteGameCount() = 0; + + // returns the details of the game server + // iGame is of range [0,GetFavoriteGameCount()) + // *pnIP, *pnConnPort are filled in the with IP:port of the game server + // *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections + // *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added + virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; + + // adds the game server to the local list; updates the time played of the server if it already exists in the list + virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0; + + // removes the game server from the local storage; returns true if one was removed + virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; + + /////// + // Game lobby functions + + // Get a list of relevant lobbies + // this is an asynchronous request + // results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found + // this will never return lobbies that are full + // to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call + // use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g. + /* + class CMyLobbyListManager + { + CCallResult m_CallResultLobbyMatchList; + void FindLobbies() + { + // SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList() + SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList(); + m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList ); + } + + void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure ) + { + // lobby list has be retrieved from Steam back-end, use results + } + } + */ + // + virtual void RequestLobbyList_OLD() = 0; + // filters for lobbies + // this needs to be called before RequestLobbyList() to take effect + // these are cleared on each call to RequestLobbyList() + virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0; + // numerical comparison + virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType ) = 0; + virtual void AddRequestLobbyListSlotsAvailableFilter() = 0; + // returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence + virtual void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo ) = 0; + + // 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) + // the returned CSteamID::IsValid() will be false if iLobby is out of range + virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; + + // Create a lobby on the Steam servers. + // If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID + // of the lobby will need to be communicated via game channels or via InviteUserToLobby() + // this is an asynchronous request + // results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this pointer + // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) + virtual void CreateLobby_OLD( ELobbyType eLobbyType ) = 0; + + // 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 + // lobby metadata is available to use immediately on this call completing + virtual void JoinLobby_OLD( CSteamID steamIDLobby ) = 0; + + // 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 + virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; + + // Invite another user to the lobby + // the target user will receive a LobbyInvite_t callback + // will return true if the invite is successfully sent, whether or not the target responds + // returns false if the local user is not connected to the Steam servers + virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; + + // Lobby iteration, for viewing details of users in a lobby + // only accessible if the lobby user is a member of the specified lobby + // persona information for other lobby members (name, avatar, etc.) will be asynchronously received + // and accessible via ISteamFriends interface + + // returns the number of users in the specified lobby + virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; + // returns the CSteamID of a user in the lobby + // iMember is of range [0,GetNumLobbyMembers()) + virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; + + // Get data associated with this lobby + // takes a simple key, and returns the string associated with it + // "" will be returned if no value is set, or if steamIDLobby is invalid + virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + // Sets a key/value pair in the lobby metadata + // each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data + // this can be used to set lobby names, map, etc. + // to reset a key, just set it to "" + // other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback + virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // As above, but gets per-user data for someone in this lobby + virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; + // Sets per-user metadata (for the local user implicitly) + virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // Broadcasts a chat message to the all the users in the lobby + // users in the lobby (including the local user) will receive a LobbyChatMsg_t callback + // returns true if the message is successfully sent + // pvMsgBody can be binary or text data, up to 4k + // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator + virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; + // Get a chat message as specified in a LobbyChatMsg_t callback + // iChatID is the LobbyChatMsg_t::m_iChatID value in the callback + // *pSteamIDUser is filled in with the CSteamID of the member + // *pvData is filled in with the message itself + // return value is the number of bytes written into the buffer + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // Refreshes metadata for a lobby you're not necessarily in right now + // you never do this for lobbies you're a member of, only if your + // this will send down all the metadata associated with a lobby + // this is an asynchronous call + // returns false if the local user is not connected to the Steam servers + // restart are returned by a LobbyDataUpdate_t callback + virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0; + + // sets the game server associated with the lobby + // usually at this point, the users will join the specified game server + // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect + virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; + // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0; + + // set the limit on the # of users who can join the lobby + virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; + // returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined + virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0; + + virtual bool RequestFriendsLobbies() = 0; + + // updates which type of lobby it is + // only lobbies that are k_ELobbyTypePublic will be returned by RequestLobbyList() calls + virtual bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType ) = 0; + + // returns the current lobby owner + // you must be a member of the lobby to access this + // there always one lobby owner - if the current owner leaves, another user will become the owner + // it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner + virtual CSteamID GetLobbyOwner( CSteamID steamIDLobby ) = 0; + + virtual float GetLobbyDistance( CSteamID steamIDLobby ) = 0; +}; + +#endif // ISTEAMMATCHMAKING005_H diff --git a/sdk_includes/isteammatchmaking007.h b/sdk_includes/isteammatchmaking007.h index f82ce25..6e45531 100644 --- a/sdk_includes/isteammatchmaking007.h +++ b/sdk_includes/isteammatchmaking007.h @@ -191,4 +191,118 @@ public: virtual bool SetLobbyOwner( CSteamID steamIDLobby, CSteamID steamIDNewOwner ) = 0; }; +//----------------------------------------------------------------------------- +// Callback interfaces for server list functions (see ISteamMatchmakingServers below) +// +// The idea here is that your game code implements objects that implement these +// interfaces to receive callback notifications after calling asynchronous functions +// inside the ISteamMatchmakingServers() interface below. +// +// This is different than normal Steam callback handling due to the potentially +// large size of server lists. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after a server list refresh +// or an individual server update. +// +// Since you get these callbacks after requesting full list refreshes you will +// usually implement this interface inside an object like CServerBrowser. If that +// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery() +// to cancel any in-progress queries so you don't get a callback into the destructed +// object and crash. +//----------------------------------------------------------------------------- +class ISteamMatchmakingServerListResponse001 +{ +public: + // Server has responded ok with updated data + virtual void ServerResponded( int iServer ) = 0; + + // Server has failed to respond + virtual void ServerFailedToRespond( int iServer ) = 0; + + // A list refresh you had initiated is now 100% completed + virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0; +}; + +enum EMatchMakingType +{ + eInternetServer = 0, + eLANServer, + eFriendsServer, + eFavoritesServer, + eHistoryServer, + eSpectatorServer, + eInvalidServer +}; + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to game lists and details +//----------------------------------------------------------------------------- +class ISteamMatchmakingServers001 +{ +public: + // Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. + virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse ) = 0; + virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse001 *pRequestServersResponse ) = 0; + virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse ) = 0; + virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse ) = 0; + virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse ) = 0; + virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse001 *pRequestServersResponse ) = 0; + + /* the filters that are available in the ppchFilters params are: + + "map" - map the server is running, as set in the dedicated server api + "dedicated" - reports bDedicated from the API + "secure" - VAC-enabled + "full" - not full + "empty" - not empty + "noplayers" - is empty + "proxy" - a relay server + + */ + + // 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 + virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0; + + // 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. + virtual void CancelQuery( EMatchMakingType eType ) = 0; + + // Ping every server in your list again but don't update the list of servers + virtual void RefreshQuery( EMatchMakingType eType ) = 0; + + // Returns true if the list is currently refreshing its server list + virtual bool IsRefreshing( EMatchMakingType eType ) = 0; + + // How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1 + virtual int GetServerCount( EMatchMakingType eType ) = 0; + + // Refresh a single server inside of a query (rather than all the servers ) + virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0; + + + //----------------------------------------------------------------------------- + // Queries to individual servers directly via IP/Port + //----------------------------------------------------------------------------- + + // Request updated ping time and other details from a single server + virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0; + + // Request the list of players currently playing on a server + virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0; + + // Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side) + virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0; + + // Cancel an outstanding Ping/Players/Rules query from above. 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 calls to avoid crashing when callbacks occur. + virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0; +}; + #endif // ISTEAMMATCHMAKING007_H diff --git a/sdk_includes/steam_api.h b/sdk_includes/steam_api.h index fa454b6..c011200 100644 --- a/sdk_includes/steam_api.h +++ b/sdk_includes/steam_api.h @@ -49,6 +49,7 @@ #include "isteamuser019.h" #include "isteamuser020.h" #include "isteamfriends.h" +#include "isteamfriends003.h" #include "isteamfriends004.h" #include "isteamfriends005.h" #include "isteamfriends006.h" @@ -72,6 +73,10 @@ #include "isteamutils008.h" #include "isteamutils009.h" #include "isteammatchmaking.h" +#include "isteammatchmaking002.h" +#include "isteammatchmaking003.h" +#include "isteammatchmaking004.h" +#include "isteammatchmaking005.h" #include "isteammatchmaking006.h" #include "isteammatchmaking007.h" #include "isteammatchmaking008.h" diff --git a/sdk_includes/steam_gameserver.h b/sdk_includes/steam_gameserver.h index 5ebf263..108b25a 100644 --- a/sdk_includes/steam_gameserver.h +++ b/sdk_includes/steam_gameserver.h @@ -19,6 +19,7 @@ #include "isteamgameserver009.h" #include "isteamgameserver008.h" #include "isteamgameserver005.h" +#include "isteamgameserver004.h" #include "isteamgameserverstats.h" enum EServerMode