Steam Lobby Game Server

This component has no configuration and simply exposes features that allow you to set or read the Game Server info on the target lobby.
Functions
Set Listen Server
[ContextMenu("Set as Listen Server")]
public void SetListenServer()
Sets the local player as the listen server for the lobby. Only the lobby owner can call this successfully.
Set Dedicated Steam Game Server
public void SetDedicatedSteamGameServer(CSteamID serverId)
Assigns a dedicated Steam game server to the lobby using its Steam ID. Requires the local user to be the lobby owner.
Set Dedicated Generic Server
public void SetDedicatedGenericServer(string ip, ushort port)
Assigns a dedicated generic server to the lobby using an IP address and port. Only the lobby owner can call this successfully.
Set Game Server
public void SetGameServer(CSteamID id, string ip, ushort port)
Sets a game server with a specific Steam ID, IP address, and port for the lobby. Requires ownership.
Has Game Server
public bool HasGameServer()
Returns true
if the lobby is valid and has a game server set; otherwise false
.
Get Game Server
public LobbyGameServer? GetGameServer()
Returns the lobby’s current LobbyGameServer
object if a server is set; otherwise null
.
Get Id Address
public string GetIdAddress()
Returns the Steam ID of the lobby’s game server as a string, or an empty string if no server is set or the lobby is invalid.
Get Ip Address
public string GetIpAddress()
Returns the IP address of the lobby’s game server as a string, or an empty string if no server is set or the lobby is invalid.
Get Port
public ushort GetPort()
Returns the port of the lobby’s game server, or 0
if no server is set or the lobby is invalid.
Last updated