Changes for Win98 support.
This commit is contained in:
@@ -88,6 +88,8 @@ Reason:
|
||||
0x02 - Server full
|
||||
0x03 - Game is already running
|
||||
0x04 - Invalid Password
|
||||
0x05 - Player Name already in use
|
||||
0x06 - Invalid Player Name
|
||||
0xFF - Other cause
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define MODUS 0711
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
@@ -43,20 +44,28 @@ ConfigFile::ConfigFile()
|
||||
configFileName = appDataPath;
|
||||
}
|
||||
else {
|
||||
configFileName = getcwd();
|
||||
//Testen ob das Verzeichnis beschreibbar ist
|
||||
const int MaxPathSize = 1024;
|
||||
char curDir[MaxPathSize + 1];
|
||||
curDir[0] = 0;
|
||||
_getcwd(curDir, MaxPathSize);
|
||||
curDir[MaxPathSize] = 0;
|
||||
configFileName = curDir;
|
||||
// Testen ob das Verzeichnis beschreibbar ist
|
||||
ofstream tmpFile;
|
||||
const char *tmpFileName = "pokerth_test.tmp";
|
||||
tmpFile.open(tmpFileName);
|
||||
const char *tmpFileName = "pokerth_test.tmp";
|
||||
tmpFile.open((configFileName + "\\" + tmpFileName).c_str());
|
||||
if (tmpFile) {
|
||||
// Erfolgreich, Verzeichnis beschreibbar.
|
||||
// Datei wieder loeschen.
|
||||
tmpFile.close();
|
||||
remove(tmpFileName);
|
||||
remove((configFileName + "\\" + tmpFileName).c_str());
|
||||
}
|
||||
else {
|
||||
// Fehlgeschlagen, Verzeichnis nicht beschreibbar
|
||||
configFileName = "C:\\Windows\\Temp\\";
|
||||
curDir[0] = 0;
|
||||
GetTempPathA(MaxPathSize, curDir);
|
||||
curDir[MaxPathSize] = 0;
|
||||
configFileName = curDir;
|
||||
}
|
||||
}
|
||||
//Programmordner erstellen
|
||||
|
||||
Reference in New Issue
Block a user