Skip to content

Host cannot accept Steam player after reconnect (e.g. Fix & Restart) #843

@Laende

Description

@Laende

Bug Description

When connecting via Steam (non-auto-accept), if the connecting player disconnects before being accepted — for example by clicking "Fix & Restart" on the mod mismatch window — the host is unable to accept them on subsequent connection attempts. The player gets stuck at "waiting for host to accept" indefinitely. The host must restart their game to be able to accept the player again.

Steps to Reproduce

  1. Host starts a multiplayer game with Steam networking (auto-accept disabled)
  2. Player connects via Steam: host gets the accept/reject prompt
  3. Before the host clicks Accept, the player disconnects (e.g. clicks "Fix & Restart" in the mod mismatch window)
  4. Player's game restarts and attempts to reconnect
  5. Bug: Host never receives a new accept prompt. Player is stuck at "waiting for host."

Cause

In SteamIntegration.InitCallbacks, the P2PSessionRequest_t handler guards with:

if (... && !session.pendingSteam.Contains(req.m_steamIDRemote))

The player's Steam ID is added to pendingSteam when the first request arrives, but it is only removed in AcceptPlayerJoinRequest. It is never cleaned up when:

  • The host clicks Reject (callback runs with accepted = false but does nothing)
  • The player disconnects before the host responds (callback is never invoked)

On reconnect, Steam fires a new P2PSessionRequest_t, but the stale pendingSteam entry causes the guard to skip the entire handler: no prompt, no accept call.

Fix

  • Remove the blocking guard; instead, unconditionally clear any stale pendingSteam entry at the top of the handler before re-adding
  • Clean up pendingSteam in the reject path of the join request callback
  • Prevent duplicate knownUsers entries on reconnect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions