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:
- Matchmaking.AddRequestLobbyListCompatibleMembersFilter(steamIDLobby)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
- SteamWorks:
- Matchmaking.AddRequestLobbyListDistanceFilter(eLobbyDistanceFilter)
🤖 Auto-generated binding
- Parameters:
eLobbyDistanceFilter (int - ELobbyDistanceFilter) –
- SteamWorks:
- Matchmaking.AddRequestLobbyListFilterSlotsAvailable(nSlotsAvailable)
🤖 Auto-generated binding
- Parameters:
nSlotsAvailable (int) –
- SteamWorks:
- Matchmaking.AddRequestLobbyListNearValueFilter(pchKeyToMatch, nValueToBeCloseTo)
🤖 Auto-generated binding
- Parameters:
pchKeyToMatch (str?) –
nValueToBeCloseTo (int) –
- SteamWorks:
- Matchmaking.AddRequestLobbyListNumericalFilter(pchKeyToMatch, nValueToMatch, eComparisonType)
🤖 Auto-generated binding
- Parameters:
pchKeyToMatch (str?) –
nValueToMatch (int) –
eComparisonType (int - ELobbyComparison) –
- SteamWorks:
- Matchmaking.AddRequestLobbyListResultCountFilter(cMaxResults)
🤖 Auto-generated binding
- Parameters:
cMaxResults (int) –
- SteamWorks:
Notes:
See
MatchMaking.RequestLobbyList()’s example.
- Matchmaking.AddRequestLobbyListStringFilter(pchKeyToMatch, pchValueToMatch, eComparisonType)
🤖 Auto-generated binding
- Parameters:
pchKeyToMatch (str?) –
pchValueToMatch (str?) –
eComparisonType (int - ELobbyComparison) –
- SteamWorks:
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_tand a boolean
- Returns:
(uint64)
SteamAPICall_thandle for this async call. The result is delivered via thecallbackparameter whenSteam.RunCallbacks()is called.- SteamWorks:
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:
- 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:
Signature differences from C++ API:
Parameter
pnAppIDis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pnIPis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pnConnPortis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pnQueryPortis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
punFlagsis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pRTime32LastPlayedOnServeris 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:
Notes:
See
MatchMaking.GetFavoriteGame()’s example.
- Matchmaking.GetLobbyByIndex(iLobby)
🤖 Auto-generated binding
- Parameters:
iLobby (int) –
- Returns:
(uint64 - CSteamID) Return value
- SteamWorks:
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. Ifnilthen the buffer will beNULL.
- Returns:
(int) Return value
- Returns:
(uint64)
pSteamIDUser- Returns:
(str)
pvData- Returns:
(int)
peChatEntryType- SteamWorks:
Signature differences from C++ API:
Parameter
pSteamIDUseris not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pvDatais not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
peChatEntryTypeis 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:
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. Ifnilthen the buffer will beNULL.cchValueBufferSize (int?) – size of the buffer to allocate for
pchValue. Ifnilthen the buffer will beNULL.
- Returns:
(bool) Return value
- Returns:
(str)
pchKey- Returns:
(str)
pchValue- SteamWorks:
Signature differences from C++ API:
Parameter
pchKeyis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
pchValueis 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:
- Matchmaking.GetLobbyGameServer(steamIDLobby)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
- Returns:
(bool) Return value
- Returns:
(int)
punGameServerIP- Returns:
(int)
punGameServerPort- Returns:
(uint64)
psteamIDGameServer- SteamWorks:
Signature differences from C++ API:
Parameter
punGameServerIPis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
punGameServerPortis not a parameter in Lua — it is an output-only pointer in C++ and is returned as an additional return value.Parameter
psteamIDGameServeris 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:
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:
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:
- Matchmaking.GetLobbyOwner(steamIDLobby)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
- Returns:
(uint64 - CSteamID) Return value
- SteamWorks:
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:
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:
Example:
Steam.Matchmaking.InviteUserToLobby(lobbyID, friendSteamID)
- Matchmaking.JoinLobby(steamIDLobby, callback)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
callback (function) – CallResult callback receiving struct
LobbyEnter_tand a boolean
- Returns:
(uint64)
SteamAPICall_thandle for this async call. The result is delivered via thecallbackparameter whenSteam.RunCallbacks()is called.- SteamWorks:
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:
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:
- Matchmaking.RequestLobbyData(steamIDLobby)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
- Returns:
(bool) Return value
- SteamWorks:
- Matchmaking.RequestLobbyList(callback)
🤖 Auto-generated binding
- Parameters:
callback (function) – CallResult callback receiving struct
LobbyMatchList_tand a boolean- Returns:
(uint64)
SteamAPICall_thandle for this async call. The result is delivered via thecallbackparameter whenSteam.RunCallbacks()is called.- SteamWorks:
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:
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:
- Matchmaking.SetLobbyData(steamIDLobby, pchKey, pchValue)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
pchKey (str?) –
pchValue (str?) –
- Returns:
(bool) Return value
- SteamWorks:
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:
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:
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:
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:
- Matchmaking.SetLobbyOwner(steamIDLobby, steamIDNewOwner)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
steamIDNewOwner (uint64 - CSteamID) –
- Returns:
(bool) Return value
- SteamWorks:
- Matchmaking.SetLobbyType(steamIDLobby, eLobbyType)
🤖 Auto-generated binding
- Parameters:
steamIDLobby (uint64 - CSteamID) –
eLobbyType (int - ELobbyType) –
- Returns:
(bool) Return value
- SteamWorks:
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)