Funktioner for klienter til at få adgang til matchmaking-tjenester, favoritter og styre spillobbyer.
Se
Steam-matchmaking og lobbyer for flere oplysninger.
Medlemsfunktioner
Medlemsfunktioner for
ISteamMatchmaking
kaldes gennem den globale accessor-funktion
SteamMatchmaking()
.
AddFavoriteGame
int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer );
Navn | Type | Beskrivelse |
nAppID | AppId_t | Spillets app-ID. |
nIP | uint32 | IP-adressen på serveren i værtsrækkefølge, dvs. 127.0.0.1 == 0x7f000001. |
nConnPort | uint16 | Den port, der bruges til at oprette forbindelse til serveren, i værtsrækkefølge. |
nQueryPort | uint16 | Den port, der bruges til at forespørge serveren, i værtsrækkefølge. |
unFlags | uint32 | Angiver, om serveren skal føjes til listen over foretrukne eller historiklisten. Se k_unFavoriteFlagNone for flere oplysninger. |
rTime32LastPlayedOnServer | uint32 | Dette skal være det aktuelle klokkeslæt i Unix Epoch-format (sekunder siden 1. januar 1970). |
Tilføjer spilserveren til listen over lokale favoritter eller opdaterer tidspunktet, der blev spillet, hvis serveren allerede eksisterer på listen.
Returværdier: int
AddRequestLobbyListCompatibleMembersFilter
void AddRequestLobbyListCompatibleMembersFilter( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | |
Ubrugt – tjekker efter spillerkompatibilitet baseret på "frenemy"-systemet.
AddRequestLobbyListDistanceFilter
void AddRequestLobbyListDistanceFilter( ELobbyDistanceFilter eLobbyDistanceFilter );
Indstiller den fysiske afstand, som gælder for de lobbyer, vi søger efter. Dette er baseret på brugerens IP-adresse og et IP-placeringskort i Steams backend.
AddRequestLobbyListFilterSlotsAvailable
void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable );
Navn | Type | Beskrivelse |
nSlotsAvailable | int | Antallet af åbne pladser, som skal være åbne. |
Filtrerer, så der kun returneres antallet af åbne pladser.
AddRequestLobbyListNearValueFilter
void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo );
Navn | Type | Beskrivelse |
pchKeyToMatch | const char * | Filtrets nøglenavn, som skal matches. Dette må ikke være længere end k_nMaxLobbyKeyLength. |
nValueToBeCloseTo | int | Værdien, som lobbyer vil blive sorteret ud fra. |
Sorterer resultaterne tættest på den angivne værdi.
Nærliggende filtre filtrerer ikke rigtigt værdier, men de påvirker bare, hvordan resultaterne sorteres. Du kan angive flere nærliggende filtre, hvor det første nærliggende filter har mest vægt, og det sidste filter har mindst vægt.
AddRequestLobbyListNumericalFilter
void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType );
Navn | Type | Beskrivelse |
pchKeyToMatch | const char * | Filtrets nøglenavn, som skal matches. Dette må ikke være længere end k_nMaxLobbyKeyLength. |
nValueToMatch | int | Antallet, som skal matches. |
eComparisonType | ELobbyComparison | Den type sammenligning, der skal foretages. |
Tilføjer et numerisk sammenligningsfilter til næste
RequestLobbyList-kald.
AddRequestLobbyListResultCountFilter
void AddRequestLobbyListResultCountFilter( int cMaxResults );
Navn | Type | Beskrivelse |
cMaxResults | int | Det maksimale antal lobbyer, der skal returneres. |
Angiver det maksimale antal lobbyer, der skal returneres. Jo lavere antallet er, desto hurtigere er det at downloade lobbyens resultatoplysninger til klienten.
AddRequestLobbyListStringFilter
void AddRequestLobbyListStringFilter( const char *pchKeyToMatch, const char *pchValueToMatch, ELobbyComparison eComparisonType );
Navn | Type | Beskrivelse |
pchKeyToMatch | const char * | Filtrets nøglenavn, som skal matches. Dette må ikke være længere end k_nMaxLobbyKeyLength. |
pchValueToMatch | const char * | Strengen, som skal matches. |
eComparisonType | ELobbyComparison | Den type sammenligning, der skal foretages. |
Tilføjer et strengsammenligningsfilter til næste
RequestLobbyList-kald.
CheckForPSNGameBootInvite
void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes );
Navn | Type | Beskrivelse |
iGameBootAttributes | unsigned int | |
Forældet – kun PS3.
CreateLobby
SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers );
Navn | Type | Beskrivelse |
eLobbyType | ELobbyType | Lobbyens type og synlighed. Dette kan ændres senere via SetLobbyType. |
cMaxMembers | int | Det maksimale antal spillere, som kan tilslutte sig denne lobby. Dette må ikke være over 250. |
Opretter en ny matchmaking-lobby.
Returværdier: SteamAPICall_t skal bruges med et
LobbyCreated_t-kaldsresultat.
Udløser et
LobbyEnter_t-tilbagekald.
Udløser et
LobbyDataUpdate_t-tilbagekald.
Hvis resultaterne, som returneres via
LobbyCreated_t-kaldsresultatet, indikerer succes, så bliver man tilsluttet til lobbyen, og den er nu klar til at bruge.
LobbyEnter_t-tilbagekaldet modtages også, eftersom den lokale bruger har tilsluttet sig sin egen lobby.
DeleteLobbyData
bool DeleteLobbyData( CSteamID steamIDLobby, const char *pchKey );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Steam-ID'et på lobbyen, som metadataene skal slettes fra. |
pchKey | const char * | Den nøgle, der skal slettes fra. |
Fjerner en metadatanøgler fra lobbyen.
Dette kan kun gøres af lobbyejeren.
Dette sender kun dataene, hvis nøglen eksisterer. Der er en lille forsinkelse, før dataene sendes, så du kan kalde dette gentagne gange for at indstille alle dataene, du har brug for, og det vil automatisk samles sammen og sendes, efter det sidste kald laves.
Returværdier: bool
true, hvis nøglen/værdien blev slettet, ellers
false, hvis
steamIDLobby
eller
pchKey
er ugyldig.
GetFavoriteGame
bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer );
Navn | Type | Beskrivelse |
iGame | int | Indekset for den foretrukne spilserver, som der skal hentes detaljer om. Dette skal være mellem 0 og GetFavoriteGameCount. |
pnAppID | AppId_t * | Returnerer app-ID'et, denne server er til. |
pnIP | uint32 * | Returnerer IP-adressen på serveren i værtsrækkefølge, dvs. 127.0.0.1 == 0x7f000001. |
pnConnPort | uint16 * | Returnerer porten, der bruges til at oprette forbindelse til serveren, i værtsrækkefølge. |
pnQueryPort | uint16 * | Returnerer porten, der bruges til at forespørge serveren, i værtsrækkefølge. |
punFlags | uint32 * | Returnerer, om serveren er på til listen over foretrukne eller historiklisten. Se k_unFavoriteFlagNone for flere oplysninger. |
pRTime32LastPlayedOnServer | uint32 * | Returnerer tidspunktet, hvor serveren senest blev tilføjet til listen over foretrukne i Unix Epoch-format (sekunder siden 1. januar 1970). |
Henter oplysningerne fra den foretrukne spilserver ud fra indeks.
BEMÆRK: Du skal kalde
GetFavoriteGameCount, før du kalder denne.
Returværdier: bool
true, hvis oplysningerne blev returneret.
false if
iGame
was an invalid index.
Se også: AddFavoriteGame,
RemoveFavoriteGameGetFavoriteGameCount
int GetFavoriteGameCount();
Henter antallet af foretrukne og seneste spilservere, som brugeren har gemt lokalt.
Returværdier: int
Se også: AddFavoriteGame,
RemoveFavoriteGameGetLobbyByIndex
CSteamID GetLobbyByIndex( int iLobby );
Navn | Type | Beskrivelse |
iLobby | int | Indekset tilhørende lobbyen, som der skal hentes Steam-ID for, fra 0 til LobbyMatchList_t.m_nLobbiesMatching. |
Gets the Steam ID of the lobby at the specified index after receiving the
RequestLobbyList results.
BEMÆRK: Dette bør kun kaldes, efter et
LobbyMatchList_t-kaldsresultat er blevet modtaget.
Returværdier: CSteamIDReturns
k_steamIDNil if the provided index is invalid or there are no lobbies found.
GetLobbyChatEntry
int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Steam-ID'et på lobbyen, som chatbeskeden skal hentes fra. Dette skal næsten altid være LobbyChatMsg_t::m_ulSteamIDUser . |
iChatID | int | Indekset tilhørende chatbeskeden i lobbyen. Dette skal næsten altid være LobbyChatMsg_t::m_iChatID . |
pSteamIDUser | CSteamID * | Hvis angivet, returnerer den Steam-ID'et tilhørende brugeren, som sendte beskeden. Dette behøves oftes ikke, da det vil være det samme som LobbyChatMsg_t::m_ulSteamIDUser . |
pvData | void * | Returnerer beskedens data ved at kopiere dem over i denne buffer. This buffer should be up to 4 Kilobytes. |
cubData | int | Størrelsen af bufferen, som er allokeret til pvData . |
peChatEntryType | EChatEntryType * | If set then this will just always return k_EChatEntryTypeChatMsg. Dette kan normalt angives som NULL. |
Henter dataene fra en chatbesked i lobbyen efter at have modtaget
LobbyChatMsg_t-tilbagekaldet.
Returværdier: int
Antallet af bytes, der kopieres ind i
pvData
.
Se også: SendLobbyChatMsgGetLobbyData
const char * GetLobbyData( CSteamID steamIDLobby, const char *pchKey );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Steam-ID'et på lobbyen, som metadataene skal hentes fra. |
pchKey | const char * | Den nøgle, der skal hentes en værdi for. |
Henter metadataene, som er tilknyttet den angivne nøgle fra en bestemt lobby.
BEMÆRK: Der kan kun hentes metadata fra lobbyer, som klienten kender til, enten efter modtagelse af listen over lobbyer fra
LobbyMatchList_t, efter modtagelse af dataene med
RequestLobbyData eller efter tilslutning til en lobby.
Returværdier: const char *
Returnerer en tom streng (""), hvis der ikke er angivet nogen værdi for denne nøgle, eller hvis
steamIDLobby
er ugyldig.
GetLobbyDataByIndex
bool GetLobbyDataByIndex( CSteamID steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | This MUST be the same lobby used in the previous call to GetLobbyDataCount! |
iLobbyData | int | An index between 0 and GetLobbyDataCount. |
pchKey | char * | Returns the name of the key at the specified index by copying it into this buffer. |
cchKeyBufferSize | int | The size of the buffer allocated for pchKey . This typically should be k_nMaxLobbyKeyLength. |
pchValue | char * | Returns the value associated with the key at the specified index by copying it into this buffer. |
cchValueBufferSize | int | The size of the buffer allocated for pchValue . This typically should be k_cubChatMetadataMax. |
Gets a lobby metadata key/value pair by index.
BEMÆRK: Du skal kalde
GetLobbyDataCount, før du kalder denne.
Returværdier: bool
true, hvis det lykkes, ellers
false, hvis
steamIDLobby
eller
iLobbyData
er ugyldig.
GetLobbyDataCount
int GetLobbyDataCount( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Steam-ID'et på lobbyen, som antallet af dataposter skal hentes fra. |
Henter antallet af metadatanøglesæt for den bestemte lobby.
BEMÆRK: Der kan kun hentes metadata fra lobbyer, som klienten kender til, enten efter modtagelse af listen over lobbyer fra
LobbyMatchList_t, efter modtagelse af dataene med
RequestLobbyData eller efter tilslutning til en lobby.
This is used for iteration, after calling this then
GetLobbyDataByIndex can be used to get the key/value pair of each piece of metadata.
BEMÆRK: Der bør kun være behov for dette til fejlfindingsformål.
Returværdier: int
Returnerer
0, hvis
steamIDLobby
er ugyldig.
Eksempel:void ListLobbyData( CSteamID lobbyID )
{
int nData = SteamMatchmaking()->GetLobbyDataCount( lobbyID );
char key[k_nMaxLobbyKeyLength];
char value[k_cubChatMetadataMax];
for( int i = 0; i < nData; ++i )
{
bool bSuccess = SteamMatchmaking()->GetLobbyDataByIndex( lobbyID, i, key, k_nMaxLobbyKeyLength, value, k_cubChatMetadataMax );
if ( bSuccess )
{
printf( "Lobby Data %d, Key: \"%s\" - Value: \"%s\"\n", i, key, value );
}
}
}
GetLobbyGameServer
bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to get the game server information from. |
punGameServerIP | uint32 * | Returns the IP address of the game server, in host order, i.e 127.0.0.1 == 0x7f000001, if it's set. |
punGameServerPort | uint16 * | Returns the connection port of the game server, in host order, if it's set. |
psteamIDGameServer | CSteamID * | Returns the Steam ID of the game server, if it's set. |
Henter detaljer om en spilserver, som er angivet i en lobby.
Either the IP/Port or the Steam ID of the game server has to be valid, depending on how you want the clients to be able to connect.
Returværdier: bool
true, if the lobby is valid and has a valid game server set; otherwise,
false.
Se også: SetLobbyGameServerGetLobbyMemberByIndex
CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember );
Gets the Steam ID of the lobby member at the given index.
BEMÆRK: Du skal kalde
GetNumLobbyMembers, før du kalder denne.
BEMÆRK: Den aktuelle bruger skal være i lobbyen for at hente Steam-ID'er på andre brugere i lobbyen.
Returværdier: CSteamIDUgyldige indekser returnerer
k_steamIDNil.
GetLobbyMemberData
const char * GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Steam-ID'et på lobbyen, som den anden spiller er i. |
steamIDUser | CSteamID | Steam-ID'et på spilleren, som metadataene skal hentes fra. |
pchKey | const char * | Den nøgle, der skal hentes en værdi for. |
Henter metadata pr. bruger fra en anden spiller i den angivne lobby.
Der kan kun forespørges om dette fra medlemmer i lobbyer, som du er i lige nu.
Returværdier: const char *
Returnerer
NULL, hvis
steamIDLobby
er ugyldig, eller hvis
steamIDUser
ikke er i lobbyen.
Returnerer en tom streng (""), hvis
pchKey
ikke er angivet for spilleren.
Se også: SetLobbyMemberDataGetLobbyMemberLimit
int GetLobbyMemberLimit( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to get the member limit of. |
The current limit on the # of users who can join the lobby.
Returns
0 if no limit is defined.
Returværdier: int
Returnerer
0, hvis der ikke er nogen metadata tilgængelige for den angivne lobby.
GetLobbyOwner
CSteamID GetLobbyOwner( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Steam-ID'et på lobbyen, som der skal hentes en ejer for. |
Returnerer den nuværende lobbyejer.
BEMÆRK: Du skal være medlem af lobbyen for at få adgang til dette.
Der er altid en lobbyejer. Hvis den nuværende ejer forlader lobbyen, bliver en anden bruger i lobbyen automatisk ejer. It is possible (but rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner.
Returværdier: CSteamIDReturnerer
k_steamIDNil, hvis du ikke er i lobbyen.
Se også: SetLobbyOwnerGetNumLobbyMembers
int GetNumLobbyMembers( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to get the number of members of. |
Gets the number of users in a lobby.
BEMÆRK: The current user must be in the lobby to retrieve the Steam IDs of other users in that lobby.
This is used for iteration, after calling this then
GetLobbyMemberByIndex can be used to get the Steam ID of each person in the lobby. Persona information for other lobby members (name, avatar, etc.) is automatically received and accessible via the
ISteamFriends interface.
Returværdier: int
The number of members in the lobby,
0 if the current user has no data from the lobby.
InviteUserToLobby
bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to invite the user to. |
steamIDInvitee | CSteamID | The Steam ID of the person who will be invited. |
Inviter en anden bruger til lobbyen.
If the specified user clicks the join link, a
GameLobbyJoinRequested_t callback will be posted if the user is in-game,
or if the game isn't running yet then the game will be automatically launched with the command line parameter
+connect_lobby <64-bit lobby Steam ID>
instead.
Returværdier: bool
true, if the invite was successfully sent; otherwise,
false if the local user isn't in a lobby, no connection to Steam could be made, or the specified user is invalid.
BEMÆRK: Dette kald tjekker ikke, om det lykkedes at invitere den anden bruger.
JoinLobby
SteamAPICall_t JoinLobby( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to join. |
Joins an existing lobby.
The lobby Steam ID can be obtained either from a search with
RequestLobbyList, joining on a friend, or from an invite.
Returværdier: SteamAPICall_t, som skal bruges med et
LobbyEnter_t-kaldsresultat.
Udløser et
LobbyDataUpdate_t-tilbagekald.
LeaveLobby
void LeaveLobby( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | Den lobby, der skal forlades. |
Leave a lobby that the user is currently in; this will take effect immediately on the client side, other users in the lobby will be notified by a
LobbyChatUpdate_t callback.
RemoveFavoriteGame
bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags );
Navn | Type | Beskrivelse |
nAppID | AppId_t | Spillets app-ID. |
nIP | uint32 | The IP address of the server in host order, i.e 127.0.0.1 == 0x7f000001. |
nConnPort | uint16 | The port used to connect to the server, in host order. |
nQueryPort | uint16 | The port used to query the server, in host order. |
unFlags | uint32 | Whether the server is on the favorites list or history list. See k_unFavoriteFlagNone for more information. |
Removes the game server from the local favorites list.
Returværdier: bool
true, if the server was removed; otherwise,
false if the specified server was not on the users local favorites list.
RequestLobbyData
bool RequestLobbyData( CSteamID steamIDLobby );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to refresh the metadata of. |
Refreshes all of the metadata for a lobby that you're not in right now.
You will never do this for lobbies you're a member of, that data will always be up to date. You can use this to refresh lobbies that you have obtained from
RequestLobbyList or that are available via friends.
Returværdier: bool
Udløser et
LobbyDataUpdate_t-tilbagekald.
true, if the request was successfully sent to the server.
false if no connection to Steam could be made, or
steamIDLobby
is invalid.
If the specified lobby doesn't exist,
LobbyDataUpdate_t::
m_bSuccess
will be set to
false.
RequestLobbyList
SteamAPICall_t RequestLobbyList();
Get a filtered list of relevant lobbies.
There can only be one active lobby search at a time. The old request will be canceled if a new one is started. Depending on the users connection to the Steam back-end, this call can take from 300ms to 5 seconds to complete, and has a timeout of 20 seconds.
BEMÆRK: To filter the results you MUST call the
AddRequestLobbyList*
functions before calling this. The filters are cleared on each call to this function.
BEMÆRK: If
AddRequestLobbyListDistanceFilter is not called,
k_ELobbyDistanceFilterDefault will be used, which will only find matches in the same or nearby regions.
BEMÆRK: This will only return lobbies that are not full, and only lobbies that are
k_ELobbyTypePublic or
k_ELobbyTypeInvisible, and are set to joinable with
SetLobbyJoinable.
Returværdier: SteamAPICall_t, som skal bruges med et
LobbyMatchList_t-kaldsresultat.
BEMÆRK: This also returns as a callback for compatibility with older applications, but you should use the call result if possible.
Se også: AddRequestLobbyListStringFilter,
AddRequestLobbyListNumericalFilter,
AddRequestLobbyListNearValueFilter,
AddRequestLobbyListFilterSlotsAvailable,
AddRequestLobbyListDistanceFilter,
AddRequestLobbyListResultCountFilterEksempel:class CLobbyListManager
{
CCallResult< CLobbyListManager, LobbyMatchList_t > m_CallResultLobbyMatchList;
void FindLobbies()
{
// SteamMatchmaking()->AddRequestLobbyListFilter*() functions ville blive kaldt her, inden RequestLobbyList()
SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList();
m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CLobbyListManager::OnLobbyMatchList );
}
void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure )
{
// lobbylisten er blevet hentet fra Steams backend, brug resultaterne
}
}
SendLobbyChatMsg
bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to send the chat message to. |
pvMsgBody | const void * | This can be text or binary data, up to 4 Kilobytes in size. |
cubMsgBody | int | The size in bytes of pvMsgBody , if it's a text message then this should be strlen( text ) + 1 to include the null terminator. |
Broadcasts a chat (text or binary data) message to the all of the users in the lobby.
All users in the lobby (including the local user) will receive a
LobbyChatMsg_t callback with the message.
If you're sending binary data, you should prefix a header to the message so that you know to treat it as your custom data rather than a plain old text message.
For communication that needs to be arbitrated (for example having a user pick from a set of characters, and making sure only one user has picked a character), you can use the lobby owner as the decision maker.
GetLobbyOwner returns the current lobby owner. There is guaranteed to always be one and only one lobby member who is the owner. So for the choose-a-character scenario, the user who is picking a character would send the binary message 'I want to be Zoe', the lobby owner would see that message, see if it was OK, and broadcast the appropriate result (user X is Zoe).
These messages are sent via the Steam back-end, and so the bandwidth available is limited. For higher-volume traffic like voice or game data, you'll want to use the
Steam Networking API.
Returværdier: bool
Udløser et
LobbyChatMsg_t-tilbagekald.
true, hvis beskeden blev sendt.
false if the message is too small or too large, or no connection to Steam could be made.
SetLinkedLobby
bool SetLinkedLobby( CSteamID steamIDLobby, CSteamID steamIDLobbyDependent );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the primary lobby. |
steamIDLobbyDependent | CSteamID | The Steam ID that will be linked to the primary lobby. |
Unused - Link two lobbies for the purposes of checking player compatibility using the frenemy system.
You must be the lobby owner of both lobbies.
Returværdier: bool
true, if the request was successfully sent to the Steam server.
false if the local user isn't the owner of both lobbies, or no connection to Steam could be made.
SetLobbyData
bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to set the metadata for. |
pchKey | const char * | The key to set the data for. This can not be longer than k_nMaxLobbyKeyLength. |
pchValue | const char * | The value to set. This can not be longer than k_cubChatMetadataMax. |
Sets a key/value pair in the lobby metadata. This can be used to set the the lobby name, current map, game mode, etc.
This can only be set by the owner of the lobby. Lobby members should use
SetLobbyMemberData instead.
Each user in the lobby will be receive notification of the lobby data change via a
LobbyDataUpdate_t callback, and any new users joining will receive any existing data.
This will only send the data if it has changed. There is a slight delay before sending the data so you can call this repeatedly to set all the data you need to and it will automatically be batched up and sent after the last sequential call.
Returværdier: bool
true, if the data has been set successfully.
false if
steamIDLobby
was invalid, or the key/value are too long.
SetLobbyGameServer
void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to set the game server information for. |
unGameServerIP | uint32 | Sets the IP address of the game server, in host order, i.e 127.0.0.1 == 0x7f000001. |
unGameServerPort | uint16 | Sets the connection port of the game server, in host order. |
steamIDGameServer | CSteamID | Sets the Steam ID of the game server. Use k_steamIDNil if you're not setting this. |
Sets the game server associated with the lobby.
This can only be set by the owner of the lobby.
Either the IP/Port or the Steam ID of the game server must be valid, depending on how you want the clients to be able to connect.
A
LobbyGameCreated_t callback will be sent to all players in the lobby, usually at this point, the users will join the specified game server.
Returværdier: void
Udløser et
LobbyGameCreated_t-kaldsresultat.
Se også: GetLobbyGameServerSetLobbyJoinable
bool SetLobbyJoinable( CSteamID steamIDLobby, bool bLobbyJoinable );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby |
bLobbyJoinable | bool | Enable (true) or disable (false) allowing users to join this lobby? |
Sets whether or not a lobby is joinable by other players. This always defaults to enabled for a new lobby.
If joining is disabled, then no players can join, even if they are a friend or have been invited.
Lobbies with joining disabled will not be returned from a lobby search.
Returværdier: bool
true, upon success; otherwise,
false if you're not the owner of the lobby.
SetLobbyMemberData
void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to set our metadata in. |
pchKey | const char * | The key to set the data for. This can not be longer than k_nMaxLobbyKeyLength. |
pchValue | const char * | The value to set. This can not be longer than k_cubChatMetadataMax. |
Sets per-user metadata for the local user.
Each user in the lobby will be receive notification of the lobby data change via a
LobbyDataUpdate_t callback, and any new users joining will receive any existing data.
There is a slight delay before sending the data so you can call this repeatedly to set all the data you need to and it will automatically be batched up and sent after the last sequential call.
Returværdier: void
Udløser et
LobbyDataUpdate_t-kaldsresultat.
Se også: GetLobbyMemberDataSetLobbyMemberLimit
bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to set the member limit for. |
cMaxMembers | int | The maximum number of players allowed in this lobby. This can not be above 250. |
Set the maximum number of players that can join the lobby.
This is also set when you create the lobby with
CreateLobby.
This can only be set by the owner of the lobby.
Returværdier: bool
true, if the limit was successfully set.
false, hvis du ikke er ejer af den angivne lobby.
SetLobbyOwner
bool SetLobbyOwner( CSteamID steamIDLobby, CSteamID steamIDNewOwner );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby where the owner change will take place. |
steamIDNewOwner | CSteamID | The Steam ID of the user that will be the new owner of the lobby, they must be in the lobby. |
Changes who the lobby owner is.
This can only be set by the owner of the lobby. This will trigger a
LobbyDataUpdate_t for all of the users in the lobby, each user should update their local state to reflect the new owner. This is typically accomplished by displaying a crown icon next to the owners name.
Returværdier: bool
Udløser et
LobbyDataUpdate_t-tilbagekald.
true, if the owner was successfully changed.
false, if you're not the current owner of the lobby,
steamIDNewOwner
is not a member in the lobby, or if no connection to Steam could be made.
Se også: GetLobbyOwnerSetLobbyType
bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType );
Navn | Type | Beskrivelse |
steamIDLobby | CSteamID | The Steam ID of the lobby to set the type of. |
eLobbyType | ELobbyType | The new lobby type to that will be set. |
Updates what type of lobby this is.
This is also set when you create the lobby with
CreateLobby.
This can only be set by the owner of the lobby.
Returværdier: bool
true, upon success; otherwise,
false if you're not the owner of the lobby.
Tilbagekald
Disse er tilbagekald, som kan aktiveres ved at kalde
SteamAPI_RunCallbacks. Many of these will be fired directly in response to the member functions of
ISteamMatchmaking
.
FavoritesListAccountsUpdated_t
Navn | Type | Beskrivelse |
m_eResult | EResult | |
FavoritesListChanged_t
A server was added/removed from the favorites list, you should refresh now.
Navn | Type | Beskrivelse |
m_nIP | uint32 | An IP of 0 means reload the whole list, any other value means just one server. This is host order, i.e 127.0.0.1 == 0x7f000001. |
m_nQueryPort | uint32 | If m_nIP is set then this is the new servers query port, in host order. |
m_nConnPort | uint32 | If m_nIP is set then this is the new servers connection port, in host order. |
m_nAppID | uint32 | If m_nIP is set then this is the App ID the game server belongs to. |
m_nFlags | uint32 | If m_nIP is set then this returns whether the the server is on the favorites list or the history list. See k_unFavoriteFlagNone for more information. |
m_bAdd | bool | If m_nIP is set then this is whether the server was added to the list (true) or removed (false) from it. |
m_unAccountId | AccountID_t | |
LobbyChatMsg_t
A chat (text or binary) message for this lobby has been received. After getting this you must use
GetLobbyChatEntry to retrieve the contents of this message.
Navn | Type | Beskrivelse |
m_ulSteamIDLobby | uint64 | The Steam ID of the lobby this message was sent in. |
m_ulSteamIDUser | uint64 | Steam ID of the user who sent this message. Note that it could have been the local user. |
m_eChatEntryType | uint8 | Type of message received. This is actually a EChatEntryType. |
m_iChatID | uint32 | The index of the chat entry to use with GetLobbyChatEntry, this is not valid outside of the scope of this callback and should never be stored. |
Tilknyttede funktioner: SendLobbyChatMsgLobbyChatUpdate_t
A lobby chat room state has changed, this is usually sent when a user has joined or left the lobby.
Navn | Type | Beskrivelse |
m_ulSteamIDLobby | uint64 | The Steam ID of the lobby. |
m_ulSteamIDUserChanged | uint64 | The user who's status in the lobby just changed - can be recipient. |
m_ulSteamIDMakingChange | uint64 | Chat member who made the change. This can be different from m_ulSteamIDUserChanged if kicking, muting, etc. For example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick. |
m_rgfChatMemberStateChange | uint32 | Bitfield of EChatMemberStateChange values. |
LobbyCreated_t
Result of our request to create a Lobby. At this point, the lobby has been joined and is ready for use, a
LobbyEnter_t callback will also be received (since the local user is joining their own lobby).
Navn | Type | Beskrivelse |
m_eResult | EResult | Resultatet af handlingen.
Mulige værdier:
|
m_ulSteamIDLobby | uint64 | The Steam ID of the lobby that was created, 0 if failed. |
Tilknyttede funktioner: CreateLobbyLobbyDataUpdate_t
The lobby metadata has changed.
If
m_ulSteamIDMember
is a user in the lobby, then use
GetLobbyMemberData to access per-user details; otherwise, if
m_ulSteamIDMember
==
m_ulSteamIDLobby
, use
GetLobbyData to access the lobby metadata.
Navn | Type | Beskrivelse |
m_ulSteamIDLobby | uint64 | The Steam ID of the Lobby. |
m_ulSteamIDMember | uint64 | Steam ID of either the member whose data changed, or the room itself. |
m_bSuccess | uint8 | true if the lobby data was successfully changed, otherwise false. |
Tilknyttede funktioner: CreateLobby,
JoinLobby,
SetLobbyMemberData,
RequestLobbyData,
SetLobbyOwnerLobbyEnter_t
Recieved upon attempting to enter a lobby. Lobby metadata is available to use immediately after receiving this.
Tilknyttede funktioner: CreateLobby,
JoinLobbyLobbyGameCreated_t
A game server has been set via
SetLobbyGameServer for all of the members of the lobby to join. It's up to the individual clients to take action on this; the typical game behavior is to leave the lobby and connect to the specified game server; but the lobby may stay open throughout the session if desired.
Navn | Type | Beskrivelse |
m_ulSteamIDLobby | uint64 | The lobby that set the game server. |
m_ulSteamIDGameServer | uint64 | The Steam ID of the game server, if it's set. |
m_unIP | uint32 | The IP address of the game server in host order, i.e 127.0.0.1 == 0x7f000001, if it's set. |
m_usPort | uint16 | The connection port of the game server, in host order, if it's set. |
Tilknyttede funktioner: SetLobbyGameServerLobbyInvite_t
Nogen har inviteret dig til en lobby. Normally you don't need to do anything with this, as the Steam UI will also display a '<user> has invited you to the lobby, join?' notification and message.
If the user outside a game chooses to join, your game will be launched with the parameter
+connect_lobby <64-bit lobby id>
, or with the callback
GameLobbyJoinRequested_t if they're already in-game.
Navn | Type | Beskrivelse |
m_ulSteamIDUser | uint64 | Steam ID of the person that sent the invite. |
m_ulSteamIDLobby | uint64 | Steam ID of the lobby we're invited to. |
m_ulGameID | uint64 | Game ID of the lobby we're invited to. |
LobbyKicked_t
Currently unused! If you want to implement kicking at this time then do it with a special packet sent with
SendLobbyChatMsg, when the user gets the packet they should call
LeaveLobby.
Navn | Type | Beskrivelse |
m_ulSteamIDLobby | uint64 | |
m_ulSteamIDAdmin | uint64 | |
m_bKickedDueToDisconnect | uint8 | |
LobbyMatchList_t
Result when requesting the lobby list. You should iterate over the returned lobbies with
GetLobbyByIndex, from 0 to
m_nLobbiesMatching
-1.
Navn | Type | Beskrivelse |
m_nLobbiesMatching | uint32 | Number of lobbies that matched search criteria and we have Steam IDs for. |
Tilknyttede funktioner: RequestLobbyListPSNGameBootInviteResult_t
Forældet – kun PS3.
Navn | Type | Beskrivelse |
m_bGameBootInviteExists | bool | |
m_steamIDLobby | CSteamID | |
Enums
Disse er optællinger, som defineres til brug med ISteamMatchmaking.
EChatMemberStateChange
Flags describing how a users lobby state has changed. This is provided from
LobbyChatUpdate_t.
Navn | Værdi | Beskrivelse |
k_EChatMemberStateChangeEntered | 0x0001 | This user has joined or is joining the lobby. |
k_EChatMemberStateChangeLeft | 0x0002 | This user has left or is leaving the lobby. |
k_EChatMemberStateChangeDisconnected | 0x0004 | User disconnected without leaving the lobby first. |
k_EChatMemberStateChangeKicked | 0x0008 | The user has been kicked. |
k_EChatMemberStateChangeBanned | 0x0010 | The user has been kicked and banned. |
ELobbyComparison
Lobby search filter options. These can be set with
AddRequestLobbyListStringFilter and
AddRequestLobbyListNearValueFilter.
Navn | Værdi | Beskrivelse |
k_ELobbyComparisonEqualToOrLessThan | -2 | The lobbies value must be equal to or less than this one. |
k_ELobbyComparisonLessThan | -1 | The lobbies value must be less than this one. |
k_ELobbyComparisonEqual | 0 | The lobbies value must match this this one exactly. |
k_ELobbyComparisonGreaterThan | 1 | The lobbies value must be greater than this one. |
k_ELobbyComparisonEqualToOrGreaterThan | 2 | The lobbies value must be equal to or greater than this one. |
k_ELobbyComparisonNotEqual | 3 | The lobbies value must not match this this. |
ELobbyDistanceFilter
Lobby search distance filters when requesting the lobby list. Lobby results are sorted from closest to farthest. This can be set with
AddRequestLobbyListDistanceFilter.
Navn | Værdi | Beskrivelse |
k_ELobbyDistanceFilterClose | 0 | Only lobbies in the same immediate region will be returned. |
k_ELobbyDistanceFilterDefault | 1 | Only lobbies in the same region or nearby regions will be returned. |
k_ELobbyDistanceFilterFar | 2 | For games that don't have many latency requirements, will return lobbies about half-way around the globe. |
k_ELobbyDistanceFilterWorldwide | 3 | No filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients). |
ELobbyType
Specifies the lobby type, this is set from
CreateLobby and
SetLobbyType.
Navn | Værdi | Beskrivelse |
k_ELobbyTypePrivate | 0 | The only way to join the lobby is from an invite. |
k_ELobbyTypeFriendsOnly | 1 | Joinable by friends and invitees, but does not show up in the lobby list. |
k_ELobbyTypePublic | 2 | Returned by search and visible to friends. |
k_ELobbyTypeInvisible | 3 | Returned by search, but not visible to other friends. This is useful if you want a user in two lobbies, for example matching groups together. A user can be in only one regular lobby, and up to two invisible lobbies. |
Typedefs
These are typedefs which are defined for use with ISteamMatchmaking.
Navn | Basistype | Beskrivelse |
HServerListRequest | void* | Handle that you will receive when requesting server list. |
HServerQuery | int | Handle that you will receive when querying details on an individual server. |
Konstanter
These are constants which are defined for use with ISteamMatchmaking.
Navn | Type | Værdi | Beskrivelse |
HSERVERQUERY_INVALID | int | 0xffffffff | |
k_nMaxLobbyKeyLength | int | 255 | Maximum number of characters a lobby metadata key can be. |
k_unFavoriteFlagFavorite | uint32 | 0x01 | This favorite game server entry is for the favorites list. |
k_unFavoriteFlagHistory | uint32 | 0x02 | This favorite game server entry is for the history list. |
k_unFavoriteFlagNone | uint32 | 0x00 | This favorite game server has no flags set. |
STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION | const char * | "SteamMatchMakingServers002" | |
STEAMMATCHMAKING_INTERFACE_VERSION | const char * | "SteamMatchMaking009" | |