add missing env var "SteamOverlayGameId" to steam_client and client_loader

This commit is contained in:
otavepto 2023-12-19 16:48:07 +02:00
parent f83d930e7b
commit f397f73644
3 changed files with 20 additions and 2 deletions

View File

@ -304,9 +304,12 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
if (!appid) { if (!appid) {
std::string str_appid = get_env_variable("SteamAppId"); std::string str_appid = get_env_variable("SteamAppId");
std::string str_gameid = get_env_variable("SteamGameId"); std::string str_gameid = get_env_variable("SteamGameId");
PRINT_DEBUG("str_appid %s str_gameid: %s\n", str_appid.c_str(), str_gameid.c_str()); std::string str_overlay_gameid = get_env_variable("SteamOverlayGameId");
PRINT_DEBUG("str_appid %s str_gameid: %s str_overlay_gameid: %s\n", str_appid.c_str(), str_gameid.c_str(), str_overlay_gameid.c_str());
uint32 appid_env = 0; uint32 appid_env = 0;
uint32 gameid_env = 0; uint32 gameid_env = 0;
uint32 overlay_gameid = 0;
if (str_appid.size() > 0) { if (str_appid.size() > 0) {
try { try {
@ -324,7 +327,15 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
} }
} }
PRINT_DEBUG("appid_env %u gameid_env: %u\n", appid_env, gameid_env); if (str_overlay_gameid.size() > 0) {
try {
overlay_gameid = std::stoul(str_overlay_gameid);
} catch (...) {
overlay_gameid = 0;
}
}
PRINT_DEBUG("appid_env %u gameid_env: %u overlay_gameid: %u\n", appid_env, gameid_env, overlay_gameid);
if (appid_env) { if (appid_env) {
appid = appid_env; appid = appid_env;
} }
@ -332,6 +343,10 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
if (gameid_env) { if (gameid_env) {
appid = gameid_env; appid = gameid_env;
} }
if (overlay_gameid) {
appid = overlay_gameid;
}
} }
bool local_save = false; bool local_save = false;

View File

@ -65,6 +65,7 @@ Steam_Client::Steam_Client()
if (appid) { if (appid) {
set_env_variable("SteamAppId", std::to_string(appid)); set_env_variable("SteamAppId", std::to_string(appid));
set_env_variable("SteamGameId", std::to_string(appid)); set_env_variable("SteamGameId", std::to_string(appid));
set_env_variable("SteamOverlayGameId", std::to_string(appid));
} }
steam_overlay = new Steam_Overlay(settings_client, callback_results_client, callbacks_client, run_every_runcb, network); steam_overlay = new Steam_Overlay(settings_client, callback_results_client, callbacks_client, run_every_runcb, network);
@ -220,6 +221,7 @@ void Steam_Client::setAppID(uint32 appid)
network->setAppID(appid); network->setAppID(appid);
set_env_variable("SteamAppId", std::to_string(appid)); set_env_variable("SteamAppId", std::to_string(appid));
set_env_variable("SteamGameId", std::to_string(appid)); set_env_variable("SteamGameId", std::to_string(appid));
set_env_variable("SteamOverlayGameId", std::to_string(appid));
} }

View File

@ -58,6 +58,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
if (AppId[0]) { if (AppId[0]) {
SetEnvironmentVariableW(L"SteamAppId", AppId); SetEnvironmentVariableW(L"SteamAppId", AppId);
SetEnvironmentVariableW(L"SteamGameId", AppId); SetEnvironmentVariableW(L"SteamGameId", AppId);
SetEnvironmentVariableW(L"SteamOverlayGameId", AppId);
} else { } else {
MessageBoxA(NULL, "You forgot to set the AppId.", "ColdClientLoader", MB_ICONERROR); MessageBoxA(NULL, "You forgot to set the AppId.", "ColdClientLoader", MB_ICONERROR);
return 0; return 0;