mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-03 16:54:47 +00:00
Changed: Centralize version different formats
This commit is contained in:
parent
dc86aa8459
commit
4f64daeee4
8 changed files with 60 additions and 41 deletions
|
@ -49,9 +49,6 @@
|
|||
#define FINAL_VERSION 1
|
||||
#endif // TEST_CRASH_COUNTER
|
||||
|
||||
// game share
|
||||
#include "game_share/ryzom_version.h"
|
||||
|
||||
// Client
|
||||
#include "resource.h"
|
||||
#include "init.h"
|
||||
|
|
|
@ -48,8 +48,6 @@
|
|||
// Std.
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
// Game Share
|
||||
#include "game_share/ryzom_version.h"
|
||||
// Client
|
||||
#include "init.h"
|
||||
#include "input.h"
|
||||
|
@ -89,6 +87,7 @@
|
|||
#include "interface_v3/add_on_manager.h"
|
||||
|
||||
#include "bg_downloader_access.h"
|
||||
#include "user_agent.h"
|
||||
|
||||
#include "nel/misc/check_fpu.h"
|
||||
|
||||
|
@ -837,11 +836,7 @@ void prelogInit()
|
|||
displayCPUInfo();
|
||||
|
||||
// Display the client version.
|
||||
#if FINAL_VERSION
|
||||
nlinfo("RYZOM VERSION : FV %s ("__DATE__" "__TIME__")", RYZOM_VERSION);
|
||||
#else
|
||||
nlinfo("RYZOM VERSION : DEV %s ("__DATE__" "__TIME__")", RYZOM_VERSION);
|
||||
#endif
|
||||
nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str());
|
||||
|
||||
FPU_CHECKER_ONCE
|
||||
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
// Sound
|
||||
#include "nel/sound/sound_anim_manager.h"
|
||||
// Game share
|
||||
#include "game_share/ryzom_version.h"
|
||||
#include "game_share/light_cycle.h"
|
||||
#include "sound_manager.h"
|
||||
#include "precipitation_clip_grid.h"
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "game_share/brick_types.h"
|
||||
#include "game_share/light_cycle.h"
|
||||
#include "game_share/time_weather_season/time_and_season.h"
|
||||
#include "game_share/ryzom_version.h"
|
||||
#include "game_share/bot_chat_types.h"
|
||||
// PACS
|
||||
#include "nel/pacs/u_global_position.h"
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
#include <nel/3d/u_text_context.h>
|
||||
#include <nel/gui/lua_ihm.h>
|
||||
|
||||
#include "game_share/ryzom_version.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "client_cfg.h"
|
||||
#include "user_entity.h"
|
||||
|
@ -44,7 +42,7 @@
|
|||
#include "misc.h"
|
||||
#include "interface_v3/interface_manager.h"
|
||||
#include "actions_client.h"
|
||||
|
||||
#include "user_agent.h"
|
||||
|
||||
|
||||
using namespace NLMISC;
|
||||
|
@ -244,15 +242,7 @@ void displayDebug()
|
|||
//-----------//
|
||||
TextContext->setHotSpot(UTextContext::TopLeft);
|
||||
line = 1.f;
|
||||
string str;
|
||||
#if FINAL_VERSION
|
||||
str = "FV";
|
||||
#else
|
||||
str = "DEV";
|
||||
#endif
|
||||
if(ClientCfg.ExtendedCommands)
|
||||
str += "_E";
|
||||
str += " "RYZOM_VERSION;
|
||||
string str = getDisplayVersion();
|
||||
TextContext->printfAt(0.f, line, "Version %s", str.c_str());
|
||||
|
||||
// TOP MIDDLE //
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "global.h"
|
||||
#include "nel/misc/events.h"
|
||||
#include "nel/3d/u_texture.h"
|
||||
#include "game_share/ryzom_version.h"
|
||||
#include "nel/misc/i18n.h"
|
||||
#include "continent.h"
|
||||
#include "weather.h"
|
||||
|
@ -31,6 +30,7 @@
|
|||
#include "release.h"
|
||||
#include "net_manager.h"
|
||||
#include "client_cfg.h"
|
||||
#include "user_agent.h"
|
||||
#include "bg_downloader_access.h"
|
||||
#include "nel/misc/system_utils.h"
|
||||
#include "nel/3d/stereo_hmd.h"
|
||||
|
@ -277,13 +277,7 @@ void CProgress::internalProgress (float value)
|
|||
// Display the build version.
|
||||
TextContext->setFontSize((uint)(12.f * fontFactor));
|
||||
TextContext->setHotSpot(UTextContext::TopRight);
|
||||
string str;
|
||||
#if FINAL_VERSION
|
||||
str = "FV ";
|
||||
#else
|
||||
str = "DEV ";
|
||||
#endif
|
||||
str += RYZOM_VERSION;
|
||||
string str = getDisplayVersion();
|
||||
TextContext->printfAt(1.0f,1.0f, str.c_str());
|
||||
|
||||
// Display the tips of the day.
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
|
||||
#include "stdpch.h"
|
||||
#include "user_agent.h"
|
||||
#include "client_cfg.h"
|
||||
|
||||
#include "game_share/ryzom_version.h"
|
||||
|
||||
#if defined(RYZOM_COMPATIBILITY_VERSION) && defined(HAVE_REVISION_H)
|
||||
#ifdef HAVE_REVISION_H
|
||||
#include "revision.h"
|
||||
#endif
|
||||
|
||||
|
@ -60,17 +61,57 @@ std::string getUserAgentVersion()
|
|||
|
||||
if (s_userAgent.empty())
|
||||
{
|
||||
char buffer[256];
|
||||
|
||||
#if defined(REVISION) && defined(RYZOM_COMPATIBILITY_VERSION)
|
||||
// we don't need RYZOM_VERSION if we already have a numeric form a.b.c, we just need to append revision to it
|
||||
sprintf(buffer, "%s.%s-%s-%s", RYZOM_COMPATIBILITY_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
#ifdef REVISION
|
||||
s_userAgent = NLMISC::toString("%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
#else
|
||||
sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
s_userAgent = NLMISC::toString("%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH);
|
||||
#endif
|
||||
|
||||
s_userAgent = buffer;
|
||||
}
|
||||
|
||||
return s_userAgent;
|
||||
}
|
||||
|
||||
std::string getVersion()
|
||||
{
|
||||
return RYZOM_VERSION;
|
||||
}
|
||||
|
||||
std::string getDisplayVersion()
|
||||
{
|
||||
static std::string s_version;
|
||||
|
||||
if (s_version.empty())
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
s_version = "FV ";
|
||||
#else
|
||||
s_version = "DEV ";
|
||||
#endif
|
||||
if (ClientCfg.ExtendedCommands) s_version += "_E";
|
||||
|
||||
s_version += getVersion();
|
||||
|
||||
#ifdef REVISION
|
||||
s_version += NLMISC::toString(".%s", REVISION);
|
||||
#endif
|
||||
}
|
||||
|
||||
return s_version;
|
||||
}
|
||||
|
||||
std::string getDebugVersion()
|
||||
{
|
||||
static std::string s_version;
|
||||
|
||||
if (s_version.empty())
|
||||
{
|
||||
s_version = getDisplayVersion();
|
||||
#ifdef BUILD_DATE
|
||||
s_version += NLMISC::toString(" (%s)", BUILD_DATE);
|
||||
#else
|
||||
s_version += NLMISC::toString(" (%s %s)", __DATE__, __TIME__);
|
||||
#endif
|
||||
}
|
||||
|
||||
return s_version;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,10 @@ std::string getUserAgent();
|
|||
std::string getUserAgentName();
|
||||
std::string getUserAgentVersion();
|
||||
|
||||
std::string getVersion();
|
||||
std::string getDisplayVersion();
|
||||
std::string getDebugVersion();
|
||||
|
||||
#endif // CL_USER_AGENT_H
|
||||
|
||||
/* End of user_agent.h */
|
||||
|
|
Loading…
Reference in a new issue