- fixup use of --data-path param

This commit is contained in:
SoftCoder 2014-01-03 08:01:33 -08:00
parent 2b9326197a
commit 85319b30fc
3 changed files with 14 additions and 6 deletions

View File

@ -1337,6 +1337,8 @@ int setupGameItemPaths(int argc, char** argv, Config *config) {
}
}
Properties::setApplicationDataPath(pathCache[GameConstants::path_data_CacheLookupKey]);
//GAME_ARG_INI_PATH
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_INI_PATH]) == true) {
int foundParamIndIndex = -1;
@ -3977,6 +3979,7 @@ int glestMain(int argc, char** argv) {
preCacheThread=NULL;
Properties::setApplicationPath(executable_path(argv[0]));
Properties::setApplicationDataPath(executable_path(argv[0]));
Properties::setGameVersion(glestVersionString);
ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers);

View File

@ -47,6 +47,7 @@ private:
string path;
static string applicationPath;
static string applicationDataPath;
static string gameVersion;
static string techtreePath;
@ -57,6 +58,9 @@ public:
static void setApplicationPath(string value) { applicationPath=value; }
static string getApplicationPath() { return applicationPath; }
static void setApplicationDataPath(string value) { applicationDataPath=value; }
static string getApplicationDataPath() { return applicationDataPath; }
static void setGameVersion(string value) { gameVersion=value; }
static string getGameVersion() { return gameVersion; }

View File

@ -42,6 +42,7 @@ using namespace Shared::Graphics;
namespace Shared{ namespace Util{
string Properties::applicationPath = "";
string Properties::applicationDataPath = "";
string Properties::gameVersion = "";
string Properties::techtreePath = "";
@ -234,9 +235,9 @@ std::map<string,string> Properties::getTagReplacementValues(std::map<string,stri
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
#else
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationPath;
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = Properties::applicationPath;
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = Properties::applicationPath;
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationDataPath;
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = Properties::applicationDataPath;
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = Properties::applicationDataPath;
#endif
@ -336,9 +337,9 @@ bool Properties::applyTagsToValue(string &value, const std::map<string,string> *
replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
#else
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationPath);
replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationPath);
replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationPath);
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationDataPath);
replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationDataPath);
replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationDataPath);
#endif