Open CptMoore opened 1 year ago
Greetings!
Clear all dynamically set doorstop env variables if doorstop detects that it is in a new unmodified process, leading to doorstop to run again.
Unfortunately that's what the DOORSTOP_DISABLE
and DOORSTOP_INITIALIZED
are already meant for. To my knowledge, it's the only platform-agnostic way to save process state so that
The former point was originally made when BepInEx (the first tool that used Doorstop) didn't have mitigations against the game running multiple versions of itself in different modes (e.g. client + dedicated server). Nowadays, BepInEx is able to handle those situations fairly well, so I think that a better solution is to
ensure_unique_instance
(or better name) that works the same as ignore_disable_switch
but applies to both DOORSTOP_DISABLE
and DOORSTOP_INITIALIZED
.ensure_unique_instance
to false
, i.e. ignore both above env varsignore_disable_switch
as is for now; default it to true
insteadThese combined, Doorstop would allow multi-instance runs. It will then be the responsibility of Doorstop users to make sure their code can handle the same game being run in multiple instances at the same time (should be a nonissue, really).
That would work for us as we dont have servers or expect multiple concurrent instances to be valid. The name of the new variable is ok, i use enforce_single_instance for a similar use case, but that quits the process hard. The defaults also make sense due to end user friendliness for steam users.
version: v4.0.0 release platform: Windows game: BattleTech distribution: Steam
Issue; Doorstop uses ENV variables to keep track if it already ran, but dynamically set ENV variables are copied by steam during a restart of the games process.
Steps to reproduce:
Workarounds not working:
DOORSTOP_INITIALIZED
is set too, and that leads to skipping of calling the entrypointsteam_appid.txt
file so steam does not restart the game, however steamworks is broken and the game does not work properly (NRE etc..)Fix ideas?
Reference for RogueTech Discord: #rogueticket-7596
Logs when using the ignore_disable_switch workaround: log before restart log after restart