Added the ability to tell mega-glest where to look for glest.ini, servers.ini and all of the various .log files. The new optional environment variable that mega-glest will look for is:

GLESTHOME
This commit is contained in:
Mark Vejvoda
2010-03-21 23:40:35 +00:00
parent 9756217445
commit 344c4778d1
14 changed files with 434 additions and 26 deletions

View File

@@ -233,13 +233,13 @@ bool isdir(const char *path)
bool EndsWith(const string &str, const string& key)
{
size_t keylen = key.length();
size_t strlen = str.length();
bool result = false;
if (str.length() > key.length()) {
result = (0 == str.compare (str.length() - key.length(), key.length(), key));
}
if(keylen <= strlen)
return string::npos != str.rfind(key.c_str(),strlen - keylen, keylen);
else
return false;
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] result [%d] str = [%s] key = [%s]\n",__FILE__,__FUNCTION__,result,str.c_str(),key.c_str());
return result;
}
//finds all filenames like path and gets their checksum of all files combined

View File

@@ -270,13 +270,13 @@ bool isdir(const char *path)
bool EndsWith(const string &str, const string& key)
{
size_t keylen = key.length();
size_t strlen = str.length();
if(keylen <= strlen)
return string::npos != str.rfind(key.c_str(),strlen - keylen, keylen);
else
return false;
bool result = false;
if (str.length() > key.length()) {
result = (0 == str.compare (str.length() - key.length(), key.length(), key));
}
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] result [%d] str = [%s] key = [%s]\n",__FILE__,__FUNCTION__,result,str.c_str(),key.c_str());
return result;
}
//finds all filenames like path and gets their checksum of all files combined
@@ -475,7 +475,7 @@ void getFullscreenVideoInfo(int &colorBits,int &screenWidth,int &screenHeight) {
//const SDL_VideoInfo* vidInfo = SDL_GetVideoInfo();
//colorBits = vidInfo->vfmt->BitsPerPixel;
//screenWidth = vidInfo->current_w;
/*
//screenHeight = vidInfo->current_h;
int cx = GetSystemMetrics(SM_CXVIRTUALSCREEN);

View File

@@ -155,9 +155,6 @@ const char* WSAGetLastErrorMessage(const char* pcMessagePrefix,
namespace Shared{ namespace Platform{
bool Socket::enableDebugText = true;
bool Socket::enableNetworkDebugInfo = true;
// =====================================================
// class Ip
// =====================================================