From 69f6b800befef9d12abf23f50bf3526d27d5d39a Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 26 Mar 2023 21:16:13 -0400 Subject: [PATCH] Fix profile loading on latest SteamOS stable update --- backend/build.sh | 10 ++++++---- backend/src/api/general.rs | 4 +++- src/index.tsx | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/backend/build.sh b/backend/build.sh index 3a20ec7..d99c6e4 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -1,10 +1,12 @@ #!/bin/bash #cargo build --release --target x86_64-unknown-linux-musl -cargo build --target x86_64-unknown-linux-musl -#cross build --release +#cargo build --target x86_64-unknown-linux-musl +#cross build +cargo build mkdir -p ../bin #cp ./target/x86_64-unknown-linux-musl/release/powertools ../bin/backend -cp ./target/x86_64-unknown-linux-musl/debug/powertools ../bin/backend -#cp ./target/release/powertools ../bin/backend +#cp ./target/x86_64-unknown-linux-musl/debug/powertools ../bin/backend +#cp ./target/debug/powertools ../bin/backend +cp ./target/debug/powertools ../bin/backend diff --git a/backend/src/api/general.rs b/backend/src/api/general.rs index 4b14aa3..74c89df 100644 --- a/backend/src/api/general.rs +++ b/backend/src/api/general.rs @@ -57,11 +57,13 @@ pub fn load_settings( setter(*id as i64, name.to_owned()); vec![true.into()] } else { + log::warn!("load_settings missing name parameter"); vec!["load_settings missing name parameter".into()] } //let mut general_lock = unwrap_lock(settings.general.lock(), "general"); } else { - vec!["load_settings missing path parameter".into()] + log::warn!("load_settings missing id parameter"); + vec!["load_settings missing id parameter".into()] } } } diff --git a/src/index.tsx b/src/index.tsx index 69a9b40..8fc7e9d 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -161,6 +161,7 @@ const reload = function() { // register Steam callbacks //@ts-ignore lifetimeHook = SteamClient.GameSessions.RegisterForAppLifetimeNotifications((update) => { + backend.log(backend.LogLevel.Info, "RegisterForAppLifetimeNotifications callback(" + JSON.stringify(update, null, 2) + ")"); if (update.bRunning) { //backend.log(backend.LogLevel.Debug, "AppID " + update.unAppID.toString() + " is now running"); } else { @@ -175,9 +176,11 @@ const reload = function() { startHook = SteamClient.Apps.RegisterForGameActionStart((actionType, id) => { //@ts-ignore let gameInfo: any = appStore.GetAppOverviewByGameID(id); + + backend.log(backend.LogLevel.Info, "RegisterForGameActionStart callback(" + actionType + ", " + id + ")"); // don't use gameInfo.appid, haha backend.resolve( - backend.loadGeneralSettings(id, gameInfo.display_name), + backend.loadGeneralSettings(Number(id), gameInfo.display_name), (ok: boolean) => {backend.log(backend.LogLevel.Debug, "Loading settings ok? " + ok)} ); });