From 9499e142094bcdaa374d51e758ac889b859a2297 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Wed, 24 Apr 2024 07:09:43 -0400 Subject: Add user agent to headers for all RetroAchievements server calls Requested agent syntax is "Dolphin/5.0-23456" --- Source/Core/Common/Version.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/Version.cpp') diff --git a/Source/Core/Common/Version.cpp b/Source/Core/Common/Version.cpp index 25c678f061..618d000b9f 100644 --- a/Source/Core/Common/Version.cpp +++ b/Source/Core/Common/Version.cpp @@ -9,6 +9,8 @@ namespace Common { +#define EMULATOR_NAME "Dolphin" + #ifdef _DEBUG #define BUILD_TYPE_STR "Debug " #elif defined DEBUGFAST @@ -19,10 +21,10 @@ namespace Common const std::string& GetScmRevStr() { - static const std::string scm_rev_str = "Dolphin " + static const std::string scm_rev_str = EMULATOR_NAME " " // Note this macro can be empty if the master branch does not exist. #if 1 - SCM_COMMITS_AHEAD_MASTER - 1 != 0 - "[" SCM_BRANCH_STR "] " + "[" SCM_BRANCH_STR "] " #endif #ifdef __INTEL_COMPILER @@ -51,6 +53,12 @@ const std::string& GetScmBranchStr() return scm_branch_str; } +const std::string& GetUserAgentStr() +{ + static const std::string user_agent_str = EMULATOR_NAME "/" SCM_DESC_STR; + return user_agent_str; +} + const std::string& GetScmDistributorStr() { static const std::string scm_distributor_str = SCM_DISTRIBUTOR_STR; -- cgit v1.2.3