summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Version.cpp
diff options
context:
space:
mode:
authorLillyJadeKatrin <lilly.kitty.1988@gmail.com>2024-04-24 07:09:43 -0400
committerLillyJadeKatrin <lilly.kitty.1988@gmail.com>2024-06-03 00:24:43 -0400
commit9499e142094bcdaa374d51e758ac889b859a2297 (patch)
tree549cc87223dc0a17f7937634ba2e969972b1a28d /Source/Core/Common/Version.cpp
parent222a3930807545d9ebffebfbd13c3a816f788434 (diff)
Add user agent to headers for all RetroAchievements server calls
Requested agent syntax is "Dolphin/5.0-23456"
Diffstat (limited to 'Source/Core/Common/Version.cpp')
-rw-r--r--Source/Core/Common/Version.cpp12
1 files changed, 10 insertions, 2 deletions
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;