Skip to content

Commit

Permalink
Merge Add steam_webApiDomain convar (pr-1423)
Browse files Browse the repository at this point in the history
8df4cff - feat(server): add steam_webApiDomain convar
  • Loading branch information
prikolium-cfx committed Aug 20, 2024
2 parents e018ee1 + 8df4cff commit a0a1b20
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <HttpClient.h>

std::shared_ptr<ConVar<std::string>> g_steamApiKey;
std::shared_ptr<ConVar<std::string>> g_steamApiDomain;

using json = nlohmann::json;

Expand Down Expand Up @@ -82,7 +83,7 @@ static InitFunction initFunction([]()
return;
}

if (g_steamApiKey->GetValue() == "none")
if (g_steamApiKey->GetValue() == "none" || g_steamApiDomain->GetValue() == "none")
{
cb({});
return;
Expand All @@ -92,7 +93,7 @@ static InitFunction initFunction([]()
opts.addErrorBody = true;

httpClient->DoGetRequest(
fmt::format("https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1/?key={0}&appid={1}&ticket={2}", g_steamApiKey->GetValue(), STEAM_APPID, it->second),
fmt::format("https://{0}/ISteamUserAuth/AuthenticateUserTicket/v1/?key={1}&appid={2}&ticket={3}", g_steamApiDomain->GetValue(), g_steamApiKey->GetValue(), STEAM_APPID, it->second),
opts,
[this, cb, clientPtr](bool success, const char* data, size_t size)
{
Expand Down Expand Up @@ -136,6 +137,7 @@ static InitFunction initFunction([]()
fx::ServerInstanceBase::OnServerCreate.Connect([](fx::ServerInstanceBase* instance)
{
g_steamApiKey = instance->AddVariable<std::string>("steam_webApiKey", ConVar_None, "");
g_steamApiDomain = instance->AddVariable<std::string>("steam_webApiDomain", ConVar_None, "api.steampowered.com");

serverInstance = instance;
});
Expand Down

0 comments on commit a0a1b20

Please sign in to comment.