You are viewing a potentially older version of this package. View all versions.
ZaboomafooW-AnErrorOccuredLobbyCleanup-1.0.10 icon

AnErrorOccuredLobbyCleanup

Cleans up orphaned Steam lobbies so other players don't get 'An error occured!' from an invalid Steam join target.

Date uploaded 9 hours ago
Version 1.0.10
Download link ZaboomafooW-AnErrorOccuredLobbyCleanup-1.0.10.zip
Downloads 20
Dependency string ZaboomafooW-AnErrorOccuredLobbyCleanup-1.0.10

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305

README

AnErrorOccuredLobbyCleanup

Fixes one Steam lobby cleanup problem that can leave a non-host client advertising a lobby after the real Lethal Company host is gone.

This does not fix every cause of "An error occured!", and it does not fix a broken lobby that you are trying to join. It prevents other players from being sent to an orphaned Steam lobby that your client is still holding.

The problem

Some late-join and lobby-management mods keep players in the Steam lobby after a round starts. That is useful when the actual host is running the mod and intentionally keeps the lobby available for late joining.

The bad case is when only a non-host client keeps that Steam lobby membership. If the real host leaves, disconnects, gets kicked, or gets banned, Steam can leave the non-host client holding the old lobby even though that client is not the Lethal Company server. Steam may also transfer lobby ownership to that client.

Friends can still see Join Game, but the lobby no longer points to a valid Lethal Company host. Joining it can lead to "An error occured!".

This mod cleans up that orphaned Steam lobby so other players don't get "An error occured!" trying to join it.

What it does

  • Watches Steam lobby leave, disconnect, kick, and ban events.
  • Identifies the original Lethal Company host from player slot 0 when that Steam ID is available. The Steam lobby owner at entry is kept only as a per-lobby fallback until slot 0 can confirm the host.
  • If the real host is removed from the current Steam lobby, a non-host client cleans up its copy of that orphaned lobby.
  • If Steam has already transferred ownership of the orphaned lobby to that client, the mod marks it non-joinable before cleanup.
  • If Steam reports that the local non-host client itself has already been removed from the lobby, the mod clears the retained local Steam lobby bookkeeping without disconnecting the active Netcode game session.
  • If a retained Steam lobby survives into MainMenu, the mod cleans it up there as a final failsafe.
  • If the game is quitting while a Steam lobby is still retained, the mod exits that lobby during shutdown.

The cached host Steam ID is tied to the exact Steam lobby it came from and is cleared when that lobby ends, when a new lobby is entered, on Main Menu, and on application quit. A host ID from a previous lobby is never used for a later lobby.

What it does not change

  • It does not make late joining work by itself.
  • It does not change the Lethal Company Netcode host.
  • It does not modify player state, round state, spawning, or connection approval.
  • It does not close a legitimate Steam lobby that the actual host is intentionally keeping open during normal gameplay.
  • It does not fix unrelated causes of "An error occured!".

Compatibility

  • Client-side cleanup for non-host players during gameplay.
  • Host-departure cleanup does nothing when you are the Lethal Company host.
  • Does not require a specific late-join or lobby-management mod.
  • Designed to coexist with mods that intentionally retain the Steam lobby when the actual host is running them.
  • Targets Lethal Company v81.

Installation

Install with Thunderstore Mod Manager/r2modman, or place the DLL in BepInEx/plugins.

Why is "Occured" misspelled?

Because the vanilla Lethal Company message is "An error occured!".

CHANGELOG

Changelog

1.0.10

  • Standardizes cleanup wording on "orphaned Steam lobby" in logs and documentation.
  • Cleanup logs now explain that the orphaned Steam lobby is being cleaned up to prevent other players from getting "An error occured!".
  • No gameplay or network behavior changed.

1.0.9

  • If a non-host client inherits Steam ownership after the actual Lethal Company host is removed, marks that orphaned lobby non-joinable before cleanup.
  • Quarantine only runs after the existing host identity and current-lobby checks have already proven the removed player is the original Lethal Company host.
  • If Steam rejects the non-joinable update, normal orphan-lobby cleanup still proceeds.

1.0.8

  • On a non-host client, clears retained local Steam lobby bookkeeping if Steam reports that this client itself left, disconnected, was kicked, or was banned from its current lobby.
  • The self-removal path only nulls currentLobby, clears steamIdsInLobby, and clears the per-lobby host cache; it does not disconnect or alter the active Netcode game session.

1.0.7

  • Tightens the per-lobby host Steam ID cache so a verified player-slot-0 host replaces the provisional lobby-entry owner.
  • Resets cached lobby and host IDs when the cached membership ends, a new lobby is entered, Main Menu is reached, or the application quits.
  • Keeps cached host identity bound to its exact Steam lobby so a previous lobby cannot supply the host ID for a later lobby.

1.0.6

  • Caches the Steam lobby owner when entering a lobby as a fallback host Steam ID.
  • Uses the cached ID only when the v81 player-slot host Steam ID is unavailable or zero, while still requiring the same current Steam lobby.

1.0.5

  • Adds a Main Menu failsafe that leaves any Steam lobby still retained after returning to the main menu.
  • The failsafe only touches Steam lobby state and does not disconnect or alter an active Lethal Company session.

1.0.4

  • Explicitly leaves any retained Steam lobby when the game application is quitting.
  • Covers the v81 shutdown gap where Disconnect() does not enter its cleanup path if StartOfRound.Instance is already null.

1.0.3

  • Cleans up a retained Steam lobby when Steam reports that the actual Lethal Company host was kicked from the lobby.
  • Cleans up a retained Steam lobby when Steam reports that the actual Lethal Company host was banned from the lobby.

1.0.2

  • Cleans up a retained Steam lobby when Steam reports that the actual Lethal Company host disconnected from the lobby without leaving normally.

1.0.1

  • Clarified that the mod does NOT fix "An error occured!" for the player installing it.
  • Clarified that it only prevents one specific orphaned-lobby cause of the error for other players trying to join that client.

1.0.0

  • Initial public release.
  • Cleans up a retained Steam lobby on non-host clients when the actual Lethal Company host leaves that lobby.
  • Prevents the client from continuing to advertise an orphaned Steam join target after the real host is gone.