#ifndef ISTEAMMATCHMAKING001_H #define ISTEAMMATCHMAKING001_H #ifdef STEAM_WIN32 #pragma once #endif // this interface version is not found in public SDK archives, it is based on proton src: https://github.com/ValveSoftware/Proton/tree/proton_9.0/lsteamclient //----------------------------------------------------------------------------- // Purpose: Functions for match making services for clients to get to favorites // and to operate on game lobbies. //----------------------------------------------------------------------------- class ISteamMatchmaking001 { 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, uint32 *pnAppID, uint32 *pnIP, uint16 *pnConnPort, 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( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) = 0; // removes the game server from the local storage; returns true if one was removed virtual bool RemoveFavoriteGame( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint32 unFlags ) = 0; virtual bool GetFavoriteGame2( int iGame, uint32 *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; virtual int AddFavoriteGame2( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) = 0; virtual bool RemoveFavoriteGame2( uint32 nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; /////// // Game lobby functions virtual void RequestLobbyList( uint64 ulGameID, MatchMakingKeyValuePair_t *pFilters, uint32 nFilters ) = 0; virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; virtual void CreateLobby( uint64 ulGameID, bool bPrivate ) = 0; virtual void JoinLobby_OLD( CSteamID steamIDLobby ) = 0; virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; 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 bool SetLobbyMemberData_OLD( 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 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; }; #endif // ISTEAMMATCHMAKING001_H