Namespace: Steamworks

Lua
C++
Edit

GetLobbyOwner

This function retrieves the lobby's owner.

Syntax

Parameter Description
lobby lobby ID

Returns

Returns the user ID of the lobby's owner if the user is in the lobby, otherwise zero is returned.

Remarks

If the owner of a lobby leaves, ownership will be transfered to another user and a LOBBYDATACHANGED event will be emitted.

-- Initialize Steam
if not Steamworks.Initialize() then
    RuntimeError("Steamworks failed to initialize.")
    return
end

-- Create a lobby
local lobby = Steamworks.CreateLobby()

-- Get the owner of the lobby
local owner = Steamworks.GetLobbyOwner(lobby)

-- Print lobby and owner information
Print("Lobby: " .. tostring(lobby))
Print("Owner: " .. Steamworks.GetUserName(owner))

-- Shutdown Steam
Steamworks.Shutdown()
Copyright © 2006-2025 Ultra Software.
All rights reserved.
Leadwerks 4 Documentation