1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "user_agent.h"
21 #include "client_cfg.h"
27 #if defined(HAVE_X86_64)
28 #define RYZOM_ARCH "x64"
29 #elif defined(HAVE_X86)
30 #define RYZOM_ARCH "x86"
31 #elif defined(HAVE_ARM)
32 #define RYZOM_ARCH "arm"
34 #define RYZOM_ARCH "unknown"
36 #if defined(NL_OS_WINDOWS)
37 #define RYZOM_SYSTEM "windows"
38 #elif defined(NL_OS_MAC)
39 #define RYZOM_SYSTEM "mac"
40 #elif defined(NL_OS_UNIX)
41 #define RYZOM_SYSTEM "unix"
43 #define RYZOM_SYSTEM "unknown"
46 #ifndef RYZOM_CLIENT_ICON
47 #define RYZOM_CLIENT_ICON "ryzom_client"
54 std::string
getUserAgent()
56 return getUserAgentName() + "/" + getUserAgentVersion();
59 std::string
getUserAgentName()
64 std::string
getUserAgentVersion()
66 static std::string s_userAgent
;
68 if (s_userAgent
.empty())
70 s_userAgent
= NLMISC::toString("%s-%s-%s", RYZOM_VERSION
, RYZOM_SYSTEM
, RYZOM_ARCH
);
76 std::string
getVersion()
81 std::string
getDisplayVersion()
83 static std::string s_version
;
85 if (s_version
.empty())
92 if (ClientCfg
.ExtendedCommands
) s_version
+= "_E";
94 s_version
+= getVersion();
100 std::string
getDebugVersion()
102 static std::string s_version
;
104 if (s_version
.empty())
106 s_version
= getDisplayVersion();
108 s_version
+= NLMISC::toString(" (%s)", BUILD_DATE
);
110 s_version
+= NLMISC::toString(" (%s %s)", __DATE__
, __TIME__
);
117 bool isStereoAvailable()
119 #ifdef NL_STEREO_AVAILABLE
126 std::string
getRyzomClientIcon()
128 return RYZOM_CLIENT_ICON
;
131 std::string
getRyzomEtcPrefix()
133 return RYZOM_ETC_PREFIX
;
136 std::string
getRyzomSharePrefix()
138 return RYZOM_SHARE_PREFIX
;