Moved get_app_id()

This commit is contained in:
acidicoala
2025-09-04 19:01:16 +05:00
parent 4581c36913
commit bdab9b574f
10 changed files with 34 additions and 41 deletions

View File

@@ -6,7 +6,6 @@
#include <koalabox/logger.hpp>
#include <koalabox/path.hpp>
#include <koalabox/paths.hpp>
#include <koalabox/str.hpp>
#include <koalabox/util.hpp>
#include <koalabox/win.hpp>
@@ -115,4 +114,15 @@ namespace smoke_api {
kb::logger::shutdown();
}
AppId_t get_app_id() {
try {
const auto app_id_str = kb::win::get_env_var("SteamAppId");
static auto app_id = std::stoi(app_id_str);
return app_id;
} catch(const std::exception& e) {
LOG_ERROR("Failed to get app id: {}", e.what());
return 0;
}
}
}