Jump to content
LaunchBox Community Forums

Detecting game launch failure?


Recommended Posts

Hi everyone,

I currently have some init functions which run when OnBeforeGameLaunching is called, and some cleanup functions in OnAfterGameLaunched, but if the game fails to launch (missing rom, etc), there's no callback from IGameLaunchingPlugin. OnGameExited isn't called either, as the game never started. There's also no event from ISystemEventsPlugin.OnEventRaised.

Is there a way to query the plugin API if a game failed to launch? One workaround is to set a flag in OnBeforeGameLaunching, and clear it in OnAfterGameLaunched. A background thread would then check the flag has been cleared within some time of the call to OnBeforeGameLaunching, and run the cleanup routine if it hasn't. Does anyone have any other solutions?

Link to comment
Share on other sites

The question relates to this plugin I'm working on. There's a function in OnBeforeGameLaunching that will temporarily replace 7-Zip with a wrapper application, which is used to check if a game has already been extracted, or pass on the extraction command to 7-Zip directly. Once the game has launched, there's a function in OnAfterGameLaunched that will cleanup and restore the original 7-Zip. If there's a missing rom or some other error, the cleanup code doesn't get a chance to run. It will always run on LB exit, or another successful game launch, but it would be nice to cleanup after a launch failure too.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...