mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2026-05-04 11:32:18 -04:00
Moved get_app_id()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <koalabox/win.hpp>
|
||||
#include "smoke_api/types.hpp"
|
||||
|
||||
constexpr auto STEAM_APPS = "STEAMAPPS_INTERFACE_VERSION";
|
||||
constexpr auto STEAM_CLIENT = "SteamClient";
|
||||
@@ -15,10 +15,10 @@ constexpr auto STEAM_GAME_SERVER = "SteamGameServer";
|
||||
|
||||
namespace smoke_api {
|
||||
extern HMODULE steamapi_module;
|
||||
|
||||
extern bool hook_mode;
|
||||
|
||||
void init(HMODULE module_handle);
|
||||
|
||||
void shutdown();
|
||||
|
||||
AppId_t get_app_id();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user