Changes for Win98 support.

This commit is contained in:
lotodore
2007-04-13 22:10:55 +00:00
parent cd37f783ef
commit 496261de7b
3 changed files with 130 additions and 119 deletions
+2
View File
@@ -88,6 +88,8 @@ Reason:
0x02 - Server full 0x02 - Server full
0x03 - Game is already running 0x03 - Game is already running
0x04 - Invalid Password 0x04 - Invalid Password
0x05 - Player Name already in use
0x06 - Invalid Player Name
0xFF - Other cause 0xFF - Other cause
+16 -7
View File
@@ -26,6 +26,7 @@
#define MODUS 0711 #define MODUS 0711
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h>
#include <direct.h> #include <direct.h>
#endif #endif
@@ -42,21 +43,29 @@ ConfigFile::ConfigFile()
if (appDataPath && appDataPath[0] != 0) { if (appDataPath && appDataPath[0] != 0) {
configFileName = appDataPath; configFileName = appDataPath;
} }
else { else {
configFileName = getcwd(); const int MaxPathSize = 1024;
//Testen ob das Verzeichnis beschreibbar ist char curDir[MaxPathSize + 1];
curDir[0] = 0;
_getcwd(curDir, MaxPathSize);
curDir[MaxPathSize] = 0;
configFileName = curDir;
// Testen ob das Verzeichnis beschreibbar ist
ofstream tmpFile; ofstream tmpFile;
         const char *tmpFileName = "pokerth_test.tmp"; const char *tmpFileName = "pokerth_test.tmp";
         tmpFile.open(tmpFileName); tmpFile.open((configFileName + "\\" + tmpFileName).c_str());
if (tmpFile) { if (tmpFile) {
// Erfolgreich, Verzeichnis beschreibbar. // Erfolgreich, Verzeichnis beschreibbar.
// Datei wieder loeschen. // Datei wieder loeschen.
tmpFile.close(); tmpFile.close();
remove(tmpFileName); remove((configFileName + "\\" + tmpFileName).c_str());
} }
else { else {
// Fehlgeschlagen, Verzeichnis nicht beschreibbar // Fehlgeschlagen, Verzeichnis nicht beschreibbar
configFileName = "C:\\Windows\\Temp\\"; curDir[0] = 0;
GetTempPathA(MaxPathSize, curDir);
curDir[MaxPathSize] = 0;
configFileName = curDir;
} }
} }
//Programmordner erstellen //Programmordner erstellen
+112 -112
View File
@@ -1,113 +1,113 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2006 by FThauer FHammer * * Copyright (C) 2006 by FThauer FHammer *
* f.thauer@web.de * * f.thauer@web.de *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#ifndef GUIWRAPPER_H #ifndef GUIWRAPPER_H
#define GUIWRAPPER_H #define GUIWRAPPER_H
#include <guiinterface.h> #include <guiinterface.h>
#include "log.h" #include "log.h"
#include "mainwindowimpl.h" #include "mainwindowimpl.h"
#include "connecttoserverdialogimpl.h" #include "connecttoserverdialogimpl.h"
#include "qthelper.h" #include "qthelper.h"
#include "configfile.h" #include "configfile.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "handinterface.h" #include "handinterface.h"
#include "session.h" #include "session.h"
#include "game.h" #include "game.h"
class GuiWrapper : public GuiInterface class GuiWrapper : public GuiInterface
{ {
public: public:
GuiWrapper(); GuiWrapper();
~GuiWrapper(); ~GuiWrapper();
void setGame(Game*); void setGame(Game*);
void setHand(HandInterface*); void setHand(HandInterface*);
void setSession(Session*); void setSession(Session*);
int getMaxQuantityPlayers() const; int getMaxQuantityPlayers() const;
void refreshSet() const; void refreshSet() const;
void refreshCash() const; void refreshCash() const;
void refreshAction(int =-1, int =-1) const; void refreshAction(int =-1, int =-1) const;
void refreshChangePlayer() const; void refreshChangePlayer() const;
void refreshPot() const; void refreshPot() const;
void refreshGroupbox(int =-1, int =-1) const; void refreshGroupbox(int =-1, int =-1) const;
void refreshAll() const; void refreshAll() const;
void refreshPlayerName() const; void refreshPlayerName() const;
void dealHoleCards() const; void dealHoleCards() const;
void dealFlopCards() const; void dealFlopCards() const;
void dealTurnCard() const; void dealTurnCard() const;
void dealRiverCard() const; void dealRiverCard() const;
void highlightRoundLabel(std::string round) const; void highlightRoundLabel(std::string round) const;
void nextPlayerAnimation() const; void nextPlayerAnimation() const;
void preflopAnimation1() const; void preflopAnimation1() const;
void preflopAnimation2() const; void preflopAnimation2() const;
void flopAnimation1() const; void flopAnimation1() const;
void flopAnimation2() const; void flopAnimation2() const;
void turnAnimation1() const; void turnAnimation1() const;
void turnAnimation2() const; void turnAnimation2() const;
void riverAnimation1() const; void riverAnimation1() const;
void riverAnimation2() const; void riverAnimation2() const;
void postRiverAnimation1() const; void postRiverAnimation1() const;
void postRiverRunAnimation1() const; void postRiverRunAnimation1() const;
void flipHolecardsAllIn() const; void flipHolecardsAllIn() const;
void nextRoundCleanGui() const; void nextRoundCleanGui() const;
void meInAction() const; void meInAction() const;
void logPlayerActionMsg(std::string playerName, int action, int setValue) ; void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
void logNewGameHandMsg(int gameID, int handID) ; void logNewGameHandMsg(int gameID, int handID) ;
std::string stringToUtf8(const std::string &); std::string stringToUtf8(const std::string &);
void SignalNetClientConnect(int actionID); void SignalNetClientConnect(int actionID);
void SignalNetClientGameInfo(int actionID); void SignalNetClientGameInfo(int actionID);
void SignalNetClientError(int errorID, int osErrorID); void SignalNetClientError(int errorID, int osErrorID);
void SignalNetServerSuccess(int actionID); void SignalNetServerSuccess(int actionID);
void SignalNetServerError(int errorID, int osErrorID); void SignalNetServerError(int errorID, int osErrorID);
void SignalNetServerPlayerJoined(const std::string &playerName); void SignalNetServerPlayerJoined(const std::string &playerName);
private: private:
Log *myLog; Log *myLog;
mainWindowImpl *myW; mainWindowImpl *myW;
ConfigFile *myConfig; ConfigFile *myConfig;
QtHelper *myQtHelper; QtHelper *myQtHelper;
}; };
#endif #endif