Skip to content

MultiplayerInfo

public sealed class MultiplayerInfo

Namespace SideHustle.Multiplayer

Added in 1.1.0

The multiplayer payload carried on LaunchContext.Multiplayer. Populated by Side Hustle from the Steam lobby’s namespaced metadata (the sh_* keys). The host fills it from its host options; a joining client reads it back from the lobby. ConfigBlob is a free-form string the host writes (lobby key sh_config) so a gamemode can ship its own settings to clients with no extra netcode.

public int MaxPlayers { get; internal set; }

Added in 1.1.0

Maximum players the host opened the lobby for.

Value The host form offers 2 up to the lobby cap. It starts at the host’s last choice, else at 4 or the cap, whichever is lower.

public string GamemodeName { get; internal set; }

Added in 1.1.0

Display name of the gamemode (lobby key sh_gamemode_name).

public string LobbyName { get; internal set; }

Added in 1.5.0

Host-chosen lobby name (lobby key sh_name); may be empty.

public string Mode { get; internal set; }

Added in 1.5.0

The mode/preset label the host selected (lobby key sh_mode), e.g. “Infection” or “Custom - Infection”; may be null when the gamemode has no presets.

public string HostName { get; internal set; }

Added in 1.1.0

The host’s name as other players see it: the display name the host chose for this gamemode, or their Steam persona name when none is set (lobby key sh_host_name).

public bool HasPassword { get; internal set; }

Added in 1.1.0

True if the lobby is password-protected (lobby key sh_pw = “1”).

public string ConfigBlob { get; internal set; }

Added in 1.1.0

Free-form per-gamemode payload the host published (lobby key sh_config); may be null.

public string BuildId { get; internal set; }

Added in 1.5.0

The host’s gamemode build fingerprint (lobby key sh_build; the DLL’s ModuleVersionId). Side Hustle compares this to the joining client’s local build at join time and warns on mismatch. May be empty.

public string GamemodeId { get; internal set; }

Added in 2.0.0

The gamemode’s stable id (lobby key sh_gamemode); used to match a lobby against the installed gamemodes and to group “not installed” advertisements by gamemode. May be empty.

public string DownloadUrl { get; internal set; }

Added in 2.0.0

Where to get the gamemode mod (lobby key sh_url), advertised by the host so a player who does not have it installed can open its download page. May be empty.

public string Runtime { get; internal set; }

Added in 2.3.0

Which game branch the host plays on (lobby key sh_rt): “il2cpp”, “mono”, or empty when the host runs a Side Hustle that predates the key. The two branches cannot play together.

public string GetSetting(string key, string fallback = null)

Added in 1.4.0

A host setting value by key (the gamemode’s SettingDescriptor.Key), or fallback.

Parameter
keyA SettingDescriptor.Key, e.g. “len”. Compared exactly, case included.
fallbackReturned when the blob has no entry for the key. A key stored with an empty value returns the empty string.

Returns The stored form described on SettingDescriptor, e.g. “30”, “1” or “n”.

public int GetInt(string key, int fallback = 0)

Added in 1.4.0

A host setting parsed as an integer (invariant culture), or fallback.

Parameter
keyA SettingDescriptor.Key, e.g. “len”.
fallbackReturned when the key is missing or its value is not an integer, e.g. “0.25”.
public float GetFloat(string key, float fallback = 0f)

Added in 1.4.0

A host setting parsed as a float (invariant culture), or fallback.

Parameter
keyA SettingDescriptor.Key, e.g. “speed”.
fallbackReturned when the key is missing or its value is not a number.
public bool GetBool(string key, bool fallback = false)

Added in 1.4.0

A host setting parsed as a bool (“1”/“true” = true), or fallback.

Parameter
keyA SettingDescriptor.Key, e.g. “ping”.
fallbackReturned when the key is missing or its value is empty. Any other value than “1” or “true” (case ignored) is false.