Steamworks-dokumentation
ISteamMatchmaking-grænseflade
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 );
NavnTypeBeskrivelse
nAppIDAppId_tSpillets app-ID.
nIPuint32IP-adressen på serveren i værtsrækkefølge, dvs. 127.0.0.1 == 0x7f000001.
nConnPortuint16Den port, der bruges til at oprette forbindelse til serveren, i værtsrækkefølge.
nQueryPortuint16Den port, der bruges til at forespørge serveren, i værtsrækkefølge.
unFlagsuint32Angiver, om serveren skal føjes til listen over foretrukne eller historiklisten. Se k_unFavoriteFlagNone for flere oplysninger.
rTime32LastPlayedOnServeruint32Dette 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamID

Ubrugt – tjekker efter spillerkompatibilitet baseret på "frenemy"-systemet.

AddRequestLobbyListDistanceFilter

void AddRequestLobbyListDistanceFilter( ELobbyDistanceFilter eLobbyDistanceFilter );
NavnTypeBeskrivelse
eLobbyDistanceFilterELobbyDistanceFilterAngiver den maksimale afstand.

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 );
NavnTypeBeskrivelse
nSlotsAvailableintAntallet 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 );
NavnTypeBeskrivelse
pchKeyToMatchconst char *Filtrets nøglenavn, som skal matches. Dette må ikke være længere end k_nMaxLobbyKeyLength.
nValueToBeCloseTointVæ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 );
NavnTypeBeskrivelse
pchKeyToMatchconst char *Filtrets nøglenavn, som skal matches. Dette må ikke være længere end k_nMaxLobbyKeyLength.
nValueToMatchintAntallet, som skal matches.
eComparisonTypeELobbyComparisonDen type sammenligning, der skal foretages.

Tilføjer et numerisk sammenligningsfilter til næste RequestLobbyList-kald.

AddRequestLobbyListResultCountFilter

void AddRequestLobbyListResultCountFilter( int cMaxResults );
NavnTypeBeskrivelse
cMaxResultsintDet 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 );
NavnTypeBeskrivelse
pchKeyToMatchconst char *Filtrets nøglenavn, som skal matches. Dette må ikke være længere end k_nMaxLobbyKeyLength.
pchValueToMatchconst char *Strengen, som skal matches.
eComparisonTypeELobbyComparisonDen type sammenligning, der skal foretages.

Tilføjer et strengsammenligningsfilter til næste RequestLobbyList-kald.

CheckForPSNGameBootInvite

void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes );
NavnTypeBeskrivelse
iGameBootAttributesunsigned int

Forældet – kun PS3.

CreateLobby

SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers );
NavnTypeBeskrivelse
eLobbyTypeELobbyTypeLobbyens type og synlighed. Dette kan ændres senere via SetLobbyType.
cMaxMembersintDet 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDSteam-ID'et på lobbyen, som metadataene skal slettes fra.
pchKeyconst 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 );
NavnTypeBeskrivelse
iGameintIndekset for den foretrukne spilserver, som der skal hentes detaljer om. Dette skal være mellem 0 og GetFavoriteGameCount.
pnAppIDAppId_t *Returnerer app-ID'et, denne server er til.
pnIPuint32 *Returnerer IP-adressen på serveren i værtsrækkefølge, dvs. 127.0.0.1 == 0x7f000001.
pnConnPortuint16 *Returnerer porten, der bruges til at oprette forbindelse til serveren, i værtsrækkefølge.
pnQueryPortuint16 *Returnerer porten, der bruges til at forespørge serveren, i værtsrækkefølge.
punFlagsuint32 *Returnerer, om serveren er på til listen over foretrukne eller historiklisten. Se k_unFavoriteFlagNone for flere oplysninger.
pRTime32LastPlayedOnServeruint32 *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, RemoveFavoriteGame

GetFavoriteGameCount

int GetFavoriteGameCount();
Henter antallet af foretrukne og seneste spilservere, som brugeren har gemt lokalt.

Returværdier: int


Se også: AddFavoriteGame, RemoveFavoriteGame

GetLobbyByIndex

CSteamID GetLobbyByIndex( int iLobby );
NavnTypeBeskrivelse
iLobbyintIndekset 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: CSteamID
Returns 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDSteam-ID'et på lobbyen, som chatbeskeden skal hentes fra. Dette skal næsten altid være LobbyChatMsg_t::m_ulSteamIDUser.
iChatIDintIndekset tilhørende chatbeskeden i lobbyen. Dette skal næsten altid være LobbyChatMsg_t::m_iChatID.
pSteamIDUserCSteamID *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.
pvDatavoid *Returnerer beskedens data ved at kopiere dem over i denne buffer. This buffer should be up to 4 Kilobytes.
cubDataintStørrelsen af bufferen, som er allokeret til pvData.
peChatEntryTypeEChatEntryType *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å: SendLobbyChatMsg

GetLobbyData

const char * GetLobbyData( CSteamID steamIDLobby, const char *pchKey );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDSteam-ID'et på lobbyen, som metadataene skal hentes fra.
pchKeyconst 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThis MUST be the same lobby used in the previous call to GetLobbyDataCount!
iLobbyDataintAn index between 0 and GetLobbyDataCount.
pchKeychar *Returns the name of the key at the specified index by copying it into this buffer.
cchKeyBufferSizeintThe size of the buffer allocated for pchKey. This typically should be k_nMaxLobbyKeyLength.
pchValuechar *Returns the value associated with the key at the specified index by copying it into this buffer.
cchValueBufferSizeintThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDSteam-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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to get the game server information from.
punGameServerIPuint32 *Returns the IP address of the game server, in host order, i.e 127.0.0.1 == 0x7f000001, if it's set.
punGameServerPortuint16 *Returns the connection port of the game server, in host order, if it's set.
psteamIDGameServerCSteamID *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å: SetLobbyGameServer

GetLobbyMemberByIndex

CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThis MUST be the same lobby used in the previous call to GetNumLobbyMembers!
iMemberintAn index between 0 and GetNumLobbyMembers.

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: CSteamID
Ugyldige indekser returnerer k_steamIDNil.

GetLobbyMemberData

const char * GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDSteam-ID'et på lobbyen, som den anden spiller er i.
steamIDUserCSteamIDSteam-ID'et på spilleren, som metadataene skal hentes fra.
pchKeyconst 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å: SetLobbyMemberData

GetLobbyMemberLimit

int GetLobbyMemberLimit( CSteamID steamIDLobby );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDSteam-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: CSteamID
Returnerer k_steamIDNil, hvis du ikke er i lobbyen.

Se også: SetLobbyOwner

GetNumLobbyMembers

int GetNumLobbyMembers( CSteamID steamIDLobby );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to invite the user to.
steamIDInviteeCSteamIDThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDDen 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 );
NavnTypeBeskrivelse
nAppIDAppId_tSpillets app-ID.
nIPuint32The IP address of the server in host order, i.e 127.0.0.1 == 0x7f000001.
nConnPortuint16The port used to connect to the server, in host order.
nQueryPortuint16The port used to query the server, in host order.
unFlagsuint32Whether 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe 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, AddRequestLobbyListResultCountFilter

Eksempel:
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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to send the chat message to.
pvMsgBodyconst void *This can be text or binary data, up to 4 Kilobytes in size.
cubMsgBodyintThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the primary lobby.
steamIDLobbyDependentCSteamIDThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to set the metadata for.
pchKeyconst char *The key to set the data for. This can not be longer than k_nMaxLobbyKeyLength.
pchValueconst 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to set the game server information for.
unGameServerIPuint32Sets the IP address of the game server, in host order, i.e 127.0.0.1 == 0x7f000001.
unGameServerPortuint16Sets the connection port of the game server, in host order.
steamIDGameServerCSteamIDSets 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å: GetLobbyGameServer

SetLobbyJoinable

bool SetLobbyJoinable( CSteamID steamIDLobby, bool bLobbyJoinable );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby
bLobbyJoinableboolEnable (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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to set our metadata in.
pchKeyconst char *The key to set the data for. This can not be longer than k_nMaxLobbyKeyLength.
pchValueconst 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å: GetLobbyMemberData

SetLobbyMemberLimit

bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to set the member limit for.
cMaxMembersintThe 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 );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby where the owner change will take place.
steamIDNewOwnerCSteamIDThe 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å: GetLobbyOwner

SetLobbyType

bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType );
NavnTypeBeskrivelse
steamIDLobbyCSteamIDThe Steam ID of the lobby to set the type of.
eLobbyTypeELobbyTypeThe 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



NavnTypeBeskrivelse
m_eResultEResult

FavoritesListChanged_t

A server was added/removed from the favorites list, you should refresh now.

NavnTypeBeskrivelse
m_nIPuint32An 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_nQueryPortuint32If m_nIP is set then this is the new servers query port, in host order.
m_nConnPortuint32If m_nIP is set then this is the new servers connection port, in host order.
m_nAppIDuint32If m_nIP is set then this is the App ID the game server belongs to.
m_nFlagsuint32If 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_bAddboolIf m_nIP is set then this is whether the server was added to the list (true) or removed (false) from it.
m_unAccountIdAccountID_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.

NavnTypeBeskrivelse
m_ulSteamIDLobbyuint64The Steam ID of the lobby this message was sent in.
m_ulSteamIDUseruint64Steam ID of the user who sent this message. Note that it could have been the local user.
m_eChatEntryTypeuint8Type of message received. This is actually a EChatEntryType.
m_iChatIDuint32The 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: SendLobbyChatMsg

LobbyChatUpdate_t

A lobby chat room state has changed, this is usually sent when a user has joined or left the lobby.

NavnTypeBeskrivelse
m_ulSteamIDLobbyuint64The Steam ID of the lobby.
m_ulSteamIDUserChangeduint64The user who's status in the lobby just changed - can be recipient.
m_ulSteamIDMakingChangeuint64Chat 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_rgfChatMemberStateChangeuint32Bitfield 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).

NavnTypeBeskrivelse
m_eResultEResultResultatet af handlingen.

Mulige værdier:
m_ulSteamIDLobbyuint64The Steam ID of the lobby that was created, 0 if failed.

Tilknyttede funktioner: CreateLobby

LobbyDataUpdate_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.

NavnTypeBeskrivelse
m_ulSteamIDLobbyuint64The Steam ID of the Lobby.
m_ulSteamIDMemberuint64Steam ID of either the member whose data changed, or the room itself.
m_bSuccessuint8true if the lobby data was successfully changed, otherwise false.

Tilknyttede funktioner: CreateLobby, JoinLobby, SetLobbyMemberData, RequestLobbyData, SetLobbyOwner

LobbyEnter_t

Recieved upon attempting to enter a lobby. Lobby metadata is available to use immediately after receiving this.

NavnTypeBeskrivelse
m_ulSteamIDLobbyuint64The steam ID of the Lobby you have entered.
m_rgfChatPermissionsuint32Unused - Always 0.
m_bLockedboolIf true, then only invited users may join.
m_EChatRoomEnterResponseuint32This is actually a EChatRoomEnterResponse value. This will be set to k_EChatRoomEnterResponseSuccess if the lobby was successfully joined, otherwise it will be k_EChatRoomEnterResponseError.

Tilknyttede funktioner: CreateLobby, JoinLobby

LobbyGameCreated_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.

NavnTypeBeskrivelse
m_ulSteamIDLobbyuint64The lobby that set the game server.
m_ulSteamIDGameServeruint64The Steam ID of the game server, if it's set.
m_unIPuint32The IP address of the game server in host order, i.e 127.0.0.1 == 0x7f000001, if it's set.
m_usPortuint16The connection port of the game server, in host order, if it's set.

Tilknyttede funktioner: SetLobbyGameServer

LobbyInvite_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.

NavnTypeBeskrivelse
m_ulSteamIDUseruint64Steam ID of the person that sent the invite.
m_ulSteamIDLobbyuint64Steam ID of the lobby we're invited to.
m_ulGameIDuint64Game 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.

NavnTypeBeskrivelse
m_ulSteamIDLobbyuint64
m_ulSteamIDAdminuint64
m_bKickedDueToDisconnectuint8

LobbyMatchList_t

Result when requesting the lobby list. You should iterate over the returned lobbies with GetLobbyByIndex, from 0 to m_nLobbiesMatching-1.

NavnTypeBeskrivelse
m_nLobbiesMatchinguint32Number of lobbies that matched search criteria and we have Steam IDs for.

Tilknyttede funktioner: RequestLobbyList

PSNGameBootInviteResult_t

Forældet – kun PS3.

NavnTypeBeskrivelse
m_bGameBootInviteExistsbool
m_steamIDLobbyCSteamID

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.

NavnVærdiBeskrivelse
k_EChatMemberStateChangeEntered0x0001This user has joined or is joining the lobby.
k_EChatMemberStateChangeLeft0x0002This user has left or is leaving the lobby.
k_EChatMemberStateChangeDisconnected0x0004User disconnected without leaving the lobby first.
k_EChatMemberStateChangeKicked0x0008The user has been kicked.
k_EChatMemberStateChangeBanned0x0010The user has been kicked and banned.

ELobbyComparison

Lobby search filter options. These can be set with AddRequestLobbyListStringFilter and AddRequestLobbyListNearValueFilter.

NavnVærdiBeskrivelse
k_ELobbyComparisonEqualToOrLessThan-2The lobbies value must be equal to or less than this one.
k_ELobbyComparisonLessThan-1The lobbies value must be less than this one.
k_ELobbyComparisonEqual0The lobbies value must match this this one exactly.
k_ELobbyComparisonGreaterThan1The lobbies value must be greater than this one.
k_ELobbyComparisonEqualToOrGreaterThan2The lobbies value must be equal to or greater than this one.
k_ELobbyComparisonNotEqual3The 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.

NavnVærdiBeskrivelse
k_ELobbyDistanceFilterClose0Only lobbies in the same immediate region will be returned.
k_ELobbyDistanceFilterDefault1Only lobbies in the same region or nearby regions will be returned.
k_ELobbyDistanceFilterFar2For games that don't have many latency requirements, will return lobbies about half-way around the globe.
k_ELobbyDistanceFilterWorldwide3No 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.

NavnVærdiBeskrivelse
k_ELobbyTypePrivate0The only way to join the lobby is from an invite.
k_ELobbyTypeFriendsOnly1Joinable by friends and invitees, but does not show up in the lobby list.
k_ELobbyTypePublic2Returned by search and visible to friends.
k_ELobbyTypeInvisible3Returned 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.

NavnBasistypeBeskrivelse
HServerListRequestvoid*Handle that you will receive when requesting server list.
HServerQueryintHandle that you will receive when querying details on an individual server.

Konstanter

These are constants which are defined for use with ISteamMatchmaking.

NavnTypeVærdiBeskrivelse
HSERVERQUERY_INVALIDint0xffffffff
k_nMaxLobbyKeyLengthint255Maximum number of characters a lobby metadata key can be.
k_unFavoriteFlagFavoriteuint320x01This favorite game server entry is for the favorites list.
k_unFavoriteFlagHistoryuint320x02This favorite game server entry is for the history list.
k_unFavoriteFlagNoneuint320x00This favorite game server has no flags set.
STEAMMATCHMAKINGSERVERS_INTERFACE_VERSIONconst char *"SteamMatchMakingServers002"
STEAMMATCHMAKING_INTERFACE_VERSIONconst char *"SteamMatchMaking009"