Skip to content

SessionPlayer

public sealed class SessionPlayer

Namespace SideHustle

Added in 3.0.0

One player in the current session (see API.Players, API.PlayerJoined, API.PlayerLeft). The same object stays in API.Players for as long as the player is in the session; DisplayName and IsHost are refreshed about twice a second. Since 3.0.0.

public ulong SteamId { get; }

Added in 3.0.0

The player’s Steam id (id64). 0 for the local player when Steam could not be read.

public string DisplayName { get; internal set; }

Added in 3.0.0

The name other players see. For the local player this is the session alias when one is set, else the Steam persona. For a remote player in a World session it is the replicated in-game name (which carries their alias) once their character has spawned; before that, and in a MenuSpace session, it is their Steam persona.

public bool IsHost { get; internal set; }

Added in 3.0.0

True for the lobby owner. In singleplayer the local player is not the host.

public bool IsLocal { get; }

Added in 3.0.0

True for the player on this machine.

public override string ToString()

Added in 3.0.0

“Name (steamId)”, for logs.