Add infos into target window
[ryzomcore.git] / ryzom / client / src / user_agent.cpp
blobf9800ba6dc67b035238dc53d0106f49771738583
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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/>.
19 #include "stdpch.h"
20 #include "user_agent.h"
21 #include "client_cfg.h"
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
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"
33 #else
34 #define RYZOM_ARCH "unknown"
35 #endif
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"
42 #else
43 #define RYZOM_SYSTEM "unknown"
44 #endif
46 #ifndef RYZOM_CLIENT_ICON
47 #define RYZOM_CLIENT_ICON "ryzom_client"
48 #endif
50 #ifdef DEBUG_NEW
51 #define new DEBUG_NEW
52 #endif
54 std::string getUserAgent()
56 return getUserAgentName() + "/" + getUserAgentVersion();
59 std::string getUserAgentName()
61 return "Ryzom";
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);
73 return s_userAgent;
76 std::string getVersion()
78 return RYZOM_VERSION;
81 std::string getDisplayVersion()
83 static std::string s_version;
85 if (s_version.empty())
87 #if FINAL_VERSION
88 s_version = "";
89 #else
90 s_version = "DEV ";
91 #endif
92 if (ClientCfg.ExtendedCommands) s_version += "_E";
94 s_version += getVersion();
97 return s_version;
100 std::string getDebugVersion()
102 static std::string s_version;
104 if (s_version.empty())
106 s_version = getDisplayVersion();
107 #ifdef BUILD_DATE
108 s_version += NLMISC::toString(" (%s)", BUILD_DATE);
109 #else
110 s_version += NLMISC::toString(" (%s %s)", __DATE__, __TIME__);
111 #endif
114 return s_version;
117 bool isStereoAvailable()
119 #ifdef NL_STEREO_AVAILABLE
120 return true;
121 #else
122 return false;
123 #endif
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;