AnErrorOccuredLobbyCleanup

v1.0.11·Updated 2026-08-21

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

About this mod Author’s original text

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. It is cleared during the mod's lobby cleanup paths, when a new lobby is entered, on Main Menu, and on application quit. A host ID from a previous lobby cannot be used for a different 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 Mod Manager/r2modman, or place the DLL in BepInEx/plugins.

Why is "Occured" misspelled?

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

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
AnErrorOccuredLobbyCleanup-1.0.11.zip
File size
10.9 KiB
SHA-256
bec6923853a62e025d2e4f1660d238a2a055a95dd6b8375a382d40f5ce9d8b38
Stored at
2026-10-10 18:29