docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SteamMatchmakingServers

    Purpose: Functions for match making services for clients to get to game lists and details

    Inheritance
    object
    SteamMatchmakingServers
    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 SteamMatchmakingServers

    Methods

    CancelQuery(HServerListRequest)

    Cancel an request which is operation on the given list type. You should call this to cancel any in-progress requests before destructing a callback object that may have been passed to one of the above list request calls. Not doing so may result in a crash when a callback occurs on the destructed object. Canceling a query does not release the allocated request handle. The request handle must be released using ReleaseRequest( hRequest )

    Declaration
    public static void CancelQuery(HServerListRequest hRequest)
    Parameters
    Type Name Description
    HServerListRequest hRequest

    Passed through to ISteamMatchmakingServers::CancelQuery.

    CancelServerQuery(HServerQuery)

    Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel any in-progress requests before destructing a callback object that may have been passed to one of the above calls to avoid crashing when callbacks occur.

    Declaration
    public static void CancelServerQuery(HServerQuery hServerQuery)
    Parameters
    Type Name Description
    HServerQuery hServerQuery

    Passed through to ISteamMatchmakingServers::CancelServerQuery.

    GetServerCount(HServerListRequest)

    How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1

    Declaration
    public static int GetServerCount(HServerListRequest hRequest)
    Parameters
    Type Name Description
    HServerListRequest hRequest

    Passed through to ISteamMatchmakingServers::GetServerCount.

    Returns
    Type Description
    int

    The value ISteamMatchmakingServers::GetServerCount returns.

    GetServerDetails(HServerListRequest, int)

    the filter operation codes that go in the key part of MatchMakingKeyValuePair_t should be one of these: "map"

    • Server passes the filter if the server is playing the specified map. "gamedataand"
    • Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains all of the specified strings. The value field is a comma-delimited list of strings to match. "gamedataor"
    • Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains at least one of the specified strings. The value field is a comma-delimited list of strings to match. "gamedatanor"
    • Server passes the filter if the server's game data (ISteamGameServer::SetGameData) does not contain any of the specified strings. The value field is a comma-delimited list of strings to check. "gametagsand"
    • Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) contains all of the specified strings. The value field is a comma-delimited list of strings to check. "gametagsnor"
    • Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) does not contain any of the specified strings. The value field is a comma-delimited list of strings to check. "and" (x1 && x2 && ... && xn) "or" (x1 || x2 || ... || xn) "nand" !(x1 && x2 && ... && xn) "nor" !(x1 || x2 || ... || xn)
    • Performs Boolean operation on the following filters. The operand to this filter specifies the "size" of the Boolean inputs to the operation, in Key/value pairs. (The keyvalue pairs must immediately follow, i.e. this is a prefix logical operator notation.) In the simplest case where Boolean expressions are not nested, this is simply the number of operands. For example, to match servers on a particular map or with a particular tag, would would use these filters. ( server.map == "cp_dustbowl" || server.gametags.contains("payload") ) "or", "2" "map", "cp_dustbowl" "gametagsand", "payload" If logical inputs are nested, then the operand specifies the size of the entire "length" of its operands, not the number of immediate children. ( server.map == "cp_dustbowl" || ( server.gametags.contains("payload") && !server.gametags.contains("payloadrace") ) ) "or", "4" "map", "cp_dustbowl" "and", "2" "gametagsand", "payload" "gametagsnor", "payloadrace" Unary NOT can be achieved using either "nand" or "nor" with a single operand. "addr"
    • Server passes the filter if the server's query address matches the specified IP or IP:port. "gameaddr"
    • Server passes the filter if the server's game address matches the specified IP or IP:port. The following filter operations ignore the "value" part of MatchMakingKeyValuePair_t "dedicated"
    • Server passes the filter if it passed true to SetDedicatedServer. "secure"
    • Server passes the filter if the server is VAC-enabled. "notfull"
    • Server passes the filter if the player count is less than the reported max player count. "hasplayers"
    • Server passes the filter if the player count is greater than zero. "noplayers"
    • Server passes the filter if it doesn't have any players. "linux"
    • Server passes the filter if it's a linux server "popularamongfriends"
    • Server passes the filter it is popular among friends whose profiles are not private, the game is not private and friends state is not offline/invisible during play
    • server must not also have set the tag "nofriendshare"
    • and the game must not be opted out of saving/showing coplay data Get details on a given server in the list, you can get the valid range of index values by calling GetServerCount(). You will also receive index values in ISteamMatchmakingServerListResponse::ServerResponded() callbacks
    Declaration
    public static gameserveritem_t GetServerDetails(HServerListRequest hRequest, int iServer)
    Parameters
    Type Name Description
    HServerListRequest hRequest

    Passed through to ISteamMatchmakingServers::GetServerDetails.

    int iServer

    Passed through to ISteamMatchmakingServers::GetServerDetails.

    Returns
    Type Description
    gameserveritem_t

    The value ISteamMatchmakingServers::GetServerDetails returns.

    IsRefreshing(HServerListRequest)

    Returns true if the list is currently refreshing its server list

    Declaration
    public static bool IsRefreshing(HServerListRequest hRequest)
    Parameters
    Type Name Description
    HServerListRequest hRequest

    Passed through to ISteamMatchmakingServers::IsRefreshing.

    Returns
    Type Description
    bool

    The value ISteamMatchmakingServers::IsRefreshing returns.

    PingServer(uint, ushort, ISteamMatchmakingPingResponse)

    Queries to individual servers directly via IP/Port Request updated ping time and other details from a single server

    Declaration
    public static HServerQuery PingServer(uint unIP, ushort usPort, ISteamMatchmakingPingResponse pRequestServersResponse)
    Parameters
    Type Name Description
    uint unIP

    Passed through to ISteamMatchmakingServers::PingServer.

    ushort usPort

    Passed through to ISteamMatchmakingServers::PingServer.

    ISteamMatchmakingPingResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::PingServer.

    Returns
    Type Description
    HServerQuery

    The value ISteamMatchmakingServers::PingServer returns.

    PlayerDetails(uint, ushort, ISteamMatchmakingPlayersResponse)

    Request the list of players currently playing on a server

    Declaration
    public static HServerQuery PlayerDetails(uint unIP, ushort usPort, ISteamMatchmakingPlayersResponse pRequestServersResponse)
    Parameters
    Type Name Description
    uint unIP

    Passed through to ISteamMatchmakingServers::PlayerDetails.

    ushort usPort

    Passed through to ISteamMatchmakingServers::PlayerDetails.

    ISteamMatchmakingPlayersResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::PlayerDetails.

    Returns
    Type Description
    HServerQuery

    The value ISteamMatchmakingServers::PlayerDetails returns.

    RefreshQuery(HServerListRequest)

    Ping every server in your list again but don't update the list of servers Query callback installed when the server list was requested will be used again to post notifications and RefreshComplete, so the callback must remain valid until another RefreshComplete is called on it or the request is released with ReleaseRequest( hRequest )

    Declaration
    public static void RefreshQuery(HServerListRequest hRequest)
    Parameters
    Type Name Description
    HServerListRequest hRequest

    Passed through to ISteamMatchmakingServers::RefreshQuery.

    RefreshServer(HServerListRequest, int)

    Refresh a single server inside of a query (rather than all the servers )

    Declaration
    public static void RefreshServer(HServerListRequest hRequest, int iServer)
    Parameters
    Type Name Description
    HServerListRequest hRequest

    Passed through to ISteamMatchmakingServers::RefreshServer.

    int iServer

    Passed through to ISteamMatchmakingServers::RefreshServer.

    ReleaseRequest(HServerListRequest)

    Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. RefreshComplete callback is not posted when request is released.

    Declaration
    public static void ReleaseRequest(HServerListRequest hServerListRequest)
    Parameters
    Type Name Description
    HServerListRequest hServerListRequest

    Passed through to ISteamMatchmakingServers::ReleaseRequest.

    RequestFavoritesServerList(AppId_t, MatchMakingKeyValuePair_t[], uint, ISteamMatchmakingServerListResponse)

    Calls the Steamworks ISteamMatchmakingServers::RequestFavoritesServerList method.

    Declaration
    public static HServerListRequest RequestFavoritesServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse)
    Parameters
    Type Name Description
    AppId_t iApp

    Passed through to ISteamMatchmakingServers::RequestFavoritesServerList.

    MatchMakingKeyValuePair_t[] ppchFilters

    Passed through to ISteamMatchmakingServers::RequestFavoritesServerList.

    uint nFilters

    Passed through to ISteamMatchmakingServers::RequestFavoritesServerList.

    ISteamMatchmakingServerListResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::RequestFavoritesServerList.

    Returns
    Type Description
    HServerListRequest

    The value ISteamMatchmakingServers::RequestFavoritesServerList returns.

    RequestFriendsServerList(AppId_t, MatchMakingKeyValuePair_t[], uint, ISteamMatchmakingServerListResponse)

    Calls the Steamworks ISteamMatchmakingServers::RequestFriendsServerList method.

    Declaration
    public static HServerListRequest RequestFriendsServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse)
    Parameters
    Type Name Description
    AppId_t iApp

    Passed through to ISteamMatchmakingServers::RequestFriendsServerList.

    MatchMakingKeyValuePair_t[] ppchFilters

    Passed through to ISteamMatchmakingServers::RequestFriendsServerList.

    uint nFilters

    Passed through to ISteamMatchmakingServers::RequestFriendsServerList.

    ISteamMatchmakingServerListResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::RequestFriendsServerList.

    Returns
    Type Description
    HServerListRequest

    The value ISteamMatchmakingServers::RequestFriendsServerList returns.

    RequestHistoryServerList(AppId_t, MatchMakingKeyValuePair_t[], uint, ISteamMatchmakingServerListResponse)

    Calls the Steamworks ISteamMatchmakingServers::RequestHistoryServerList method.

    Declaration
    public static HServerListRequest RequestHistoryServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse)
    Parameters
    Type Name Description
    AppId_t iApp

    Passed through to ISteamMatchmakingServers::RequestHistoryServerList.

    MatchMakingKeyValuePair_t[] ppchFilters

    Passed through to ISteamMatchmakingServers::RequestHistoryServerList.

    uint nFilters

    Passed through to ISteamMatchmakingServers::RequestHistoryServerList.

    ISteamMatchmakingServerListResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::RequestHistoryServerList.

    Returns
    Type Description
    HServerListRequest

    The value ISteamMatchmakingServers::RequestHistoryServerList returns.

    RequestInternetServerList(AppId_t, MatchMakingKeyValuePair_t[], uint, ISteamMatchmakingServerListResponse)

    Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. Each call allocates a new asynchronous request object. Request object must be released by calling ReleaseRequest( hServerListRequest )

    Declaration
    public static HServerListRequest RequestInternetServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse)
    Parameters
    Type Name Description
    AppId_t iApp

    Passed through to ISteamMatchmakingServers::RequestInternetServerList.

    MatchMakingKeyValuePair_t[] ppchFilters

    Passed through to ISteamMatchmakingServers::RequestInternetServerList.

    uint nFilters

    Passed through to ISteamMatchmakingServers::RequestInternetServerList.

    ISteamMatchmakingServerListResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::RequestInternetServerList.

    Returns
    Type Description
    HServerListRequest

    The value ISteamMatchmakingServers::RequestInternetServerList returns.

    RequestLANServerList(AppId_t, ISteamMatchmakingServerListResponse)

    Calls the Steamworks ISteamMatchmakingServers::RequestLANServerList method.

    Declaration
    public static HServerListRequest RequestLANServerList(AppId_t iApp, ISteamMatchmakingServerListResponse pRequestServersResponse)
    Parameters
    Type Name Description
    AppId_t iApp

    Passed through to ISteamMatchmakingServers::RequestLANServerList.

    ISteamMatchmakingServerListResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::RequestLANServerList.

    Returns
    Type Description
    HServerListRequest

    The value ISteamMatchmakingServers::RequestLANServerList returns.

    RequestSpectatorServerList(AppId_t, MatchMakingKeyValuePair_t[], uint, ISteamMatchmakingServerListResponse)

    Calls the Steamworks ISteamMatchmakingServers::RequestSpectatorServerList method.

    Declaration
    public static HServerListRequest RequestSpectatorServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse)
    Parameters
    Type Name Description
    AppId_t iApp

    Passed through to ISteamMatchmakingServers::RequestSpectatorServerList.

    MatchMakingKeyValuePair_t[] ppchFilters

    Passed through to ISteamMatchmakingServers::RequestSpectatorServerList.

    uint nFilters

    Passed through to ISteamMatchmakingServers::RequestSpectatorServerList.

    ISteamMatchmakingServerListResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::RequestSpectatorServerList.

    Returns
    Type Description
    HServerListRequest

    The value ISteamMatchmakingServers::RequestSpectatorServerList returns.

    ServerFriends(uint, ushort, ISteamMatchmakingServerFriendsResponse)

    Request the list of friends that have played on this server

    Declaration
    public static HServerQuery ServerFriends(uint unIP, ushort usPort, ISteamMatchmakingServerFriendsResponse pRequestServersResponse)
    Parameters
    Type Name Description
    uint unIP

    Passed through to ISteamMatchmakingServers::ServerFriends.

    ushort usPort

    Passed through to ISteamMatchmakingServers::ServerFriends.

    ISteamMatchmakingServerFriendsResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::ServerFriends.

    Returns
    Type Description
    HServerQuery

    The value ISteamMatchmakingServers::ServerFriends returns.

    ServerRules(uint, ushort, ISteamMatchmakingRulesResponse)

    Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side)

    Declaration
    public static HServerQuery ServerRules(uint unIP, ushort usPort, ISteamMatchmakingRulesResponse pRequestServersResponse)
    Parameters
    Type Name Description
    uint unIP

    Passed through to ISteamMatchmakingServers::ServerRules.

    ushort usPort

    Passed through to ISteamMatchmakingServers::ServerRules.

    ISteamMatchmakingRulesResponse pRequestServersResponse

    Passed through to ISteamMatchmakingServers::ServerRules.

    Returns
    Type Description
    HServerQuery

    The value ISteamMatchmakingServers::ServerRules 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)