Ali Şahan Yalçın
DocsSessions

Sessions

Sessions

A higher level layer over lobbies: host and travel in one node, with standard metadata.

The lobby pages give you the raw pieces. The session layer stacks a common arrangement of them into single nodes, so you do not have to design your own metadata keys or remember the order of the host steps.

A session is a lobby, with agreed keys on it. Everything on the lobby subsystem still works underneath.

Use sessions if you want a working host and join flow quickly. Use lobbies directly if you want full control over the metadata.

Hosting

Host Session And Travel does five things in the right order:

  • Creates the lobby.
  • Publishes your session settings as lobby data.
  • Sets Rich Presence, so friends get a Join Game button.
  • Publishes the server address.
  • Travels to the map as a listen server.
  • Missing step 3 is why invites often do nothing. Missing step 5 is why everyone sits in a lobby that never starts.

    InputMeaning
    SettingsThe session settings struct, below
    TravelUncheck to create the session and stay put, for a pre match lobby

    Session settings

    FieldMeaning
    Session NameShown in the browser
    Map NameWhere to travel. Required when Travel is on.
    Game ModeFree text, yours to interpret
    Max PlayersIncluding the host
    PrivateFriends only rather than publicly listed
    PasswordOptional. See passwords.
    Build IdOptional. Joiners with a different value are turned away.
    Extra DataAny other keys you want published and searchable

    Finding sessions

    Find Sessions returns results with their metadata already read:

    FieldMeaning
    Session Name, Map Name, Game ModeAs the host published them
    Current Players, Max PlayersOccupancy
    Host Steam IdWho is hosting
    Password ProtectedWhether a password is needed
    Version CompatibleWhether the host's Build Id matches yours
    INFO: Grey out incompatible sessions rather than hiding them. A player who cannot see the session their friend is in assumes the game is broken, whereas a greyed out row with "different version" explains itself.

    Joining

    Join Session takes a session, an optional password, and whether to travel. It reports a full diagnosis rather than a bare true or false. See Join diagnostics.

    Managing a live session

    On the SteamForge Sessions subsystem:

    NodeWhat it does
    Is In SessionHosting or joined
    Is Session HostThe local player is the host
    Get Session SettingsWhat the session was created with
    Update Session SettingsChange them. Host only.
    Set Session JoinableStop accepting new players without ending the session
    Destroy SessionLeave or end it
    WARNING: Call Set Session Joinable with false when the match starts. A session that stays joinable mid match drops new players into a game already in progress with no state.

    On OnlineSubsystem

    Sessions publish as ordinary Steam lobby metadata, so anything that reads Steam lobbies can see a SteamForge session, including code using OnlineSubsystemSteam.

    They do not route through the engine's IOnlineSession interface. Doing that would make the plugin depend on the OnlineSubsystem plugin, and working without it is the property SteamForge is built around. Interop happens at the data level, which is where Steam actually defines it.