fraganator Posted March 4, 2021 Share Posted March 4, 2021 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? Quote Link to comment Share on other sites More sharing options...
C-Beats Posted March 4, 2021 Share Posted March 4, 2021 What is being done in OnBeforeGameLaunching, that can't simply be done in the OnAfterGameLaunched call (which is only called if the game DOES indeed launch)? Quote Link to comment Share on other sites More sharing options...
fraganator Posted March 5, 2021 Author Share Posted March 5, 2021 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.