Compute the steam app id from the app key

This commit is contained in:
Guillaume Meunier
2024-11-02 13:38:39 +01:00
parent c0cb4cd68f
commit b3d9e44c2c
+6 -1
View File
@@ -24,6 +24,7 @@
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
#include <string>
namespace
{
@@ -90,7 +91,11 @@ std::vector<steam_app> steam_apps(const std::string & locale)
const char prefix[] = "steam.app.";
if (app_key.starts_with(prefix))
app.url = "steam://rungameid/" + app_key.substr(strlen(prefix));
{
// ¯\_(ツ)_/¯
uint64_t appkey = stoll(app_key.substr(strlen(prefix)));
app.url = "steam://rungameid/" + std::to_string((appkey << 32) + 0x2000000);
}
}
if (app.url != "")