Skip to content

fix(steam): guard overlay features against incomplete Steam API implementations#43

Closed
lisniuse wants to merge 4 commits into
vaiserYT:mainfrom
lisniuse:fix/steam-overlay-guard
Closed

fix(steam): guard overlay features against incomplete Steam API implementations#43
lisniuse wants to merge 4 commits into
vaiserYT:mainfrom
lisniuse:fix/steam-overlay-guard

Conversation

@lisniuse
Copy link
Copy Markdown

Summary

Wrap Steam overlay join polling, callback registration, and RunCallbacks in try-catch blocks to prevent native crashes when running with emulated Steam environments (e.g. Goldberg emulator or non-Steam game versions).

Problem

When using the mod with non-Steam game versions (e.g. GOG, or cracked versions using Goldberg/Rune emulators), SteamAPI.Init() can succeed (since basic init is emulated), but functions like SteamApps.GetLaunchCommandLine and SteamApps.GetLaunchQueryParam may crash at the native level because the emulator doesn't fully implement them. This causes the entire game process to terminate with a "Fatal Error" immediately after font initialization.

Solution

  • Add s_steamOverlayDisabled flag to permanently disable overlay features after the first native failure
  • Wrap TryPollSteamOverlayJoinFromLaunchData calls to SteamApps.GetLaunchCommandLine / GetLaunchQueryParam in try-catch
  • Wrap TryDeferredSteamOverlayCallbackRegistration and TryRegisterSteamOverlayJoinCallback callback registrations in try-catch
  • Add safety guards to TryRunSteamCallbacks and the background pump timer
  • Log warnings when overlay features are disabled

All guards are transparent to genuine Steam users -- no exceptions are thrown on a real Steam API, so the try-catch paths are never hit.

Testing

Tested on a non-Steam Dead Cells installation (v35) with Goldberg emulator and DCCM core modding. The mod previously crashed during title screen load; after this fix, the game runs normally and TCP multiplayer works as expected.

…mentations

Wrap Steam overlay join polling, callback registration, and RunCallbacks
in try-catch blocks to prevent native crashes when running with emulated
Steam environments (e.g. Goldberg emulator or non-Steam game versions).

- Add s_steamOverlayDisabled flag to permanently disable overlay features
  after the first native failure, avoiding repeated crash attempts
- Guard TryPollSteamOverlayJoinFromLaunchData against crashes from
  SteamApps.GetLaunchCommandLine / GetLaunchQueryParam (unsupported by
  Goldberg emulator)
- Guard TryDeferredSteamOverlayCallbackRegistration and
  TryRegisterSteamOverlayJoinCallback against Callback<T>.Create failures
- Add safety checks to TryRunSteamCallbacks and background timer
- All guards are transparent to real Steam users (no exceptions thrown
  on genuine Steam API)
@lisniuse lisniuse force-pushed the fix/steam-overlay-guard branch from 31307f0 to 8eebde0 Compare May 31, 2026 04:12
lisniuse added 3 commits May 31, 2026 12:19
…eam clients

Move Steam API init outside the main try block in WorkerEntry() so that
init failures (SteamAPI.Init / RestartAppIfNecessary) write a bootstrap
response before exiting, instead of throwing an unhandled exception that
triggers a Windows crash dialog.

Also update README with proper non-Steam setup instructions:
- Rename steam.hdll to enable Goldberg emulator
- Set EnableGoldberg: true in modcore.json
- Launch via DeadCellsModding.exe directly
- Document TCP/LAN limitation for non-Steam (P2P unavailable)

Closes vaiserYT#42
… restart

When both players die and the host triggers a run restart, the
client was left stuck on the Game Over screen because the
GameOver UI was never dismissed before launching the new game.

- Add GameOver removal (remove/destroy/dispose) in
  ResetAllDownedGameOverState
- Add DismissGameOverScreen helper in GameMenu
- Call it from both QueueHostRestartFromDeath and
  QueueClientRestartFromHostSeed to ensure cleanup on both sides
@lisniuse lisniuse closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant