mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 03:09:49 +02:00
Added const strings for versions
This commit is contained in:
@@ -195,11 +195,6 @@ namespace Shared {
|
||||
void findAll(const string &path, vector<string> &results, bool cutExtension = false, bool errorOnNotFound = true);
|
||||
vector<string> getFolderTreeContentsListRecursively(const string &path, const string &filterFileExt, bool includeFolders = false, vector<string> *recursiveMap = NULL);
|
||||
|
||||
//string getGameVersion();
|
||||
//string getGameGITVersion();
|
||||
void setGameVersion(const string &version);
|
||||
void setGameGITVersion(const string &git);
|
||||
|
||||
string getCRCCacheFilePath();
|
||||
void setCRCCacheFilePath(const string &path);
|
||||
|
||||
|
@@ -12,14 +12,15 @@
|
||||
#ifndef _SHARED_PLATFORM_DEFINITIONS_H_
|
||||
#define _SHARED_PLATFORM_DEFINITIONS_H_
|
||||
|
||||
#include <string>
|
||||
#include "versions.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
namespace Shared {
|
||||
namespace Platform {
|
||||
|
||||
|
||||
|
||||
}
|
||||
const std::string GameVersionString = GAME_VERSION;
|
||||
const std::string LastCompatibleVersionString = LAST_COMPATIBLE_VERSION;
|
||||
const std::string G3DViewerVersionString = G3D_VIEWER_VERSION;
|
||||
const std::string MapEditorVersionString = MAP_EDITOR_VERSION;
|
||||
}//end namespace
|
||||
|
||||
#endif
|
@@ -50,7 +50,6 @@ namespace Shared {
|
||||
string path;
|
||||
static string applicationPath;
|
||||
static string applicationDataPath;
|
||||
static string gameVersion;
|
||||
|
||||
static string techtreePath;
|
||||
static string scenarioPath;
|
||||
@@ -76,14 +75,6 @@ namespace Shared {
|
||||
return applicationDataPath;
|
||||
}
|
||||
|
||||
static void setGameVersion(string value) {
|
||||
Shared::PlatformCommon::replaceAll(value, "\\", "/");
|
||||
gameVersion = value;
|
||||
}
|
||||
static string getGameVersion() {
|
||||
return gameVersion;
|
||||
}
|
||||
|
||||
static void setTechtreePath(string value) {
|
||||
Shared::PlatformCommon::replaceAll(value, "\\", "/");
|
||||
techtreePath = value;
|
||||
|
@@ -71,6 +71,7 @@
|
||||
#include "platform_util.h"
|
||||
#include "utf8.h"
|
||||
#include "byte_order.h"
|
||||
#include "shared_definitions.h"
|
||||
|
||||
#if _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
|
||||
#include <unistd.h>
|
||||
@@ -97,8 +98,6 @@ namespace Shared {
|
||||
const time_t REFRESH_CRC_DAY_SECONDS = 60 * 60 * 24;
|
||||
static string crcCachePath = "";
|
||||
static void(*unexpected_handler)(const char*) = NULL;
|
||||
static string gameVersion = "";
|
||||
static string gameGITVersion = "";
|
||||
|
||||
namespace Private {
|
||||
|
||||
@@ -687,19 +686,6 @@ namespace Shared {
|
||||
unexpected_handler = handler;
|
||||
}
|
||||
|
||||
//string getGameVersion() {
|
||||
// return gameVersion;
|
||||
//}
|
||||
//string getGameGITVersion() {
|
||||
// return gameGITVersion;
|
||||
//}
|
||||
void setGameVersion(const string &version) {
|
||||
gameVersion = version;
|
||||
}
|
||||
void setGameGITVersion(const string &git) {
|
||||
gameGITVersion = git;
|
||||
}
|
||||
|
||||
string getCRCCacheFileName(std::pair<string, string> cacheKeys) {
|
||||
string crcCacheFile = cacheKeys.first + cacheKeys.second;
|
||||
return crcCacheFile;
|
||||
@@ -859,8 +845,7 @@ namespace Shared {
|
||||
char szBuf1[100] = "";
|
||||
strftime(szBuf1, 100, "%Y-%m-%d %H:%M:%S", &loctime);
|
||||
|
||||
string writeGameVer = Shared::PlatformByteOrder::toCommonEndian(gameVersion);
|
||||
string writeGameGITVersion = Shared::PlatformByteOrder::toCommonEndian(gameGITVersion);
|
||||
string writeGameVer = Shared::PlatformByteOrder::toCommonEndian(GameVersionString);
|
||||
string writeActualFileName = Shared::PlatformByteOrder::toCommonEndian(actualFileName);
|
||||
|
||||
fprintf(fp, "%20ld,%20u,%20ld",
|
||||
@@ -868,9 +853,8 @@ namespace Shared {
|
||||
Shared::PlatformByteOrder::toCommonEndian(crcValue),
|
||||
(long) Shared::PlatformByteOrder::toCommonEndian(now));
|
||||
|
||||
fprintf(fp, "\n%s\n%s\n%s",
|
||||
fprintf(fp, "\n%s\n%s",
|
||||
writeGameVer.c_str(),
|
||||
writeGameGITVersion.c_str(),
|
||||
writeActualFileName.c_str());
|
||||
|
||||
fclose(fp);
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "conversion.h"
|
||||
#include "versions.h"
|
||||
#include "shared_definitions.h"
|
||||
|
||||
using namespace Shared::Util;
|
||||
using namespace Shared::PlatformCommon;
|
||||
@@ -837,7 +837,7 @@ namespace Shared {
|
||||
if (SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf("===> IRC: Line: %d\n", __LINE__);
|
||||
|
||||
safeMutex.Lock();
|
||||
if (irc_connect(ircSession, argv[0].c_str(), IRC_SERVER_PORT, 0, this->nick.c_str(), this->username.c_str(), (string("ZetaGlest ") + GAME_VERSION).c_str())) {
|
||||
if (irc_connect(ircSession, argv[0].c_str(), IRC_SERVER_PORT, 0, this->nick.c_str(), this->username.c_str(), (string("ZetaGlest ") + GameVersionString).c_str())) {
|
||||
safeMutex.ReleaseLock();
|
||||
if (SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf("===> IRC Could not connect: %s\n", irc_strerror(irc_errno(ircSession)));
|
||||
return;
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "utf8.h"
|
||||
#include "font.h"
|
||||
#include "string_utils.h"
|
||||
#include "shared_definitions.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -45,7 +46,6 @@ namespace Shared {
|
||||
|
||||
string Properties::applicationPath = "";
|
||||
string Properties::applicationDataPath = "";
|
||||
string Properties::gameVersion = "";
|
||||
|
||||
string Properties::techtreePath = "";
|
||||
string Properties::scenarioPath = "";
|
||||
@@ -270,7 +270,7 @@ namespace Shared {
|
||||
mapTagReplacementValues["{SCENARIOPATH}"] = Properties::scenarioPath;
|
||||
mapTagReplacementValues["{TUTORIALPATH}"] = Properties::tutorialPath;
|
||||
|
||||
mapTagReplacementValues["$GAMEVERSION"] = Properties::gameVersion;
|
||||
mapTagReplacementValues["$GAMEVERSION"] = GameVersionString;
|
||||
|
||||
//
|
||||
// #2
|
||||
@@ -407,7 +407,7 @@ namespace Shared {
|
||||
// }
|
||||
replaceAll(value, "{TUTORIALPATH}", Properties::tutorialPath);
|
||||
|
||||
replaceAll(value, "$GAMEVERSION", Properties::gameVersion);
|
||||
replaceAll(value, "$GAMEVERSION", GameVersionString);
|
||||
}
|
||||
|
||||
//if(originalValue != value || originalValue.find("$APPLICATIONDATAPATH") != string::npos) {
|
||||
|
Reference in New Issue
Block a user