Some more changes concerning avatars. Directory changes. App data now QApplication independent.

This commit is contained in:
lotodore
2007-09-08 20:40:46 +00:00
parent 2780b504b4
commit e76be2a6ff
12 changed files with 122 additions and 79 deletions
+12 -1
View File
@@ -45,7 +45,11 @@ Additional values for major version = 2:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Password Length | Player Name Length | | Password Length | Player Name Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | | Privacy Flags | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
\ Avatar MD5 (optional, 16 Bytes) /
| +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
\ Password (UTF-8) / \ Password (UTF-8) /
@@ -57,6 +61,8 @@ Additional values for major version = 2:
| +-------------------------------+ | +-------------------------------+
/ | padding | / | padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Privacy Flags:
0x01 set: Show avatar (insert Avatar MD5).
Server Reply: Init ACK Server Reply: Init ACK
@@ -183,6 +189,10 @@ Server Reply: Player Info
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Player Flags | Player Name Length | | Player Flags | Player Name Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
\ Avatar MD5 (optional, 16 Bytes) /
| +
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| \ | \
\ Player Name (UTF-8) / \ Player Name (UTF-8) /
| +-------------------------------+ | +-------------------------------+
@@ -190,6 +200,7 @@ Server Reply: Player Info
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Player Flags: Player Flags:
0x01 set: Player is human 0x01 set: Player is human
0x02 set: Player has avatar
Client Request: Create Game Client Request: Create Game
+6 -2
View File
@@ -28,6 +28,8 @@
#include <direct.h> #include <direct.h>
#endif #endif
#include <boost/filesystem.hpp>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <cstdlib> #include <cstdlib>
@@ -47,7 +49,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
myQtToolsInterface = new QtToolsWrapper; myQtToolsInterface = new QtToolsWrapper;
for (i=0; i<argc; i++) { for (i=1; i<argc; i++) {
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; } if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
} }
// !!!! Revisionsnummer der Configdefaults !!!!! // !!!! Revisionsnummer der Configdefaults !!!!!
@@ -141,6 +143,8 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
claNoWriteAccess = "1"; claNoWriteAccess = "1";
} }
boost::filesystem::path startPath(argv[0]);
ostringstream tempIntToString; ostringstream tempIntToString;
tempIntToString << configRev; tempIntToString << configRev;
configList.push_back(ConfigInfo("ConfigRevision", CONFIG_TYPE_INT, tempIntToString.str())); configList.push_back(ConfigInfo("ConfigRevision", CONFIG_TYPE_INT, tempIntToString.str()));
@@ -207,7 +211,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
configList.push_back(ConfigInfo("LogStoreDuration", CONFIG_TYPE_INT, "2")); configList.push_back(ConfigInfo("LogStoreDuration", CONFIG_TYPE_INT, "2"));
configList.push_back(ConfigInfo("LogInterval", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("LogInterval", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("UserDataDir", CONFIG_TYPE_STRING, dataDir)); configList.push_back(ConfigInfo("UserDataDir", CONFIG_TYPE_STRING, dataDir));
configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, myQtToolsInterface->getDataPathStdString())); configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, myQtToolsInterface->getDataPathStdString(startPath.remove_leaf().directory_string())));
configList.push_back(ConfigInfo("CacheDir", CONFIG_TYPE_STRING, cacheDir)); configList.push_back(ConfigInfo("CacheDir", CONFIG_TYPE_STRING, cacheDir));
configList.push_back(ConfigInfo("CLA_NoWriteAccess", CONFIG_TYPE_INT, claNoWriteAccess)); configList.push_back(ConfigInfo("CLA_NoWriteAccess", CONFIG_TYPE_INT, claNoWriteAccess));
+9 -3
View File
@@ -126,11 +126,17 @@ AvatarManager::InternalReadDirectory(const std::string &dir)
if (is_regular(i->status())) if (is_regular(i->status()))
{ {
string md5sum(basename(i->path())); string md5sum(basename(i->path()));
MD5Buf tmpBuf; MD5Buf md5buf;
if (tmpBuf.FromString(md5sum)) string fileName(i->path().file_string());
bool success = true;
if (!md5buf.FromString(md5sum))
{ {
m_avatars.insert(AvatarMap::value_type(tmpBuf, i->path().file_string())); // sigh. File name is not an md5 sum. Calculate on our own...
if (!CryptHelper::MD5Sum(fileName, md5buf))
success = false;
} }
if (success)
m_avatars.insert(AvatarMap::value_type(md5buf, fileName));
} }
++i; ++i;
} }
+59 -60
View File
@@ -42,7 +42,6 @@
#include "game.h" #include "game.h"
#include "session.h" #include "session.h"
#include "tools.h" #include "tools.h"
#include "qthelper.h"
#include "configfile.h" #include "configfile.h"
#include "sdlplayer.h" #include "sdlplayer.h"
@@ -70,7 +69,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
} }
//////////////////////////// ////////////////////////////
myQtHelper = new QtHelper; myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
setupUi(this); setupUi(this);
@@ -177,13 +176,13 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
//Flipside festlegen; //Flipside festlegen;
flipside = new QPixmap(myQtHelper->getDataPath() +"gfx/cards/default/flipside.png"); flipside = new QPixmap(myAppDataPath +"gfx/cards/default/flipside.png");
if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") { if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") {
QPixmap tmpFlipside(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str())); QPixmap tmpFlipside(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
flipside = new QPixmap(tmpFlipside.scaled(QSize(80, 111),Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); flipside = new QPixmap(tmpFlipside.scaled(QSize(80, 111),Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
} }
else { flipside->load(myQtHelper->getDataPath() +"gfx/cards/default/flipside.png"); } else { flipside->load(myAppDataPath +"gfx/cards/default/flipside.png"); }
//Flipside Animation noch nicht erledigt //Flipside Animation noch nicht erledigt
flipHolecardsAllInAlreadyDone = FALSE; flipHolecardsAllInAlreadyDone = FALSE;
@@ -452,16 +451,16 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
//Widgets Grafiken setzen //Widgets Grafiken setzen
label_CardHolder0->setPixmap(myQtHelper->getDataPath() + "gfx/gui/table/default/cardholder_flop.png"); label_CardHolder0->setPixmap(myAppDataPath + "gfx/gui/table/default/cardholder_flop.png");
label_CardHolder1->setPixmap(myQtHelper->getDataPath() + "gfx/gui/table/default/cardholder_flop.png"); label_CardHolder1->setPixmap(myAppDataPath + "gfx/gui/table/default/cardholder_flop.png");
label_CardHolder2->setPixmap(myQtHelper->getDataPath() + "gfx/gui/table/default/cardholder_flop.png"); label_CardHolder2->setPixmap(myAppDataPath + "gfx/gui/table/default/cardholder_flop.png");
label_CardHolder3->setPixmap(myQtHelper->getDataPath() + "gfx/gui/table/default/cardholder_turn.png"); label_CardHolder3->setPixmap(myAppDataPath + "gfx/gui/table/default/cardholder_turn.png");
label_CardHolder4->setPixmap(myQtHelper->getDataPath() + "gfx/gui/table/default/cardholder_river.png"); label_CardHolder4->setPixmap(myAppDataPath + "gfx/gui/table/default/cardholder_river.png");
label_Handranking->setPixmap(myQtHelper->getDataPath() + "gfx/gui/misc/handRanking.png"); label_Handranking->setPixmap(myAppDataPath + "gfx/gui/misc/handRanking.png");
//Widgets Grafiken per Stylesheets setzen //Widgets Grafiken per Stylesheets setzen
this->setStyleSheet("QMainWindow { background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/table.png); background-position: bottom center; background-origin: content;}"); this->setStyleSheet("QMainWindow { background-image: url(" + myAppDataPath +"gfx/gui/table/default/table.png); background-position: bottom center; background-origin: content;}");
menubar->setStyleSheet("QMenuBar { background-color: #145300; } QMenuBar::item { color: #669800; }"); menubar->setStyleSheet("QMenuBar { background-color: #145300; } QMenuBar::item { color: #669800; }");
@@ -474,17 +473,17 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
//Groupbox Background //Groupbox Background
for (i=1; i<MAX_NUMBER_OF_PLAYERS; i++) { for (i=1; i<MAX_NUMBER_OF_PLAYERS; i++) {
groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }"); groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }");
} }
groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxInactiveGlow.png) }"); groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow.png) }");
//Human player button //Human player button
pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playeraction_03.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
pushButton_CallCheckSet->setStyleSheet("QPushButton { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playeraction_05.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_CallCheckSet->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
pushButton_FoldAllin->setStyleSheet("QPushButton { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playeraction_07.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_FoldAllin->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
groupBox_RightToolBox->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/misc/toolboxFrameBG.png) }"); groupBox_RightToolBox->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/misc/toolboxFrameBG.png) }");
groupBox_LeftToolBox->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/misc/toolboxFrameBG.png) }"); groupBox_LeftToolBox->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/misc/toolboxFrameBG.png) }");
//raise actionLable above just inserted mypixmaplabel //raise actionLable above just inserted mypixmaplabel
@@ -505,7 +504,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
//windowicon //windowicon
// QString windowIconString(); // QString windowIconString();
this->setWindowIcon(QIcon(myQtHelper->getDataPath()+"gfx/gui/misc/windowicon.png")); this->setWindowIcon(QIcon(myAppDataPath+"gfx/gui/misc/windowicon.png"));
//Statusbar //Statusbar
if(myConfig->readConfigInt("ShowStatusbarMessages")) { if(myConfig->readConfigInt("ShowStatusbarMessages")) {
@@ -909,7 +908,7 @@ void mainWindowImpl::callSettingsDialog() {
QPixmap tmpFlipside(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str())); QPixmap tmpFlipside(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80))); flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80)));
} }
else { flipside->load(myQtHelper->getDataPath() +"gfx/cards/default/flipside.png"); } else { flipside->load(myAppDataPath +"gfx/cards/default/flipside.png"); }
if(mySession->getCurrentGame()) { if(mySession->getCurrentGame()) {
//blind buttons refresh //blind buttons refresh
@@ -995,10 +994,10 @@ void mainWindowImpl::refreshSet() {
void mainWindowImpl::refreshButton() { void mainWindowImpl::refreshButton() {
QPixmap dealerButton(myQtHelper->getDataPath() +"gfx/gui/table/default/dealerPuck.png"); QPixmap dealerButton(myAppDataPath +"gfx/gui/table/default/dealerPuck.png");
QPixmap smallblindButton(myQtHelper->getDataPath() +"gfx/gui/table/default/smallblindPuck.png"); QPixmap smallblindButton(myAppDataPath +"gfx/gui/table/default/smallblindPuck.png");
QPixmap bigblindButton(myQtHelper->getDataPath() +"gfx/gui/table/default/bigblindPuck.png"); QPixmap bigblindButton(myAppDataPath +"gfx/gui/table/default/bigblindPuck.png");
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
int i; int i;
int k; int k;
@@ -1067,7 +1066,7 @@ void mainWindowImpl::refreshPlayerName() {
void mainWindowImpl::refreshPlayerAvatar() { void mainWindowImpl::refreshPlayerAvatar() {
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
int i; int i;
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
@@ -1077,7 +1076,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
if(!i) { if(!i) {
if(currentHand->getPlayerArray()[0]->getMyAvatar() == "" || !QFile::QFile(QString::fromUtf8(currentHand->getPlayerArray()[0]->getMyAvatar().c_str())).exists()) { if(currentHand->getPlayerArray()[0]->getMyAvatar() == "" || !QFile::QFile(QString::fromUtf8(currentHand->getPlayerArray()[0]->getMyAvatar().c_str())).exists()) {
playerAvatarLabelArray[0]->setPixmap(QPixmap(myQtHelper->getDataPath() +"gfx/gui/table/default/genereticAvatar.png")); playerAvatarLabelArray[0]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/genereticAvatar.png"));
} }
else { else {
playerAvatarLabelArray[0]->setPixmap(QString::fromUtf8(currentHand->getPlayerArray()[0]->getMyAvatar().c_str())); playerAvatarLabelArray[0]->setPixmap(QString::fromUtf8(currentHand->getPlayerArray()[0]->getMyAvatar().c_str()));
@@ -1085,7 +1084,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
} }
else { else {
if(currentHand->getPlayerArray()[i]->getMyAvatar() == "" || !QFile::QFile(QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyAvatar().c_str())).exists()) { if(currentHand->getPlayerArray()[i]->getMyAvatar() == "" || !QFile::QFile(QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyAvatar().c_str())).exists()) {
playerAvatarLabelArray[i]->setPixmap(QPixmap(myQtHelper->getDataPath() +"gfx/gui/table/default/genereticAvatar.png")); playerAvatarLabelArray[i]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/genereticAvatar.png"));
} }
else { else {
playerAvatarLabelArray[i]->setPixmap(QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyAvatar().c_str())); playerAvatarLabelArray[i]->setPixmap(QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyAvatar().c_str()));
@@ -1100,7 +1099,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
void mainWindowImpl::refreshAction(int playerID, int playerAction) { void mainWindowImpl::refreshAction(int playerID, int playerAction) {
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
QPixmap action; QPixmap action;
QStringList actionArray; QStringList actionArray;
@@ -1120,7 +1119,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
else { else {
// if(i!=0 || ( i==0 && currentHand->getPlayerArray()[0]->getMyAction() != 1) ) { // if(i!=0 || ( i==0 && currentHand->getPlayerArray()[0]->getMyAction() != 1) ) {
//paint action pixmap //paint action pixmap
actionLabelArray[i]->setPixmap(QPixmap(myQtHelper->getDataPath() +"gfx/gui/table/default/action_"+actionArray[currentHand->getPlayerArray()[i]->getMyAction()]+".png")); actionLabelArray[i]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_"+actionArray[currentHand->getPlayerArray()[i]->getMyAction()]+".png"));
// } // }
} }
@@ -1142,7 +1141,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
else { else {
// paint action pixmap and raise // paint action pixmap and raise
actionLabelArray[playerID]->setPixmap(QPixmap(myQtHelper->getDataPath() +"gfx/gui/table/default/action_"+actionArray[playerAction]+".png")); actionLabelArray[playerID]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_"+actionArray[playerAction]+".png"));
//play sounds if exist //play sounds if exist
mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID); mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID);
@@ -1192,37 +1191,37 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
if(currentHand->getPlayerArray()[i]->getMyTurn()) { if(currentHand->getPlayerArray()[i]->getMyTurn()) {
//Groupbox glow wenn der Spiele dran ist. //Groupbox glow wenn der Spiele dran ist.
if(i==0) { if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxActiveGlow.png) }"); groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxActiveGlow.png) }");
} }
else { else {
groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxActiveGlow.png) }"); groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxActiveGlow.png) }");
} }
} else { } else {
//Groupbox auf Hintergrundfarbe setzen wenn der Spiele nicht dran aber aktiv ist. //Groupbox auf Hintergrundfarbe setzen wenn der Spiele nicht dran aber aktiv ist.
if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) { if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
if(i==0) { if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxInactiveGlow.png) }"); groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow.png) }");
//show buttons //show buttons
for(j=0; j<3; j++) { for(j=0; j<3; j++) {
userWidgetsArray[j]->show(); userWidgetsArray[j]->show();
} }
} }
else { else {
groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }"); groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }");
} }
} }
//Groupbox verdunkeln wenn der Spiele inactive ist. //Groupbox verdunkeln wenn der Spiele inactive ist.
else { else {
if(i==0) { if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxInactiveGlow.png) }"); groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow.png) }");
//hide buttons //hide buttons
for(j=0; j<4; j++) { for(j=0; j<4; j++) {
userWidgetsArray[j]->hide(); userWidgetsArray[j]->hide();
} }
} }
else { else {
groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }"); groupBoxArray[i]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }");
} }
} }
} }
@@ -1234,48 +1233,48 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
//inactive //inactive
case 0: { case 0: {
if (!playerID) { if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxInactiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow.png) }");
//hide buttons //hide buttons
for(j=0; j<4; j++) { for(j=0; j<4; j++) {
userWidgetsArray[j]->hide(); userWidgetsArray[j]->hide();
} }
} }
else { else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }");
} }
} }
break; break;
//active but fold //active but fold
case 1: { case 1: {
if (!playerID) { if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxInactiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow.png) }");
//show buttons //show buttons
for(j=0; j<3; j++) { for(j=0; j<3; j++) {
userWidgetsArray[j]->show(); userWidgetsArray[j]->show();
} }
} }
else { else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }");
} }
} }
break; break;
//active in action //active in action
case 2: { case 2: {
if (!playerID) { if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxActiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxActiveGlow.png) }");
} }
else { else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxActiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxActiveGlow.png) }");
} }
} }
break; break;
//active not in action //active not in action
case 3: { case 3: {
if (!playerID) { if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/playerBoxInactiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow.png) }");
} }
else { else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/opponentBoxInactiveGlow.png) }");
} }
} }
break; break;
@@ -1354,7 +1353,7 @@ void mainWindowImpl::waitForGuiUpdateDone() {
void mainWindowImpl::dealHoleCards() { void mainWindowImpl::dealHoleCards() {
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
//TempArrays //TempArrays
QPixmap tempCardsPixmapArray[2]; QPixmap tempCardsPixmapArray[2];
@@ -1370,11 +1369,11 @@ void mainWindowImpl::dealHoleCards() {
if ((i == 0) || DEBUG_MODE) { if ((i == 0) || DEBUG_MODE) {
if(myConfig->readConfigInt("AntiPeekMode")) { if(myConfig->readConfigInt("AntiPeekMode")) {
holeCardsArray[i][j]->setPixmap(*flipside, TRUE); holeCardsArray[i][j]->setPixmap(*flipside, TRUE);
tempCardsPixmapArray[j].load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"); tempCardsPixmapArray[j].load(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png");
holeCardsArray[i][j]->setFrontPixmap(tempCardsPixmapArray[j]); holeCardsArray[i][j]->setFrontPixmap(tempCardsPixmapArray[j]);
} }
else { else {
tempCardsPixmapArray[j].load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"); tempCardsPixmapArray[j].load(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png");
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j],FALSE); holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j],FALSE);
} }
} }
@@ -1434,7 +1433,7 @@ void mainWindowImpl::dealFlopCards4() {
int tempBoardCardsArray[5]; int tempBoardCardsArray[5];
QPixmap tempCardsPixmap; QPixmap tempCardsPixmap;
mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray); mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray);
tempCardsPixmap.load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempBoardCardsArray[0], 10)+".png"); tempCardsPixmap.load(myAppDataPath +"gfx/cards/default/"+QString::number(tempBoardCardsArray[0], 10)+".png");
QPixmap card(tempCardsPixmap); QPixmap card(tempCardsPixmap);
//Config? mit oder ohne Eye-Candy? //Config? mit oder ohne Eye-Candy?
@@ -1454,7 +1453,7 @@ void mainWindowImpl::dealFlopCards5() {
int tempBoardCardsArray[5]; int tempBoardCardsArray[5];
QPixmap tempCardsPixmap; QPixmap tempCardsPixmap;
mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray); mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray);
tempCardsPixmap.load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempBoardCardsArray[1], 10)+".png"); tempCardsPixmap.load(myAppDataPath +"gfx/cards/default/"+QString::number(tempBoardCardsArray[1], 10)+".png");
QPixmap card(tempCardsPixmap); QPixmap card(tempCardsPixmap);
//Config? mit oder ohne Eye-Candy? //Config? mit oder ohne Eye-Candy?
@@ -1474,7 +1473,7 @@ void mainWindowImpl::dealFlopCards6() {
int tempBoardCardsArray[5]; int tempBoardCardsArray[5];
QPixmap tempCardsPixmap; QPixmap tempCardsPixmap;
mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray); mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray);
tempCardsPixmap.load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempBoardCardsArray[2], 10)+".png"); tempCardsPixmap.load(myAppDataPath +"gfx/cards/default/"+QString::number(tempBoardCardsArray[2], 10)+".png");
QPixmap card(tempCardsPixmap); QPixmap card(tempCardsPixmap);
//Config? mit oder ohne Eye-Candy? //Config? mit oder ohne Eye-Candy?
@@ -1507,7 +1506,7 @@ void mainWindowImpl::dealTurnCards2() {
int tempBoardCardsArray[5]; int tempBoardCardsArray[5];
QPixmap tempCardsPixmap; QPixmap tempCardsPixmap;
mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray); mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray);
tempCardsPixmap.load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempBoardCardsArray[3], 10)+".png"); tempCardsPixmap.load(myAppDataPath +"gfx/cards/default/"+QString::number(tempBoardCardsArray[3], 10)+".png");
QPixmap card(tempCardsPixmap); QPixmap card(tempCardsPixmap);
//Config? mit oder ohne Eye-Candy? //Config? mit oder ohne Eye-Candy?
@@ -1542,7 +1541,7 @@ void mainWindowImpl::dealRiverCards2() {
int tempBoardCardsArray[5]; int tempBoardCardsArray[5];
QPixmap tempCardsPixmap; QPixmap tempCardsPixmap;
mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray); mySession->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(tempBoardCardsArray);
tempCardsPixmap.load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempBoardCardsArray[4], 10)+".png"); tempCardsPixmap.load(myAppDataPath +"gfx/cards/default/"+QString::number(tempBoardCardsArray[4], 10)+".png");
QPixmap card(tempCardsPixmap); QPixmap card(tempCardsPixmap);
//Config? mit oder ohne Eye-Candy? //Config? mit oder ohne Eye-Candy?
@@ -1970,7 +1969,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) {
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside);
} }
} }
//set Player value (logging) //set Player value (logging)
@@ -1982,7 +1981,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
//Ohne Eye-Candy //Ohne Eye-Candy
//Karten der aktiven Spieler umdrehen //Karten der aktiven Spieler umdrehen
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
//TempArrays //TempArrays
QPixmap tempCardsPixmapArray[2]; QPixmap tempCardsPixmapArray[2];
@@ -1994,7 +1993,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) {
if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) {
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
tempCardsPixmapArray[j].load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"); tempCardsPixmapArray[j].load(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png");
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE); holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE);
} }
@@ -2058,7 +2057,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
// QPalette tempPalette = groupBoxArray[i]->palette(); // QPalette tempPalette = groupBoxArray[i]->palette();
// tempPalette.setColor(QPalette::Window, highlight); // tempPalette.setColor(QPalette::Window, highlight);
// groupBoxArray[i]->setPalette(tempPalette); // groupBoxArray[i]->setPalette(tempPalette);
actionLabelArray[i]->setPixmap(QPixmap(myQtHelper->getDataPath() +"gfx/gui/table/default/action_winner.png")); actionLabelArray[i]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_winner.png"));
//show winnercards if more than one player is active //show winnercards if more than one player is active
if ( currentHand->getActivePlayersCounter() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) { if ( currentHand->getActivePlayersCounter() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
@@ -2255,7 +2254,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) { if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1) {
if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) {
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); holeCardsArray[i][j]->startFlipCards(guiGameSpeed, QPixmap(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside);
} }
} }
//set Player value (logging) //set Player value (logging)
@@ -2268,7 +2267,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
//Ohne Eye-Candy //Ohne Eye-Candy
//Karten der aktiven Spieler umdrehen //Karten der aktiven Spieler umdrehen
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
//TempArrays //TempArrays
QPixmap tempCardsPixmapArray[2]; QPixmap tempCardsPixmapArray[2];
@@ -2281,7 +2280,7 @@ void mainWindowImpl::flipHolecardsAllIn() {
if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) { if(i || (i==0 && myConfig->readConfigInt("AntiPeekMode")) ) {
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
tempCardsPixmapArray[j].load(myQtHelper->getDataPath() +"gfx/cards/default/"+QString::number(temp2CardsIntArray[j], 10)+".png"); tempCardsPixmapArray[j].load(myAppDataPath +"gfx/cards/default/"+QString::number(temp2CardsIntArray[j], 10)+".png");
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE); holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE);
} }
} }
@@ -2339,7 +2338,7 @@ void mainWindowImpl::nextRoundCleanGui() {
int i,j; int i,j;
// GUI bereinigen - Bilder löschen, Animationen unterbrechen // GUI bereinigen - Bilder löschen, Animationen unterbrechen
QPixmap onePix(myQtHelper->getDataPath() +"gfx/gui/misc/1px.png"); QPixmap onePix(myAppDataPath +"gfx/gui/misc/1px.png");
for (i=0; i<5; i++ ) { for (i=0; i<5; i++ ) {
boardCardsArray[i]->setPixmap(onePix, FALSE); boardCardsArray[i]->setPixmap(onePix, FALSE);
boardCardsArray[i]->setFadeOutAction(FALSE); boardCardsArray[i]->setFadeOutAction(FALSE);
+1 -3
View File
@@ -51,7 +51,6 @@ class startNetworkGameDialogImpl;
class changeHumanPlayerNameDialogImpl; class changeHumanPlayerNameDialogImpl;
class gameLobbyDialogImpl; class gameLobbyDialogImpl;
class QtHelper;
class QColor; class QColor;
class SDLPlayer; class SDLPlayer;
@@ -394,8 +393,7 @@ private:
//Sound //Sound
SDLPlayer *mySDLPlayer; SDLPlayer *mySDLPlayer;
QString myAppDataPath;
QtHelper *myQtHelper;
int distributePotAnimCounter; int distributePotAnimCounter;
+26 -4
View File
@@ -32,7 +32,7 @@ std::string QtHelper::getDefaultLanguage() { return QLocale::system().name().toS
QString QtHelper::getDataPath() QString QtHelper::getDataPath()
{ {
QString path = QCoreApplication::instance()->applicationDirPath(); QString path = QCoreApplication::instance()->applicationDirPath();
#ifdef _WIN32 #ifdef _WIN32
path += "/data/"; path += "/data/";
@@ -54,10 +54,32 @@ QString QtHelper::getDataPath()
#endif #endif
return QDir::cleanPath(path) + "/"; return QDir::cleanPath(path) + "/";
} }
std::string QtHelper::getDataPathStdString() std::string QtHelper::getDataPathStdString(const std::string &appPath)
{ {
return getDataPath().toUtf8().constData(); QString path(appPath.c_str());
#ifdef _WIN32
path += "/data/";
#else
#ifdef __APPLE__
if (QRegExp("Contents/MacOS/?$").indexIn(path) != -1) {
// pointing into an macosx application bundle
path += "/../Resources/data/";
} else { path += "/data/"; }
#else //Unix
if (QRegExp("pokerth/?$").indexIn(path) != -1) {
// there is an own application directory
path += "/data/";
} else if (QRegExp("bin/?$").indexIn(path) != -1) {
// we are in a bin directory. e.g. /usr/bin
path += "/../share/pokerth/data/";
} else { path += "/data/"; }
#endif
#endif
return (QDir::cleanPath(path) + "/").toUtf8().constData();
} }
+1 -1
View File
@@ -27,7 +27,7 @@ public:
std::string getDefaultLanguage(); std::string getDefaultLanguage();
QString getDataPath(); QString getDataPath();
std::string getDataPathStdString(); std::string getDataPathStdString(const std::string &appPath);
}; };
+2 -1
View File
@@ -19,6 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include "qttoolswrapper.h" #include "qttoolswrapper.h"
#include <qthelper.h>
using namespace std; using namespace std;
@@ -38,5 +39,5 @@ QtToolsWrapper::~QtToolsWrapper()
std::string QtToolsWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); } std::string QtToolsWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); }
std::string QtToolsWrapper::getDefaultLanguage() { return myQtHelper->getDefaultLanguage(); } std::string QtToolsWrapper::getDefaultLanguage() { return myQtHelper->getDefaultLanguage(); }
std::string QtToolsWrapper::getDataPathStdString() { return myQtHelper->getDataPathStdString(); } std::string QtToolsWrapper::getDataPathStdString(const std::string &appPath) { return myQtHelper->getDataPathStdString(appPath); }
+1 -2
View File
@@ -21,7 +21,6 @@
#define QTTOOLSWRAPPER_H #define QTTOOLSWRAPPER_H
#include <qttoolsinterface.h> #include <qttoolsinterface.h>
#include <qthelper.h>
#include <string> #include <string>
@@ -36,7 +35,7 @@ public:
std::string stringToUtf8(const std::string &myString); std::string stringToUtf8(const std::string &myString);
std::string getDefaultLanguage(); std::string getDefaultLanguage();
std::string getDataPathStdString(); std::string getDataPathStdString(const std::string &appPath);
private: private:
+1 -1
View File
@@ -29,7 +29,7 @@ public:
//qthelper.cpp //qthelper.cpp
virtual std::string stringToUtf8(const std::string &) =0; virtual std::string stringToUtf8(const std::string &) =0;
virtual std::string getDefaultLanguage() =0; virtual std::string getDefaultLanguage() =0;
virtual std::string getDataPathStdString() =0; virtual std::string getDataPathStdString(const std::string &) =0;
}; };
+2 -1
View File
@@ -25,6 +25,7 @@
#include <clientenginefactory.h> #include <clientenginefactory.h>
#include <net/clientthread.h> #include <net/clientthread.h>
#include <net/serveracceptthread.h> #include <net/serveracceptthread.h>
#include <core/avatarmanager.h>
#include <sstream> #include <sstream>
@@ -38,7 +39,7 @@ using namespace std;
Session::Session(GuiInterface *g, ConfigFile *c) Session::Session(GuiInterface *g, ConfigFile *c)
: currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c) : currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c)
{ {
myAvatarManager.reset(new AvatarManager);
} }
+2
View File
@@ -30,6 +30,7 @@ class Game;
class ConfigFile; class ConfigFile;
class ClientThread; class ClientThread;
class ServerAcceptThread; class ServerAcceptThread;
class AvatarManager;
class Session{ class Session{
public: public:
@@ -78,6 +79,7 @@ private:
ClientThread *myNetClient; ClientThread *myNetClient;
ServerAcceptThread *myNetServer; ServerAcceptThread *myNetServer;
boost::shared_ptr<AvatarManager> myAvatarManager;
boost::shared_ptr<Game> currentGame; boost::shared_ptr<Game> currentGame;
GuiInterface *myGui; GuiInterface *myGui;