ISteamMatchmaking

Note

This documentation is auto-generated. Methods marked with 🤖 are automatically generated bindings. Methods marked with ✍️ are manually implemented and methods marked with ✋ are currently not implemented.

List of Functions

List of Callbacks

Function Reference

Matchmaking.AddFavoriteGame(nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer)

🤖 Auto-generated binding

Parameters:
  • nAppID (int - AppId_t) –

  • nIP (int) –

  • nConnPort (int) –

  • nQueryPort (int) –

  • unFlags (int) –

  • rTime32LastPlayedOnServer (int) –

Returns:

(int) Return value

SteamWorks:

AddFavoriteGame

Matchmaking.AddRequestLobbyListCompatibleMembersFilter(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

SteamWorks:

AddRequestLobbyListCompatibleMembersFilter

Matchmaking.AddRequestLobbyListDistanceFilter(eLobbyDistanceFilter)

🤖 Auto-generated binding

Parameters:

eLobbyDistanceFilter (int - ELobbyDistanceFilter) –

SteamWorks:

AddRequestLobbyListDistanceFilter

Matchmaking.AddRequestLobbyListFilterSlotsAvailable(nSlotsAvailable)

🤖 Auto-generated binding

Parameters:

nSlotsAvailable (int) –

SteamWorks:

AddRequestLobbyListFilterSlotsAvailable

Matchmaking.AddRequestLobbyListNearValueFilter(pchKeyToMatch, nValueToBeCloseTo)

🤖 Auto-generated binding

Parameters:
  • pchKeyToMatch (str?) –

  • nValueToBeCloseTo (int) –

SteamWorks:

AddRequestLobbyListNearValueFilter

Matchmaking.AddRequestLobbyListNumericalFilter(pchKeyToMatch, nValueToMatch, eComparisonType)

🤖 Auto-generated binding

Parameters:
  • pchKeyToMatch (str?) –

  • nValueToMatch (int) –

  • eComparisonType (int - ELobbyComparison) –

SteamWorks:

AddRequestLobbyListNumericalFilter

Matchmaking.AddRequestLobbyListResultCountFilter(cMaxResults)

🤖 Auto-generated binding

Parameters:

cMaxResults (int) –

SteamWorks:

AddRequestLobbyListResultCountFilter

Notes:

  • See MatchMaking.RequestLobbyList()’s example.

Matchmaking.AddRequestLobbyListStringFilter(pchKeyToMatch, pchValueToMatch, eComparisonType)

🤖 Auto-generated binding

Parameters:
  • pchKeyToMatch (str?) –

  • pchValueToMatch (str?) –

  • eComparisonType (int - ELobbyComparison) –

SteamWorks:

AddRequestLobbyListStringFilter

Notes:

  • See MatchMaking.RequestLobbyList()’s example.

Matchmaking.CreateLobby(eLobbyType, cMaxMembers, callback)

🤖 Auto-generated binding

Parameters:
  • eLobbyType (int - ELobbyType) –

  • cMaxMembers (int) –

  • callback (function) – CallResult callback receiving struct LobbyCreated_t and a boolean

Returns:

(uint64) SteamAPICall_t handle for this async call. The result is delivered via the callback parameter when Steam.RunCallbacks() is called.

SteamWorks:

CreateLobby

Example:

Steam.Matchmaking.CreateLobby(Steam.k_ELobbyTypePublic, 8, function(data, err)
    if err or data.m_eResult ~= Steam.k_EResultOK then
        print('Failed to create lobby')
        return
    end
    local lobbyID = data.m_ulSteamIDLobby
    Steam.Matchmaking.SetLobbyData(lobbyID, 'map', 'level_01')
    Steam.Matchmaking.SetLobbyData(lobbyID, 'mode', 'deathmatch')
end)
Matchmaking.DeleteLobbyData(steamIDLobby, pchKey)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • pchKey (str?) –

Returns:

(bool) Return value

SteamWorks:

DeleteLobbyData

Matchmaking.GetFavoriteGame(iGame)

🤖 Auto-generated binding

Parameters:

iGame (int) –

Returns:

(bool) Return value

Returns:

(int) pnAppID

Returns:

(int) pnIP

Returns:

(int) pnConnPort

Returns:

(int) pnQueryPort

Returns:

(int) punFlags

Returns:

(int) pRTime32LastPlayedOnServer

SteamWorks:

GetFavoriteGame

Signature differences from C++ API:

  • Parameter pnAppID is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pnIP is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pnConnPort is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pnQueryPort is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter punFlags is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pRTime32LastPlayedOnServer is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

Example:

local nGames = Steam.Matchmaking.GetFavoriteGameCount()
for i = 0, nGames - 1 do
    local ok, pnAppID, _, _, _, _, _ = Steam.Matchmaking.GetFavoriteGame(i)
    print("Favorite game", i, pnAppID)
end
Matchmaking.GetFavoriteGameCount()

🤖 Auto-generated binding

Returns:

(int) Return value

SteamWorks:

GetFavoriteGameCount

Notes:

  • See MatchMaking.GetFavoriteGame()’s example.

Matchmaking.GetLobbyByIndex(iLobby)

🤖 Auto-generated binding

Parameters:

iLobby (int) –

Returns:

(uint64 - CSteamID) Return value

SteamWorks:

GetLobbyByIndex

Notes:

  • See MatchMaking.RequestLobbyList()’s example.

Matchmaking.GetLobbyChatEntry(steamIDLobby, iChatID, cubData)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • iChatID (int) –

  • cubData (int?) – size of the buffer to allocate for pvData. If nil then the buffer will be NULL.

Returns:

(int) Return value

Returns:

(uint64) pSteamIDUser

Returns:

(str) pvData

Returns:

(int) peChatEntryType

SteamWorks:

GetLobbyChatEntry

Signature differences from C++ API:

  • Parameter pSteamIDUser is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pvData is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter peChatEntryType is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

Matchmaking.GetLobbyData(steamIDLobby, pchKey)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • pchKey (str?) –

Returns:

(str) Return value

SteamWorks:

GetLobbyData

Example:

local map = Steam.Matchmaking.GetLobbyData(lobbyID, 'map')
print('Current map:', map)
Matchmaking.GetLobbyDataByIndex(steamIDLobby, iLobbyData, cchKeyBufferSize, cchValueBufferSize)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • iLobbyData (int) –

  • cchKeyBufferSize (int?) – size of the buffer to allocate for pchKey. If nil then the buffer will be NULL.

  • cchValueBufferSize (int?) – size of the buffer to allocate for pchValue. If nil then the buffer will be NULL.

Returns:

(bool) Return value

Returns:

(str) pchKey

Returns:

(str) pchValue

SteamWorks:

GetLobbyDataByIndex

Signature differences from C++ API:

  • Parameter pchKey is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter pchValue is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

Matchmaking.GetLobbyDataCount(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

Returns:

(int) Return value

SteamWorks:

GetLobbyDataCount

Matchmaking.GetLobbyGameServer(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

Returns:

(bool) Return value

Returns:

(int) punGameServerIP

Returns:

(int) punGameServerPort

Returns:

(uint64) psteamIDGameServer

SteamWorks:

GetLobbyGameServer

Signature differences from C++ API:

  • Parameter punGameServerIP is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter punGameServerPort is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

  • Parameter psteamIDGameServer is not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.

Example:

local hasServer, ip, port, steamID = Steam.Matchmaking.GetLobbyGameServer(lobbyID)
if hasServer then
    connectToGameServer(ip, port)
end
Matchmaking.GetLobbyMemberByIndex(steamIDLobby, iMember)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • iMember (int) –

Returns:

(uint64 - CSteamID) Return value

SteamWorks:

GetLobbyMemberByIndex

Notes:

  • See MatchMaking.GetNumLobbyMembers()’s example.

Matchmaking.GetLobbyMemberData(steamIDLobby, steamIDUser, pchKey)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • steamIDUser (uint64 - CSteamID) –

  • pchKey (str?) –

Returns:

(str) Return value

SteamWorks:

GetLobbyMemberData

Example:

local team = Steam.Matchmaking.GetLobbyMemberData(lobbyID, memberSteamID, 'team')
print('Member team:', team)
Matchmaking.GetLobbyMemberLimit(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

Returns:

(int) Return value

SteamWorks:

GetLobbyMemberLimit

Matchmaking.GetLobbyOwner(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

Returns:

(uint64 - CSteamID) Return value

SteamWorks:

GetLobbyOwner

Example:

local ownerID = Steam.Matchmaking.GetLobbyOwner(lobbyID)
local isOwner = ownerID == Steam.User.GetSteamID()
Matchmaking.GetNumLobbyMembers(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

Returns:

(int) Return value

SteamWorks:

GetNumLobbyMembers

Example:

local count = Steam.Matchmaking.GetNumLobbyMembers(lobbyID)
for i = 0, count - 1 do
    local memberID = Steam.Matchmaking.GetLobbyMemberByIndex(lobbyID, i)
    print('Member:', Steam.Friends.GetFriendPersonaName(memberID))
end
Matchmaking.InviteUserToLobby(steamIDLobby, steamIDInvitee)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • steamIDInvitee (uint64 - CSteamID) –

Returns:

(bool) Return value

SteamWorks:

InviteUserToLobby

Example:

Steam.Matchmaking.InviteUserToLobby(lobbyID, friendSteamID)
Matchmaking.JoinLobby(steamIDLobby, callback)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • callback (function) – CallResult callback receiving struct LobbyEnter_t and a boolean

Returns:

(uint64) SteamAPICall_t handle for this async call. The result is delivered via the callback parameter when Steam.RunCallbacks() is called.

SteamWorks:

JoinLobby

Example:

Steam.Matchmaking.JoinLobby(lobbyID, function(data, err)
    if err or data.m_EChatRoomEnterResponse ~= 1 then
        print('Failed to join lobby')
    else
        print('Joined lobby:', tostring(data.m_ulSteamIDLobby))
    end
end)
Matchmaking.LeaveLobby(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

SteamWorks:

LeaveLobby

Example:

Steam.Matchmaking.LeaveLobby(lobbyID)
Matchmaking.RemoveFavoriteGame(nAppID, nIP, nConnPort, nQueryPort, unFlags)

🤖 Auto-generated binding

Parameters:
  • nAppID (int - AppId_t) –

  • nIP (int) –

  • nConnPort (int) –

  • nQueryPort (int) –

  • unFlags (int) –

Returns:

(bool) Return value

SteamWorks:

RemoveFavoriteGame

Matchmaking.RequestLobbyData(steamIDLobby)

🤖 Auto-generated binding

Parameters:

steamIDLobby (uint64 - CSteamID) –

Returns:

(bool) Return value

SteamWorks:

RequestLobbyData

Matchmaking.RequestLobbyList(callback)

🤖 Auto-generated binding

Parameters:

callback (function) – CallResult callback receiving struct LobbyMatchList_t and a boolean

Returns:

(uint64) SteamAPICall_t handle for this async call. The result is delivered via the callback parameter when Steam.RunCallbacks() is called.

SteamWorks:

RequestLobbyList

Example:

Steam.Matchmaking.AddRequestLobbyListStringFilter('map', 'level_01', Steam.k_ELobbyComparisonEqualToOrLessThan)
Steam.Matchmaking.AddRequestLobbyListResultCountFilter(20)
Steam.Matchmaking.RequestLobbyList(function(data, err)
    if not err then
        for i = 0, data.m_nLobbiesMatching - 1 do
            local id = Steam.Matchmaking.GetLobbyByIndex(i)
            local map = Steam.Matchmaking.GetLobbyData(id, 'map')
            print('Lobby: ' .. map .. ' (' .. Steam.Matchmaking.GetNumLobbyMembers(id) .. ' players)')
        end
    end
end)
Matchmaking.SendLobbyChatMsg(steamIDLobby, pvMsgBody, cubMsgBody)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • pvMsgBody (str?) –

  • cubMsgBody (int) – size of the input array pvMsgBody

Returns:

(bool) Return value

SteamWorks:

SendLobbyChatMsg

Example:

local msg = 'Ready!'
Steam.Matchmaking.SendLobbyChatMsg(lobbyID, msg, #msg)
Matchmaking.SetLinkedLobby(steamIDLobby, steamIDLobbyDependent)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • steamIDLobbyDependent (uint64 - CSteamID) –

Returns:

(bool) Return value

SteamWorks:

SetLinkedLobby

Matchmaking.SetLobbyData(steamIDLobby, pchKey, pchValue)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • pchKey (str?) –

  • pchValue (str?) –

Returns:

(bool) Return value

SteamWorks:

SetLobbyData

Example:

Steam.Matchmaking.SetLobbyData(lobbyID, 'map', 'dungeon_01')
Steam.Matchmaking.SetLobbyData(lobbyID, 'players', tostring(playerCount))
Matchmaking.SetLobbyGameServer(steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • unGameServerIP (int) –

  • unGameServerPort (int) –

  • steamIDGameServer (uint64 - CSteamID) –

SteamWorks:

SetLobbyGameServer

Example:

Steam.Matchmaking.SetLobbyGameServer(lobbyID, serverIP, serverPort, Steam.GameServer.GetSteamID())
Matchmaking.SetLobbyJoinable(steamIDLobby, bLobbyJoinable)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • bLobbyJoinable (bool) –

Returns:

(bool) Return value

SteamWorks:

SetLobbyJoinable

Example:

-- Lock the lobby when the game starts
Steam.Matchmaking.SetLobbyJoinable(lobbyID, false)
Matchmaking.SetLobbyMemberData(steamIDLobby, pchKey, pchValue)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • pchKey (str?) –

  • pchValue (str?) –

SteamWorks:

SetLobbyMemberData

Example:

-- Set per-player data visible to other lobby members
Steam.Matchmaking.SetLobbyMemberData(lobbyID, 'team', 'blue')
Steam.Matchmaking.SetLobbyMemberData(lobbyID, 'ready', '1')
Matchmaking.SetLobbyMemberLimit(steamIDLobby, cMaxMembers)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • cMaxMembers (int) –

Returns:

(bool) Return value

SteamWorks:

SetLobbyMemberLimit

Matchmaking.SetLobbyOwner(steamIDLobby, steamIDNewOwner)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • steamIDNewOwner (uint64 - CSteamID) –

Returns:

(bool) Return value

SteamWorks:

SetLobbyOwner

Matchmaking.SetLobbyType(steamIDLobby, eLobbyType)

🤖 Auto-generated binding

Parameters:
  • steamIDLobby (uint64 - CSteamID) –

  • eLobbyType (int - ELobbyType) –

Returns:

(bool) Return value

SteamWorks:

SetLobbyType

Callbacks

Matchmaking.OnFavoritesListChanged()

Callback for FavoritesListChanged_t

callback(data) receives:

  • data.m_nIP (int)

  • data.m_nQueryPort (int)

  • data.m_nConnPort (int)

  • data.m_nAppID (int)

  • data.m_nFlags (int)

  • data.m_bAdd (bool)

  • data.m_unAccountId (int - AccountID_t)

Matchmaking.OnLobbyInvite()

Callback for LobbyInvite_t

callback(data) receives:

  • data.m_ulSteamIDUser (uint64)

  • data.m_ulSteamIDLobby (uint64)

  • data.m_ulGameID (uint64)

Example:

function Steam.Matchmaking.OnLobbyInvite(data)
    local name = Steam.Friends.GetFriendPersonaName(data.m_ulSteamIDUser)
    print(name .. ' invited you to a lobby')
    showJoinPrompt(data.m_ulSteamIDLobby)
end
Matchmaking.OnLobbyEnter()

Callback for LobbyEnter_t

callback(data) receives:

  • data.m_ulSteamIDLobby (uint64)

  • data.m_rgfChatPermissions (int)

  • data.m_bLocked (bool)

  • data.m_EChatRoomEnterResponse (int)

Example:

function Steam.Matchmaking.OnLobbyEnter(data)
    if data.m_EChatRoomEnterResponse == 1 then
        print('Entered lobby:', tostring(data.m_ulSteamIDLobby))
        updateLobbyUI(data.m_ulSteamIDLobby)
    end
end
Matchmaking.OnLobbyDataUpdate()

Callback for LobbyDataUpdate_t

callback(data) receives:

  • data.m_ulSteamIDLobby (uint64)

  • data.m_ulSteamIDMember (uint64)

  • data.m_bSuccess (int)

Example:

function Steam.Matchmaking.OnLobbyDataUpdate(data)
    if data.m_bSuccess ~= 0 then
        local map = Steam.Matchmaking.GetLobbyData(data.m_ulSteamIDLobby, 'map')
        print('Lobby data updated, map:', map)
    end
end
Matchmaking.OnLobbyChatUpdate()

Callback for LobbyChatUpdate_t

callback(data) receives:

  • data.m_ulSteamIDLobby (uint64)

  • data.m_ulSteamIDUserChanged (uint64)

  • data.m_ulSteamIDMakingChange (uint64)

  • data.m_rgfChatMemberStateChange (int)

Example:

function Steam.Matchmaking.OnLobbyChatUpdate(data)
    local count = Steam.Matchmaking.GetNumLobbyMembers(data.m_ulSteamIDLobby)
    print('Lobby membership changed, now', count, 'players')
end
Matchmaking.OnLobbyChatMsg()

Callback for LobbyChatMsg_t

callback(data) receives:

  • data.m_ulSteamIDLobby (uint64)

  • data.m_ulSteamIDUser (uint64)

  • data.m_eChatEntryType (int)

  • data.m_iChatID (int)

Example:

function Steam.Matchmaking.OnLobbyChatMsg(data)
    local msg, chatType = Steam.Matchmaking.GetLobbyChatEntry(data.m_ulSteamIDLobby, data.m_iChatID, 512)
    if msg then
        local name = Steam.Friends.GetFriendPersonaName(data.m_ulSteamIDUser)
        print(name .. ': ' .. msg)
    end
end
Matchmaking.OnLobbyGameCreated()

Callback for LobbyGameCreated_t

callback(data) receives:

  • data.m_ulSteamIDLobby (uint64)

  • data.m_ulSteamIDGameServer (uint64)

  • data.m_unIP (int)

  • data.m_usPort (int)

Example:

function Steam.Matchmaking.OnLobbyGameCreated(data)
    print('Game server created:', data.m_ulSteamIDGameServer)
    connectToGameServer(data.m_unIP, data.m_usPort)
end
Matchmaking.OnLobbyMatchList()

Callback for LobbyMatchList_t

callback(data) receives:

  • data.m_nLobbiesMatching (int)

Matchmaking.OnLobbyKicked()

Callback for LobbyKicked_t

callback(data) receives:

  • data.m_ulSteamIDLobby (uint64)

  • data.m_ulSteamIDAdmin (uint64)

  • data.m_bKickedDueToDisconnect (int)

Matchmaking.OnLobbyCreated()

Callback for LobbyCreated_t

callback(data) receives:

  • data.m_eResult (int - EResult)

  • data.m_ulSteamIDLobby (uint64)

Matchmaking.OnFavoritesListAccountsUpdated()

Callback for FavoritesListAccountsUpdated_t

callback(data) receives:

  • data.m_eResult (int - EResult)