docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SteamMatchmaking

    Purpose: Functions for match making services for clients to get to favorites and to operate on game lobbies.

    Inheritance
    object
    SteamMatchmaking
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Steamworks.Interop
    Assembly: Unity.Steamworks.Interop.dll
    Syntax
    public static class SteamMatchmaking

    Methods

    AddFavoriteGame(AppId_t, uint, ushort, ushort, uint, uint)

    adds the game server to the local list; updates the time played of the server if it already exists in the list

    Declaration
    public static int AddFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer)
    Parameters
    Type Name Description
    AppId_t nAppID

    Passed through to ISteamMatchmaking::AddFavoriteGame.

    uint nIP

    Passed through to ISteamMatchmaking::AddFavoriteGame.

    ushort nConnPort

    Passed through to ISteamMatchmaking::AddFavoriteGame.

    ushort nQueryPort

    Passed through to ISteamMatchmaking::AddFavoriteGame.

    uint unFlags

    Passed through to ISteamMatchmaking::AddFavoriteGame.

    uint rTime32LastPlayedOnServer

    Passed through to ISteamMatchmaking::AddFavoriteGame.

    Returns
    Type Description
    int

    The value ISteamMatchmaking::AddFavoriteGame returns.

    AddRequestLobbyListCompatibleMembersFilter(CSteamID)

    Calls the Steamworks ISteamMatchmaking::AddRequestLobbyListCompatibleMembersFilter method.

    Declaration
    public static void AddRequestLobbyListCompatibleMembersFilter(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::AddRequestLobbyListCompatibleMembersFilter.

    AddRequestLobbyListDistanceFilter(ELobbyDistanceFilter)

    sets the distance for which we should search for lobbies (based on users IP address to location map on the Steam backed)

    Declaration
    public static void AddRequestLobbyListDistanceFilter(ELobbyDistanceFilter eLobbyDistanceFilter)
    Parameters
    Type Name Description
    ELobbyDistanceFilter eLobbyDistanceFilter

    Passed through to ISteamMatchmaking::AddRequestLobbyListDistanceFilter.

    AddRequestLobbyListFilterSlotsAvailable(int)

    returns only lobbies with the specified number of slots available

    Declaration
    public static void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable)
    Parameters
    Type Name Description
    int nSlotsAvailable

    Passed through to ISteamMatchmaking::AddRequestLobbyListFilterSlotsAvailable.

    AddRequestLobbyListNearValueFilter(string, int)

    returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence

    Declaration
    public static void AddRequestLobbyListNearValueFilter(string pchKeyToMatch, int nValueToBeCloseTo)
    Parameters
    Type Name Description
    string pchKeyToMatch

    Passed through to ISteamMatchmaking::AddRequestLobbyListNearValueFilter.

    int nValueToBeCloseTo

    Passed through to ISteamMatchmaking::AddRequestLobbyListNearValueFilter.

    AddRequestLobbyListNumericalFilter(string, int, ELobbyComparison)

    numerical comparison

    Declaration
    public static void AddRequestLobbyListNumericalFilter(string pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType)
    Parameters
    Type Name Description
    string pchKeyToMatch

    Passed through to ISteamMatchmaking::AddRequestLobbyListNumericalFilter.

    int nValueToMatch

    Passed through to ISteamMatchmaking::AddRequestLobbyListNumericalFilter.

    ELobbyComparison eComparisonType

    Passed through to ISteamMatchmaking::AddRequestLobbyListNumericalFilter.

    AddRequestLobbyListResultCountFilter(int)

    sets how many results to return, the lower the count the faster it is to download the lobby results & details to the client

    Declaration
    public static void AddRequestLobbyListResultCountFilter(int cMaxResults)
    Parameters
    Type Name Description
    int cMaxResults

    Passed through to ISteamMatchmaking::AddRequestLobbyListResultCountFilter.

    AddRequestLobbyListStringFilter(string, string, ELobbyComparison)

    filters for lobbies this needs to be called before RequestLobbyList() to take effect these are cleared on each call to RequestLobbyList()

    Declaration
    public static void AddRequestLobbyListStringFilter(string pchKeyToMatch, string pchValueToMatch, ELobbyComparison eComparisonType)
    Parameters
    Type Name Description
    string pchKeyToMatch

    Passed through to ISteamMatchmaking::AddRequestLobbyListStringFilter.

    string pchValueToMatch

    Passed through to ISteamMatchmaking::AddRequestLobbyListStringFilter.

    ELobbyComparison eComparisonType

    Passed through to ISteamMatchmaking::AddRequestLobbyListStringFilter.

    CreateLobby(ELobbyType, int)

    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 point a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)

    Declaration
    public static SteamAPICall_t CreateLobby(ELobbyType eLobbyType, int cMaxMembers)
    Parameters
    Type Name Description
    ELobbyType eLobbyType

    Passed through to ISteamMatchmaking::CreateLobby.

    int cMaxMembers

    Passed through to ISteamMatchmaking::CreateLobby.

    Returns
    Type Description
    SteamAPICall_t

    The value ISteamMatchmaking::CreateLobby returns.

    CreateLobbyAsync(ELobbyType, int)

    Async version of CreateLobby(ELobbyType, int).

    Declaration
    public static Task<LobbyCreated_t> CreateLobbyAsync(ELobbyType eLobbyType, int cMaxMembers)
    Parameters
    Type Name Description
    ELobbyType eLobbyType

    Passed through to ISteamMatchmaking::CreateLobby.

    int cMaxMembers

    Passed through to ISteamMatchmaking::CreateLobby.

    Returns
    Type Description
    Task<LobbyCreated_t>

    The LobbyCreated_t Steam reports once the call completes.

    DeleteLobbyData(CSteamID, string)

    removes a metadata key from the lobby

    Declaration
    public static bool DeleteLobbyData(CSteamID steamIDLobby, string pchKey)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::DeleteLobbyData.

    string pchKey

    Passed through to ISteamMatchmaking::DeleteLobbyData.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::DeleteLobbyData returns.

    GetFavoriteGame(int, out AppId_t, out uint, out ushort, out ushort, out uint, out uint)

    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

    Declaration
    public static bool GetFavoriteGame(int iGame, out AppId_t pnAppID, out uint pnIP, out ushort pnConnPort, out ushort pnQueryPort, out uint punFlags, out uint pRTime32LastPlayedOnServer)
    Parameters
    Type Name Description
    int iGame

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    AppId_t pnAppID

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    uint pnIP

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    ushort pnConnPort

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    ushort pnQueryPort

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    uint punFlags

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    uint pRTime32LastPlayedOnServer

    Passed through to ISteamMatchmaking::GetFavoriteGame.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::GetFavoriteGame returns.

    GetFavoriteGameCount()

    game server favorites storage saves basic details about a multiplayer game server locally returns the number of favorites servers the user has stored

    Declaration
    public static int GetFavoriteGameCount()
    Returns
    Type Description
    int

    The value ISteamMatchmaking::GetFavoriteGameCount returns.

    GetLobbyByIndex(int)

    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

    Declaration
    public static CSteamID GetLobbyByIndex(int iLobby)
    Parameters
    Type Name Description
    int iLobby

    Passed through to ISteamMatchmaking::GetLobbyByIndex.

    Returns
    Type Description
    CSteamID

    The value ISteamMatchmaking::GetLobbyByIndex returns.

    GetLobbyChatEntry(CSteamID, int, out CSteamID, byte[], int, out EChatEntryType)

    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

    Declaration
    public static int GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, byte[] pvData, int cubData, out EChatEntryType peChatEntryType)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyChatEntry.

    int iChatID

    Passed through to ISteamMatchmaking::GetLobbyChatEntry.

    CSteamID pSteamIDUser

    Passed through to ISteamMatchmaking::GetLobbyChatEntry.

    byte[] pvData

    Passed through to ISteamMatchmaking::GetLobbyChatEntry.

    int cubData

    Passed through to ISteamMatchmaking::GetLobbyChatEntry.

    EChatEntryType peChatEntryType

    Passed through to ISteamMatchmaking::GetLobbyChatEntry.

    Returns
    Type Description
    int

    The value ISteamMatchmaking::GetLobbyChatEntry returns.

    GetLobbyData(CSteamID, string)

    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

    Declaration
    public static string GetLobbyData(CSteamID steamIDLobby, string pchKey)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyData.

    string pchKey

    Passed through to ISteamMatchmaking::GetLobbyData.

    Returns
    Type Description
    string

    The value ISteamMatchmaking::GetLobbyData returns.

    GetLobbyDataByIndex(CSteamID, int, out string, int, out string, int)

    returns a lobby metadata key/values pair by index, of range [0, GetLobbyDataCount())

    Declaration
    public static bool GetLobbyDataByIndex(CSteamID steamIDLobby, int iLobbyData, out string pchKey, int cchKeyBufferSize, out string pchValue, int cchValueBufferSize)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyDataByIndex.

    int iLobbyData

    Passed through to ISteamMatchmaking::GetLobbyDataByIndex.

    string pchKey

    Receives the string ISteamMatchmaking::GetLobbyDataByIndex writes.

    int cchKeyBufferSize

    Passed through to ISteamMatchmaking::GetLobbyDataByIndex.

    string pchValue

    Receives the string ISteamMatchmaking::GetLobbyDataByIndex writes.

    int cchValueBufferSize

    Passed through to ISteamMatchmaking::GetLobbyDataByIndex.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::GetLobbyDataByIndex returns.

    GetLobbyDataCount(CSteamID)

    returns the number of metadata keys set on the specified lobby

    Declaration
    public static int GetLobbyDataCount(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyDataCount.

    Returns
    Type Description
    int

    The value ISteamMatchmaking::GetLobbyDataCount returns.

    GetLobbyGameServer(CSteamID, out uint, out ushort, out CSteamID)

    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

    Declaration
    public static bool GetLobbyGameServer(CSteamID steamIDLobby, out uint punGameServerIP, out ushort punGameServerPort, out CSteamID psteamIDGameServer)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyGameServer.

    uint punGameServerIP

    Passed through to ISteamMatchmaking::GetLobbyGameServer.

    ushort punGameServerPort

    Passed through to ISteamMatchmaking::GetLobbyGameServer.

    CSteamID psteamIDGameServer

    Passed through to ISteamMatchmaking::GetLobbyGameServer.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::GetLobbyGameServer returns.

    GetLobbyMemberByIndex(CSteamID, int)

    returns the CSteamID of a user in the lobby iMember is of range [0,GetNumLobbyMembers()) note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby

    Declaration
    public static CSteamID GetLobbyMemberByIndex(CSteamID steamIDLobby, int iMember)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyMemberByIndex.

    int iMember

    Passed through to ISteamMatchmaking::GetLobbyMemberByIndex.

    Returns
    Type Description
    CSteamID

    The value ISteamMatchmaking::GetLobbyMemberByIndex returns.

    GetLobbyMemberData(CSteamID, CSteamID, string)

    Gets per-user metadata for someone in this lobby

    Declaration
    public static string GetLobbyMemberData(CSteamID steamIDLobby, CSteamID steamIDUser, string pchKey)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyMemberData.

    CSteamID steamIDUser

    Passed through to ISteamMatchmaking::GetLobbyMemberData.

    string pchKey

    Passed through to ISteamMatchmaking::GetLobbyMemberData.

    Returns
    Type Description
    string

    The value ISteamMatchmaking::GetLobbyMemberData returns.

    GetLobbyMemberLimit(CSteamID)

    returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined

    Declaration
    public static int GetLobbyMemberLimit(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyMemberLimit.

    Returns
    Type Description
    int

    The value ISteamMatchmaking::GetLobbyMemberLimit returns.

    GetLobbyOwner(CSteamID)

    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

    Declaration
    public static CSteamID GetLobbyOwner(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetLobbyOwner.

    Returns
    Type Description
    CSteamID

    The value ISteamMatchmaking::GetLobbyOwner returns.

    GetNumLobbyMembers(CSteamID)

    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

    Declaration
    public static int GetNumLobbyMembers(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::GetNumLobbyMembers.

    Returns
    Type Description
    int

    The value ISteamMatchmaking::GetNumLobbyMembers returns.

    InviteUserToLobby(CSteamID, CSteamID)

    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 if the other user clicks the join link, a GameLobbyJoinRequested_t will be posted if the user is in-game, or if the game isn't running yet the game will be launched with the parameter +connect_lobby <64-bit lobby id>

    Declaration
    public static bool InviteUserToLobby(CSteamID steamIDLobby, CSteamID steamIDInvitee)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::InviteUserToLobby.

    CSteamID steamIDInvitee

    Passed through to ISteamMatchmaking::InviteUserToLobby.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::InviteUserToLobby returns.

    JoinLobby(CSteamID)

    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

    Declaration
    public static SteamAPICall_t JoinLobby(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::JoinLobby.

    Returns
    Type Description
    SteamAPICall_t

    The value ISteamMatchmaking::JoinLobby returns.

    JoinLobbyAsync(CSteamID)

    Async version of JoinLobby(CSteamID).

    Declaration
    public static Task<LobbyEnter_t> JoinLobbyAsync(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::JoinLobby.

    Returns
    Type Description
    Task<LobbyEnter_t>

    The LobbyEnter_t Steam reports once the call completes.

    LeaveLobby(CSteamID)

    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

    Declaration
    public static void LeaveLobby(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::LeaveLobby.

    RemoveFavoriteGame(AppId_t, uint, ushort, ushort, uint)

    removes the game server from the local storage; returns true if one was removed

    Declaration
    public static bool RemoveFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags)
    Parameters
    Type Name Description
    AppId_t nAppID

    Passed through to ISteamMatchmaking::RemoveFavoriteGame.

    uint nIP

    Passed through to ISteamMatchmaking::RemoveFavoriteGame.

    ushort nConnPort

    Passed through to ISteamMatchmaking::RemoveFavoriteGame.

    ushort nQueryPort

    Passed through to ISteamMatchmaking::RemoveFavoriteGame.

    uint unFlags

    Passed through to ISteamMatchmaking::RemoveFavoriteGame.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::RemoveFavoriteGame returns.

    RequestLobbyData(CSteamID)

    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 results will be returned by a LobbyDataUpdate_t callback if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false

    Declaration
    public static bool RequestLobbyData(CSteamID steamIDLobby)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::RequestLobbyData.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::RequestLobbyData returns.

    RequestLobbyList()

    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<CMyLobbyListManager, LobbyMatchList_t> 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 } }

    Declaration
    public static SteamAPICall_t RequestLobbyList()
    Returns
    Type Description
    SteamAPICall_t

    The value ISteamMatchmaking::RequestLobbyList returns.

    RequestLobbyListAsync()

    Async version of RequestLobbyList().

    Declaration
    public static Task<LobbyMatchList_t> RequestLobbyListAsync()
    Returns
    Type Description
    Task<LobbyMatchList_t>

    The LobbyMatchList_t Steam reports once the call completes.

    SendLobbyChatMsg(CSteamID, byte[], int)

    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

    Declaration
    public static bool SendLobbyChatMsg(CSteamID steamIDLobby, byte[] pvMsgBody, int cubMsgBody)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SendLobbyChatMsg.

    byte[] pvMsgBody

    Passed through to ISteamMatchmaking::SendLobbyChatMsg.

    int cubMsgBody

    Passed through to ISteamMatchmaking::SendLobbyChatMsg.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SendLobbyChatMsg returns.

    SetLinkedLobby(CSteamID, CSteamID)

    link two lobbies for the purposes of checking player compatibility you must be the lobby owner of both lobbies

    Declaration
    public static bool SetLinkedLobby(CSteamID steamIDLobby, CSteamID steamIDLobbyDependent)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLinkedLobby.

    CSteamID steamIDLobbyDependent

    Passed through to ISteamMatchmaking::SetLinkedLobby.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SetLinkedLobby returns.

    SetLobbyData(CSteamID, string, string)

    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

    Declaration
    public static bool SetLobbyData(CSteamID steamIDLobby, string pchKey, string pchValue)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyData.

    string pchKey

    Passed through to ISteamMatchmaking::SetLobbyData.

    string pchValue

    Passed through to ISteamMatchmaking::SetLobbyData.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SetLobbyData returns.

    SetLobbyGameServer(CSteamID, uint, ushort, CSteamID)

    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

    Declaration
    public static void SetLobbyGameServer(CSteamID steamIDLobby, uint unGameServerIP, ushort unGameServerPort, CSteamID steamIDGameServer)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyGameServer.

    uint unGameServerIP

    Passed through to ISteamMatchmaking::SetLobbyGameServer.

    ushort unGameServerPort

    Passed through to ISteamMatchmaking::SetLobbyGameServer.

    CSteamID steamIDGameServer

    Passed through to ISteamMatchmaking::SetLobbyGameServer.

    SetLobbyJoinable(CSteamID, bool)

    sets whether or not a lobby is joinable - defaults to true for a new lobby if set to false, no user can join, even if they are a friend or have been invited

    Declaration
    public static bool SetLobbyJoinable(CSteamID steamIDLobby, bool bLobbyJoinable)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyJoinable.

    bool bLobbyJoinable

    Passed through to ISteamMatchmaking::SetLobbyJoinable.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SetLobbyJoinable returns.

    SetLobbyMemberData(CSteamID, string, string)

    Sets per-user metadata (for the local user implicitly)

    Declaration
    public static void SetLobbyMemberData(CSteamID steamIDLobby, string pchKey, string pchValue)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyMemberData.

    string pchKey

    Passed through to ISteamMatchmaking::SetLobbyMemberData.

    string pchValue

    Passed through to ISteamMatchmaking::SetLobbyMemberData.

    SetLobbyMemberLimit(CSteamID, int)

    set the limit on the # of users who can join the lobby

    Declaration
    public static bool SetLobbyMemberLimit(CSteamID steamIDLobby, int cMaxMembers)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyMemberLimit.

    int cMaxMembers

    Passed through to ISteamMatchmaking::SetLobbyMemberLimit.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SetLobbyMemberLimit returns.

    SetLobbyOwner(CSteamID, CSteamID)

    changes who the lobby owner is you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby after completion, the local user will no longer be the owner

    Declaration
    public static bool SetLobbyOwner(CSteamID steamIDLobby, CSteamID steamIDNewOwner)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyOwner.

    CSteamID steamIDNewOwner

    Passed through to ISteamMatchmaking::SetLobbyOwner.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SetLobbyOwner returns.

    SetLobbyType(CSteamID, ELobbyType)

    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

    Declaration
    public static bool SetLobbyType(CSteamID steamIDLobby, ELobbyType eLobbyType)
    Parameters
    Type Name Description
    CSteamID steamIDLobby

    Passed through to ISteamMatchmaking::SetLobbyType.

    ELobbyType eLobbyType

    Passed through to ISteamMatchmaking::SetLobbyType.

    Returns
    Type Description
    bool

    The value ISteamMatchmaking::SetLobbyType returns.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)