fix: initialize Steam with configurable AppID#12
Conversation
- Fix readme limitation: appid was forced to 480, now configurable via config.ini with clear error when appid requires ownership - Restore SteamAPI_InitEx call that was removed by uncommitted changes, leaving the launcher unable to connect to Steam at all - Replace broken 5s timeout with Enter-key polling via GetAsyncKeyState so the launcher exits on user request - Create steam_appid.txt in both launcher and game directories, fix LaunchGame relative path resolution - Target: launcher
e2d335e to
1be5011
Compare
- Consistently use AppID instead of AppId across GetAppID(), SetAppID(), default config key, and comments - Target: config
d53bb99 to
38dc8aa
Compare
- Avoid setting SteamAppId/SteamGameId when AppID is 0 so the launcher only writes env vars for valid app IDs. - Target: root
38dc8aa to
ae184cb
Compare
- Treat Steam restart requests as a successful relaunch path so init failures are not reported when Steam intends to restart the app. - Target: root
- Make appid file creation fail fast for the configured file while treating the optional game-directory copy as non-fatal, so initialization surfaces real write errors without breaking the fallback path. - Target: root
|
Whoa, holy shit, thank you!! I'm sorry I didn't see this at all,give me a moment to see what you did and merge |
No problem! You don’t have to merge all of them if you don’t want to. I mostly made these changes because I tried using When I checked both |
That's not the case for uc-online2, it has one - but 480 is the default for when it's either set to 0 or isn't set at all. It's controlled by an ini, there's more in the readme though. |
Oh mybad, I tried with SW5 game but the game wont launch i think i misconfigured it or something PS: the latest build after commit is failed |
I noticed that, i'll look more into why that happened even though it worked fine in the test before merging, shits weird lol |
Summary
This PR updates the launcher to initialize Steam with a configurable AppID, launch the configured game executable, and keep Steam callbacks running until the user presses Enter.
Current behavior
AppIDkey inconfig.ini.AppIDdefaults to480(Spacewar) in newly generated configs.SteamAppIdandSteamGameIdenvironment variables are set only when the configured AppID is nonzero.steam_appid.txtis created at the configuredSteamAppIdFilepath before Steam initialization.steam_appid.txtcopy is also written next to the game executable.SteamAPI_RestartAppIfNecessary(), the launcher exits successfully with a clear restart message.Error handling
SteamAppId=0/SteamGameId=0to be exported.steam_appid.txtpath fails initialization with a clear error.steam_appid.txtcopy is logged as a warning and does not block launch.AppID=480when ownership is the likely issue.Files changed
include/ini_config.hppSteamAppIdFileinclude/uc_online.hppinclude/uc_online64.hppsrc/ini_config.cppAppID, generates default config, storesSteamAppIdFilesrc/main.cppsrc/main64.cppsrc/uc_online.cppsrc/uc_online64.cppTesting
cmake --build "build64" --config Releasecmake --build "build32" --config ReleaseBoth builds pass locally.