From 2748799679f3a2b6bd8894a946da16ef206f37f5 Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 17 Sep 2008 21:50:51 +0000 Subject: [PATCH] next steps startwindow-integration --> UNSTABLE --- .../93dec21823a314fb8ef2261b7aa75ae5.png | Bin 5458 -> 0 bytes .../d90bd3fbbe3671ebac5f9f223d0c6d65.png | Bin 5266 -> 0 bytes src/game_defs.h | 2 +- src/gui/qt/gametable/gametableimpl.cpp | 430 +----------------- src/gui/qt/gametable/gametableimpl.h | 67 +-- src/gui/qt/guiwrapper.cpp | 10 +- .../selectavatardialogimpl.cpp | 2 - src/gui/qt/startwindow.ui | 22 +- src/gui/qt/startwindow/startwindowimpl.cpp | 357 ++++++++++++++- src/gui/qt/startwindow/startwindowimpl.h | 9 + 10 files changed, 393 insertions(+), 506 deletions(-) delete mode 100644 data/gfx/avatars/default/people/93dec21823a314fb8ef2261b7aa75ae5.png delete mode 100644 data/gfx/avatars/default/people/d90bd3fbbe3671ebac5f9f223d0c6d65.png diff --git a/data/gfx/avatars/default/people/93dec21823a314fb8ef2261b7aa75ae5.png b/data/gfx/avatars/default/people/93dec21823a314fb8ef2261b7aa75ae5.png deleted file mode 100644 index 15db27a3c7c9399fa49700a93fc6a59191adafd3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5458 zcmV-Y6|L%tP)eei)2ZBk0|(&9cl|o7p^suwHLdNL`unfpAu0D$VO?U6#_Fe zBZCrXq_Rp=#)v3V2+{GINrVuH02o3b#@%kGgb-3n0J?bf-R;!{1Rs-^N~i$6cTH86 zd8UAq^Rv3PT91B{8)-GxMLrC}ygs1dIeDWo1Q1EO=#T`EM*xA6h&U!zBn4V+000pc z${3j;#Tehb2m!?Gd`u|U>$O5eP7x`+eDOTEu@GRj5d<{!DR`?JDTI-V1vX9Nr%3@6 z#uRy8=UKPilvd$g7BwFviLTR!!^}!b8AF)H?&8&VnU=ykW7N=12$XA;Dak3K)@5E~S+?731gG5Ux-4^Rl)y}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^@{p7rKCxyl*$aH6sOc~SQ(`olDFsibi6pFHk++>oogBx|A?o#yEi zV;re!)$f1&VJbyyQRo`lAeU$X*4}D>VHkqw)8pIk-o6Pb3#sjP7g1tP1=cC^G6!Wu zGiXw6+d9`ML&iI$R4ygvn7QW4OUy=V>l>>KBcWE;Q+T>ur)m1Zi)XGfWcJPKI4#z= z-uY?)i?mwn^=g%K%tlY+d1ch?Zfh!c*1TF?^Li~M)>_Z!^Wkt9x@N!I3aD`onPX}4 z(DrTDwM`GC&;k*~7%!(~42vLm@0Br!Y5eZ-U|kzh%q(vo9vI=DefFbU1Q`doF>TWaX0ON?qm)8nE*PU2-L6|3a*Q>nWeH=@x)Ehh)9G+Hbk4rGz1g>xBg`<9 z!eK677y+SFqF;MKQc7uNX6AQKtao>W)>>En?$)-e_Wu5U0#$1r$FT)uMp2}URz@SU zh{T*AinRujYON`ySaL`q=Cq`^zq@_9PE!o$^BDkk+pX1lo+hum->IN~l0)x8Yps;} Yf0(-P_KM7A?EnA(07*qoM6N<$g6Yk1`Tzg` diff --git a/src/game_defs.h b/src/game_defs.h index 55537bb2..ceb01902 100644 --- a/src/game_defs.h +++ b/src/game_defs.h @@ -33,7 +33,7 @@ #define POKERTH_VERSION ((POKERTH_VERSION_MAJOR << 8) | POKERTH_VERSION_MINOR) #define POKERTH_BETA_REVISION 0 -#define POKERTH_BETA_RELEASE_STRING "0.6.2" +#define POKERTH_BETA_RELEASE_STRING "0.6.3" enum ServerNetworkMode { NETWORK_MODE_TCP = 1, diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 76c895fd..bf70ef40 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -19,20 +19,8 @@ ***************************************************************************/ #include "gametableimpl.h" -#include "newgamedialogimpl.h" -#include "aboutpokerthimpl.h" #include "mymessagedialogimpl.h" #include "settingsdialogimpl.h" -#include "selectavatardialogimpl.h" -#include "joinnetworkgamedialogimpl.h" -#include "connecttoserverdialogimpl.h" -#include "createnetworkgamedialogimpl.h" -#include "startnetworkgamedialogimpl.h" -#include "changehumanplayernamedialogimpl.h" -#include "changecompleteblindsdialogimpl.h" -#include "gamelobbydialogimpl.h" -#include "timeoutmsgboximpl.h" -#include "lobbychat.h" #include "startwindowimpl.h" #include "startsplash.h" @@ -472,17 +460,6 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) } // Dialogs -// myNewGameDialog = boost::shared_ptr(new newGameDialogImpl(this, myConfig)); -// // mySelectAvatarDialog = boost::shared_ptr(new selectAvatarDialogImpl(this, myConfig)); -// // // mySettingsDialog = boost::shared_ptr(new settingsDialogImpl(this, myConfig, mySelectAvatarDialog.get())); -// // myChangeHumanPlayerNameDialog = boost::shared_ptr(new changeHumanPlayerNameDialogImpl(this, myConfig)); -// // myJoinNetworkGameDialog = boost::shared_ptr(new joinNetworkGameDialogImpl(this, myConfig)); -// // myConnectToServerDialog = boost::shared_ptr(new connectToServerDialogImpl(this)); -// // myStartNetworkGameDialog = boost::shared_ptr(new startNetworkGameDialogImpl(this, myConfig)); -// // myCreateNetworkGameDialog = boost::shared_ptr(new createNetworkGameDialogImpl(this, myConfig)); - - myTimeoutDialog.reset(new timeoutMsgBoxImpl(this)); - myChat = new Chat(this, myConfig); lineEdit_ChatInput->installEventFilter(this); @@ -558,9 +535,6 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) //Nachrichten Thread-Save connect(this, SIGNAL(signalInitGui(int)), this, SLOT(initGui(int))); - -// connect(this, SIGNAL(signalShowClientDialog()), this, SLOT(showClientDialog())); - connect(this, SIGNAL(signalRefreshSet()), this, SLOT(refreshSet())); connect(this, SIGNAL(signalRefreshCash()), this, SLOT(refreshCash())); connect(this, SIGNAL(signalRefreshAction(int, int)), this, SLOT(refreshAction(int, int))); @@ -572,26 +546,19 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) connect(this, SIGNAL(signalRefreshButton()), this, SLOT(refreshButton())); connect(this, SIGNAL(signalRefreshGameLabels(int)), this, SLOT(refreshGameLabels(int))); connect(this, SIGNAL(signalSetPlayerAvatar(int, QString)), this, SLOT(setPlayerAvatar(int, QString))); -// connect(this, SIGNAL(signalSetPlayerAvatar(int, QString)), myGameLobbyDialog.get(), SLOT(refreshConnectedPlayerAvatars())); - connect(this, SIGNAL(signalGuiUpdateDone()), this, SLOT(guiUpdateDone())); - connect(this, SIGNAL(signalMeInAction()), this, SLOT(meInAction())); connect(this, SIGNAL(signalDisableMyButtons()), this, SLOT(disableMyButtons())); connect(this, SIGNAL(signalUpdateMyButtonsState()), this, SLOT(updateMyButtonsState())); connect(this, SIGNAL(signalStartTimeoutAnimation(int, int)), this, SLOT(startTimeoutAnimation(int, int))); connect(this, SIGNAL(signalStopTimeoutAnimation(int)), this, SLOT(stopTimeoutAnimation(int))); - connect(this, SIGNAL(signalDealBeRoCards(int)), this, SLOT(dealBeRoCards(int))); connect(this, SIGNAL(signalDealHoleCards()), this, SLOT(dealHoleCards())); connect(this, SIGNAL(signalDealFlopCards0()), this, SLOT(dealFlopCards0())); connect(this, SIGNAL(signalDealTurnCards0()), this, SLOT(dealTurnCards0())); connect(this, SIGNAL(signalDealRiverCards0()), this, SLOT(dealRiverCards0())); - connect(this, SIGNAL(signalNextPlayerAnimation()), this, SLOT(nextPlayerAnimation())); - connect(this, SIGNAL(signalBeRoAnimation2(int)), this, SLOT(beRoAnimation2(int))); - connect(this, SIGNAL(signalPreflopAnimation1()), this, SLOT(preflopAnimation1())); connect(this, SIGNAL(signalPreflopAnimation2()), this, SLOT(preflopAnimation2())); connect(this, SIGNAL(signalFlopAnimation1()), this, SLOT(flopAnimation1())); @@ -602,59 +569,9 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) connect(this, SIGNAL(signalRiverAnimation2()), this, SLOT(riverAnimation2())); connect(this, SIGNAL(signalPostRiverAnimation1()), this, SLOT(postRiverAnimation1())); connect(this, SIGNAL(signalPostRiverRunAnimation1()), this, SLOT(postRiverRunAnimation1())); - connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn())); - connect(this, SIGNAL(signalNextRoundCleanGui()), this, SLOT(nextRoundCleanGui())); -// connect(this, SIGNAL(signalNetClientConnect(int)), myConnectToServerDialog.get(), SLOT(refresh(int))); -// connect(this, SIGNAL(signalNetClientGameInfo(int)), myStartNetworkGameDialog.get(), SLOT(refresh(int))); -// connect(this, SIGNAL(signalNetClientGameInfo(int)), myGameLobbyDialog.get(), SLOT(refresh(int))); - -// connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myStartNetworkGameDialog.get(), SLOT(joinedNetworkGame(unsigned, QString, int))); -// connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myStartNetworkGameDialog.get(), SLOT(addConnectedPlayer(unsigned, QString, int))); -// connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myStartNetworkGameDialog.get(), SLOT(updatePlayer(unsigned, QString))); -// connect(this, SIGNAL(signalNetClientPlayerLeft(unsigned, QString)), myStartNetworkGameDialog.get(), SLOT(removePlayer(unsigned, QString))); -// connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myStartNetworkGameDialog.get(), SLOT(newGameAdmin(unsigned, QString))); -// connect(this, SIGNAL(signalNetClientGameListNew(unsigned)), myStartNetworkGameDialog.get(), SLOT(gameCreated(unsigned))); - -// connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myGameLobbyDialog.get(), SLOT(joinedNetworkGame(unsigned, QString, int))); -// connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myGameLobbyDialog.get(), SLOT(addConnectedPlayer(unsigned, QString, int))); -// connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myGameLobbyDialog.get(), SLOT(updatePlayer(unsigned, QString))); -// connect(this, SIGNAL(signalNetClientPlayerLeft(unsigned, QString)), myGameLobbyDialog.get(), SLOT(removePlayer(unsigned, QString))); -// connect(this, SIGNAL(signalNetClientNewGameAdmin(unsigned, QString)), myGameLobbyDialog.get(), SLOT(newGameAdmin(unsigned, QString))); -// -// connect(this, SIGNAL(signalNetClientGameListNew(unsigned)), myGameLobbyDialog.get(), SLOT(addGame(unsigned))); -// connect(this, SIGNAL(signalNetClientGameListRemove(unsigned)), myGameLobbyDialog.get(), SLOT(removeGame(unsigned))); -// connect(this, SIGNAL(signalNetClientGameListUpdateMode(unsigned, int)), myGameLobbyDialog.get(), SLOT(updateGameMode(unsigned, int))); -// connect(this, SIGNAL(signalNetClientGameListUpdateAdmin(unsigned, unsigned)), myGameLobbyDialog.get(), SLOT(updateGameAdmin(unsigned, unsigned))); -// connect(this, SIGNAL(signalNetClientGameListPlayerJoined(unsigned, unsigned)), myGameLobbyDialog.get(), SLOT(gameAddPlayer(unsigned, unsigned))); -// connect(this, SIGNAL(signalNetClientGameListPlayerLeft(unsigned, unsigned)), myGameLobbyDialog.get(), SLOT(gameRemovePlayer(unsigned, unsigned))); -// connect(this, SIGNAL(signalNetClientRemovedFromGame(int)), myGameLobbyDialog.get(), SLOT(removedFromGame(int))); -// connect(this, SIGNAL(signalNetClientStatsUpdate(ServerStats)), myGameLobbyDialog.get(), SLOT(updateStats(ServerStats))); - connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned))); - - // Errors are handled globally, not within one dialog. - connect(this, SIGNAL(signalNetClientError(int, int)), this, SLOT(networkError(int, int))); - connect(this, SIGNAL(signalNetClientNotification(int)), this, SLOT(networkNotification(int))); - connect(this, SIGNAL(signalNetClientRemovedFromGame(int)), this, SLOT(networkNotification(int))); - connect(this, SIGNAL(signalNetServerError(int, int)), this, SLOT(networkError(int, int))); - connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr)), this, SLOT(networkStart(boost::shared_ptr))); - - //Chat Messages -// connect(this, SIGNAL(signalNetClientChatMsg(QString, QString)), myChat, SLOT(receiveMessage(QString, QString))); -// connect(this, SIGNAL(signalNetClientChatMsg(QString, QString)), myStartNetworkGameDialog.get(), SLOT(receiveChatMsg(QString, QString))); - -// connect(this, SIGNAL(signalIrcConnect(QString)), myGameLobbyDialog->getLobbyChat(), SLOT(connected(QString))); -// connect(this, SIGNAL(signalIrcSelfJoined(QString, QString)), myGameLobbyDialog->getLobbyChat(), SLOT(selfJoined(QString, QString))); -// connect(this, SIGNAL(signalIrcPlayerJoined(QString)), myGameLobbyDialog->getLobbyChat(), SLOT(playerJoined(QString))); -// connect(this, SIGNAL(signalIrcPlayerChanged(QString, QString)), myGameLobbyDialog->getLobbyChat(), SLOT(playerChanged(QString, QString))); -// connect(this, SIGNAL(signalIrcPlayerKicked(QString, QString, QString)), myGameLobbyDialog->getLobbyChat(), SLOT(playerKicked(QString, QString, QString))); -// connect(this, SIGNAL(signalIrcPlayerLeft(QString)), myGameLobbyDialog->getLobbyChat(), SLOT(playerLeft(QString))); -// connect(this, SIGNAL(signalIrcChatMessage(QString, QString)), myGameLobbyDialog->getLobbyChat(), SLOT(displayMessage(QString, QString))); -// connect(this, SIGNAL(signalIrcError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatError(int))); -// connect(this, SIGNAL(signalIrcServerError(int)), myGameLobbyDialog->getLobbyChat(), SLOT(chatServerError(int))); - } gameTableImpl::~gameTableImpl() { @@ -887,18 +804,6 @@ void gameTableImpl::refreshPlayerName() { } } -QStringList gameTableImpl::getPlayerNicksList() { - - QStringList list; - PlayerListConstIterator it_c; - - for (it_c=mySession->getCurrentGame()->getSeatsList()->begin(); it_c!=mySession->getCurrentGame()->getSeatsList()->end(); it_c++) { - list << QString::fromUtf8((*it_c)->getMyName().c_str()); - } - - return list; -} - void gameTableImpl::refreshPlayerAvatar() { QPixmap onePix = QPixmap::fromImage(QImage(myAppDataPath +"gfx/gui/misc/1px.png")); @@ -1499,7 +1404,7 @@ void gameTableImpl::provideMyActions(int mode) { if( currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD ) { pushButtonBetRaiseString = "Bet $"+QString::number(getMyBetAmount()); pushButtonCallCheckString = "Check"; - if( currentGame->getActivePlayerList()->size() > 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_SMALL_BLIND || ( currentGame->getActivePlayerList()->size() <= 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_BIG_BLIND)) { pushButtonFoldString = "Fold"; } + if( (currentGame->getActivePlayerList()->size() > 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_SMALL_BLIND ) || ( currentGame->getActivePlayerList()->size() <= 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_BIG_BLIND)) { pushButtonFoldString = "Fold"; } else { pushButtonFoldString = "Check / Fold"; } } else { @@ -2667,323 +2572,6 @@ void gameTableImpl::breakButtonClicked() { } } -void gameTableImpl::networkError(int errorID, int /*osErrorID*/) { - - hideTimeoutDialog(); - switch (errorID) { - case ERR_SOCK_SERVERADDR_NOT_SET: - {QMessageBox::warning(this, tr("Network Error"), - tr("Server address was not set."), - QMessageBox::Close); } - break; - case ERR_SOCK_INVALID_PORT: - { QMessageBox::warning(this, tr("Network Error"), - tr("An invalid port was set (ports 0-1023 are not allowed)."), - QMessageBox::Close); } - break; - case ERR_SOCK_CREATION_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not create a socket for TCP communication."), - QMessageBox::Close); } - break; - case ERR_SOCK_SET_ADDR_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not set the IP address."), - QMessageBox::Close); } - break; - case ERR_SOCK_SET_PORT_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not set the port for this type of address."), - QMessageBox::Close); } - break; - case ERR_SOCK_RESOLVE_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("The server name could not be resolved."), - QMessageBox::Close); } - break; - case ERR_SOCK_BIND_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Bind failed - please choose a different port."), - QMessageBox::Close); } - break; - case ERR_SOCK_LISTEN_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"listen\" failed."), - QMessageBox::Close); } - break; - case ERR_SOCK_ACCEPT_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Server execution was terminated."), - QMessageBox::Close); } - break; - case ERR_SOCK_CONNECT_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not connect to the server."), - QMessageBox::Close); } - break; - case ERR_SOCK_CONNECT_TIMEOUT: - { QMessageBox::warning(this, tr("Network Error"), - tr("Connection timed out.\nPlease check the server address.\n\nIf the server is behind a NAT-Router, make sure port forwarding has been set up on server side."), - QMessageBox::Close); } - break; - case ERR_SOCK_SELECT_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"select\" failed."), - QMessageBox::Close); } - break; - case ERR_SOCK_SEND_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: \"send\" failed."), - QMessageBox::Close); } - break; - case ERR_SOCK_RECV_FAILED: // Sometimes windows reports recv failed on close. - case ERR_SOCK_CONN_RESET: - { QMessageBox::warning(this, tr("Network Error"), - tr("Connection was closed by the server."), - QMessageBox::Close); } - break; - case ERR_SOCK_CONN_EXISTS: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal network error: Duplicate TCP connection."), - QMessageBox::Close); } - break; - case ERR_SOCK_INVALID_PACKET: - { QMessageBox::warning(this, tr("Network Error"), - tr("An invalid network packet was received.\nPlease make sure that all players use the same version of PokerTH."), - QMessageBox::Close); } - break; - case ERR_SOCK_INVALID_STATE: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal state error.\nPlease make sure that all players use the same version of PokerTH."), - QMessageBox::Close); } - break; - case ERR_SOCK_INVALID_SERVERLIST_URL: - case ERR_SOCK_DOWNLOAD_INVALID_URL: - { QMessageBox::warning(this, tr("Network Error"), - tr("Invalid server list URL.\nPlease correct the address in the settings."), - QMessageBox::Close); } - break; - case ERR_SOCK_OPEN_MD5_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not open the server list MD5 file.\nPlease make sure that the server list URL is correct."), - QMessageBox::Close); } - break; - case ERR_SOCK_INVALID_SERVERLIST_MD5: - { QMessageBox::warning(this, tr("Network Error"), - tr("Synchronization of the PokerTH internet server list has failed.\nPlease make sure that the server list URL is correct."), - QMessageBox::Close); } - break; - case ERR_SOCK_INVALID_SERVERLIST_XML: - { QMessageBox::warning(this, tr("Network Error"), - tr("The PokerTH internet server list contains invalid data.\nIf you use a custom server list, please make sure its format is correct."), - QMessageBox::Close); } - break; - case ERR_SOCK_UNZIP_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not unzip the PokerTH internet server list."), - QMessageBox::Close); } - break; - case ERR_SOCK_DOWNLOAD_INIT_FAILED: - case ERR_SOCK_DOWNLOAD_SELECT_FAILED: - case ERR_SOCK_DOWNLOAD_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not download the PokerTH internet server list.\nPlease make sure you are directly connected to the internet."), - QMessageBox::Close); } - break; - case ERR_SOCK_DOWNLOAD_OPEN_FAILED: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not open the target file when downloading the server list."), - QMessageBox::Close); } - break; - case ERR_NET_VERSION_NOT_SUPPORTED: - { QMessageBox msgBox(QMessageBox::Warning, tr("Network Error"), - tr("The PokerTH server does not support this version of the game.
Please go to http://www.pokerth.net and download the latest version."), - QMessageBox::Close, this); - msgBox.setTextFormat(Qt::RichText); - msgBox.exec(); - } - break; - case ERR_NET_SERVER_FULL: - { QMessageBox::warning(this, tr("Network Error"), - tr("Sorry, this server is already full."), - QMessageBox::Close); } - break; - case ERR_NET_INVALID_PASSWORD: - { QMessageBox::warning(this, tr("Network Error"), - tr("Invalid password when joining the game.\nPlease reenter the password and try again."), - QMessageBox::Close); } - break; - case ERR_NET_INVALID_PASSWORD_STR: - { QMessageBox::warning(this, tr("Network Error"), - tr("The password is too long. Please choose another one."), - QMessageBox::Close); } - break; - case ERR_NET_PLAYER_NAME_IN_USE: - { /*myChangeHumanPlayerNameDialog->label_Message->setText(tr("Your player name is already used by another player.\nPlease choose a different name.")); - myChangeHumanPlayerNameDialog->exec();*/ } - break; - case ERR_NET_INVALID_PLAYER_NAME: - { /*myChangeHumanPlayerNameDialog->label_Message->setText(tr("The player name is too short, too long or invalid. Please choose another one.")); - myChangeHumanPlayerNameDialog->exec();*/ } - break; - case ERR_NET_INVALID_GAME_NAME: - { QMessageBox::warning(this, tr("Network Error"), - tr("The game name is either too short or too long. Please choose another one."), - QMessageBox::Close); } - break; - case ERR_NET_UNKNOWN_GAME: - { QMessageBox::warning(this, tr("Network Error"), - tr("The game could not be found."), - QMessageBox::Close); } - break; - case ERR_NET_INVALID_CHAT_TEXT: - { QMessageBox::warning(this, tr("Network Error"), - tr("The chat text is invalid."), - QMessageBox::Close); } - break; - case ERR_NET_UNKNOWN_PLAYER_ID: - { QMessageBox::warning(this, tr("Network Error"), - tr("The server referred to an unknown player. Aborting."), - QMessageBox::Close); } - break; - case ERR_NET_NO_CURRENT_PLAYER: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal error: The current player could not be found."), - QMessageBox::Close); } - break; - case ERR_NET_PLAYER_NOT_ACTIVE: - { QMessageBox::warning(this, tr("Network Error"), - tr("Internal error: The current player is not active."), - QMessageBox::Close); } - break; - case ERR_NET_PLAYER_KICKED: - { mySession->terminateNetworkClient(); - QMessageBox::warning(this, tr("Network Error"), - tr("You were kicked from the server."), - QMessageBox::Close); } - break; - case ERR_NET_PLAYER_BANNED: - { mySession->terminateNetworkClient(); - QMessageBox::warning(this, tr("Network Error"), - tr("You were temporarily banned from the server."), - QMessageBox::Close); } - break; - case ERR_NET_SESSION_TIMED_OUT: - { mySession->terminateNetworkClient(); - QMessageBox::warning(this, tr("Network Error"), - tr("Your server connection timed out due to inactivity. You are very welcome to reconnect!"), - QMessageBox::Close); } - break; - case ERR_NET_INVALID_PLAYER_COUNT: - { QMessageBox::warning(this, tr("Network Error"), - tr("The client player count is invalid."), - QMessageBox::Close); } - break; - case ERR_NET_TOO_MANY_MANUAL_BLINDS: - { QMessageBox::warning(this, tr("Network Error"), - tr("Too many manual blinds were set. Please reconfigure the manual blinds."), - QMessageBox::Close); } - break; - case ERR_NET_INVALID_AVATAR_FILE: - case ERR_NET_WRONG_AVATAR_SIZE: - { QMessageBox::warning(this, tr("Network Error"), - tr("An invalid avatar file was configured. Please choose a different avatar."), - QMessageBox::Close); } - break; - case ERR_NET_AVATAR_TOO_LARGE: - { QMessageBox::warning(this, tr("Network Error"), - tr("The selected avatar file is too large. Please choose a different avatar."), - QMessageBox::Close); } - break; - case ERR_NET_AVATAR_UPLOAD_BLOCKED: - { QMessageBox::warning(this, tr("Network Error"), - tr("You cannot upload a new avatar file at this time. Please try again in a few seconds."), - QMessageBox::Close); } - break; - case ERR_NET_INVALID_REQUEST_ID: - { QMessageBox::warning(this, tr("Network Error"), - tr("An internal avatar error occured. Please report this to an admin in the lobby chat."), - QMessageBox::Close); } - break; - case ERR_NET_START_TIMEOUT: - { QMessageBox::warning(this, tr("Network Error"), - tr("Could not start game: Synchronization failed."), - QMessageBox::Close); } - break; - case ERR_NET_SERVER_MAINTENANCE: - { QMessageBox::warning(this, tr("Network Error"), - tr("The server is down for maintenance. Please try again later."), - QMessageBox::Close); } - break; - default: { QMessageBox::warning(this, tr("Network Error"), - tr("An internal error occured."), - QMessageBox::Close); } - } - // close dialogs -// myGameLobbyDialog->reject(); -// myConnectToServerDialog->reject(); -// myStartNetworkGameDialog->reject(); -} - -void gameTableImpl::networkNotification(int notificationId) -{ - hideTimeoutDialog(); - switch (notificationId) - { - case NTF_NET_REMOVED_KICKED: - { QMessageBox::warning(this, tr("Network Notification"), - tr("You were kicked from the game."), - QMessageBox::Close); } - break; - case NTF_NET_REMOVED_GAME_FULL: - case NTF_NET_JOIN_GAME_FULL: - { QMessageBox::warning(this, tr("Network Notification"), - tr("Sorry, this game is already full."), - QMessageBox::Close); } - break; - case NTF_NET_REMOVED_ALREADY_RUNNING: - case NTF_NET_JOIN_ALREADY_RUNNING: - { QMessageBox::warning(this, tr("Network Notification"), - tr("Unable to join - the server has already started the game."), - QMessageBox::Close); } - break; - case NTF_NET_REMOVED_TIMEOUT: - { QMessageBox::warning(this, tr("Network Notification"), - tr("Your admin state timed out due to inactivity. Feel free to create a new game!"), - QMessageBox::Close); } - break; - case NTF_NET_JOIN_INVALID_PASSWORD: - { QMessageBox::warning(this, tr("Network Notification"), - tr("Invalid password when joining the game.\nPlease reenter the password and try again."), - QMessageBox::Close); } - break; - case NTF_NET_NEW_RELEASE_AVAILABLE: - { QMessageBox msgBox(QMessageBox::Information, tr("Network Notification"), - tr("A new release of PokerTH is available.
Please go to http://www.pokerth.net and download the latest version."), - QMessageBox::Close, this); - msgBox.setTextFormat(Qt::RichText); - msgBox.exec(); - } - break; - case NTF_NET_OUTDATED_BETA: - { QMessageBox msgBox(QMessageBox::Information, tr("Network Notification"), - tr("This beta release of PokerTH is outdated.
Please go to http://www.pokerth.net and download the latest version."), - QMessageBox::Close, this); - msgBox.setTextFormat(Qt::RichText); - msgBox.exec(); - } - break; - } -} - -void gameTableImpl::networkStart(boost::shared_ptr game) -{ - mySession->startClientGame(game); - - //send playerNicksList to chat for nick-autocompletition - myChat->setPlayerNicksList(getPlayerNicksList()); -} - void gameTableImpl::keyPressEvent ( QKeyEvent * event ) { // cout << event->key() << endl; @@ -3447,19 +3035,3 @@ void gameTableImpl::leaveCurrentNetworkGame() { } } } - - -void gameTableImpl::showTimeoutDialog(int msgID, unsigned duration) { - - if(myTimeoutDialog->isHidden()) { - myTimeoutDialog->setMySession(mySession); - myTimeoutDialog->setMsgID((NetTimeoutReason)msgID); - myTimeoutDialog->setTimeoutDuration(duration); - myTimeoutDialog->show(); - myTimeoutDialog->raise(); - myTimeoutDialog->activateWindow(); - myTimeoutDialog->startTimeout(); - } -} - -void gameTableImpl::hideTimeoutDialog() { myTimeoutDialog->hide(); } diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h index 6eb8c88b..26d3c586 100755 --- a/src/gui/qt/gametable/gametableimpl.h +++ b/src/gui/qt/gametable/gametableimpl.h @@ -37,21 +37,11 @@ class Game; class GuiInterface; class BoardInterface; -// class HandInterface; class PlayerInterface; class MyCardsPixmapLabel; class MyAvatarLabel; -class newGameDialogImpl; + class settingsDialogImpl; -class selectAvatarDialogImpl; -class aboutPokerthImpl; -class joinNetworkGameDialogImpl; -class connectToServerDialogImpl; -class createNetworkGameDialogImpl; -class startNetworkGameDialogImpl; -class changeHumanPlayerNameDialogImpl; -class gameLobbyDialogImpl; -class timeoutMsgBoxImpl; class startWindowImpl; class QColor; @@ -74,7 +64,8 @@ public: void setLog(Log* l) { myLog = l; } SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; } - + Chat* getMyChat() const { return myChat; } + void setSpeeds(); signals: @@ -129,38 +120,6 @@ signals: void signalNextRoundCleanGui(); - void signalNetClientConnect(int actionID); - void signalNetClientGameInfo(int actionID); - void signalNetClientError(int errorID, int osErrorID); - void signalNetClientNotification(int notificationId); - void signalNetClientStatsUpdate(ServerStats stats); - void signalNetClientShowTimeoutDialog(int, unsigned); - void signalNetClientRemovedFromGame(int notificationId); - void signalNetServerError(int errorID, int osErrorID); - void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights); - void signalNetClientPlayerJoined(unsigned playerId, QString playerName, int rights); - void signalNetClientPlayerChanged(unsigned playerId, QString newPlayerName); - void signalNetClientPlayerLeft(unsigned playerId, QString playerName); - void signalNetClientNewGameAdmin(unsigned playerId, QString playerName); - void signalNetClientGameListNew(unsigned gameId); - void signalNetClientGameListRemove(unsigned gameId); - void signalNetClientGameListUpdateMode(unsigned gameId, int mode); - void signalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId); - void signalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId); - void signalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId); - void signalNetClientGameStart(boost::shared_ptr game); - void signalNetClientChatMsg(QString nickName, QString msg); - - void signalIrcConnect(QString server); - void signalIrcSelfJoined(QString nickName, QString channel); - void signalIrcPlayerJoined(QString nickName); - void signalIrcPlayerChanged(QString oldNick, QString newNick); - void signalIrcPlayerKicked(QString nickName, QString byWhom, QString reason); - void signalIrcPlayerLeft(QString nickName); - void signalIrcChatMessage(QString nickName, QString msg); - void signalIrcError(int errorCode); - void signalIrcServerError(int errorCode); - public slots: void initGui(int speed); @@ -174,7 +133,6 @@ public slots: void refreshGroupbox(int =-1, int =-1); void refreshAll(); void refreshPlayerName(); - QStringList getPlayerNicksList(); void refreshGameLabels(int); void refreshButton(); void refreshPlayerAvatar(); @@ -299,10 +257,6 @@ public slots: void tabSwitchAction(); void leaveCurrentNetworkGame(); - - void networkError(int, int); - void networkNotification(int); - void networkStart(boost::shared_ptr game); void localGameModification(); void networkGameModification(); @@ -322,11 +276,6 @@ public slots: void showMaximized (); void closeGameTable(); - void showTimeoutDialog(int msgID, unsigned duration); - void hideTimeoutDialog(); - - Chat* getMyChat() const { return myChat; } - private: @@ -391,16 +340,6 @@ private: QPixmap *flipside; // Dialogs -// boost::shared_ptr myNewGameDialog; -// boost::shared_ptr mySettingsDialog; -// boost::shared_ptr mySelectAvatarDialog; -// boost::shared_ptr myChangeHumanPlayerNameDialog; -// boost::shared_ptr myJoinNetworkGameDialog; -// boost::shared_ptr myConnectToServerDialog; -// boost::shared_ptr myStartNetworkGameDialog; -// boost::shared_ptr myCreateNetworkGameDialog; -// boost::shared_ptr myGameLobbyDialog; - boost::shared_ptr myTimeoutDialog; startWindowImpl *myStartWindow; //Sound diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 46d8f91e..da6a284f 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -119,14 +119,7 @@ void GuiWrapper::logPlayerWinGame(std::string playerName, int gameID) { myLog->s void GuiWrapper::flushLogAtGame(int gameID) { myLog->signalFlushLogAtGame(gameID); } void GuiWrapper::flushLogAtHand() { myLog->signalFlushLogAtHand(); } -void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr game) { myW->signalNetClientGameStart(game); } - - - - ////////// this is for startwindow //////////////////// - - void GuiWrapper::SignalNetClientConnect(int actionID) { myStartWindow->signalNetClientConnect(actionID); } void GuiWrapper::SignalNetClientGameInfo(int actionID) { myStartWindow->signalNetClientGameInfo(actionID); } void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myStartWindow->signalNetClientError(errorID, osErrorID); } @@ -161,13 +154,14 @@ void GuiWrapper::SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mod void GuiWrapper::SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId) {myStartWindow->signalNetClientGameListUpdateAdmin(gameId, adminPlayerId); } void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerJoined(gameId, playerId); } void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerLeft(gameId, playerId); } +void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr game) { myStartWindow->signalNetClientGameStart(game); } void GuiWrapper::SignalNetClientWaitDialog() { myStartWindow->signalShowClientDialog(); } void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myStartWindow->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); } void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { } -void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); } +void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myStartWindow->signalNetServerError(errorID, osErrorID); } void GuiWrapper::SignalIrcConnect(const string &server) { myStartWindow->signalIrcConnect(QString::fromUtf8(server.c_str())); } void GuiWrapper::SignalIrcSelfJoined(const string &nickName, const string &channel) { myStartWindow->signalIrcSelfJoined(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(channel.c_str())); } diff --git a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp index 08895a0b..7bbd065f 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp +++ b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp @@ -74,8 +74,6 @@ selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c) peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/14e3f39cc775608bcecf5597248b3558.png"; peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/0c04318e6fa54534935e3e6cfe12c4a1.png"; peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/6ecea83d9fac6b4cae97e2fccd09a5f6.png"; - peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/d90bd3fbbe3671ebac5f9f223d0c6d65.png"; - peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/93dec21823a314fb8ef2261b7aa75ae5.png"; peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/74672ebfa2ab02968386c4e441a08668.png"; peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/e54e67ebd5265cf549362a2cda5a999c.png"; peopleAvatarList << myAppDataPath +"gfx/avatars/default/people/da34195981d255656f39c05481de3b6a.png"; diff --git a/src/gui/qt/startwindow.ui b/src/gui/qt/startwindow.ui index eb44f9c8..6ed3a237 100644 --- a/src/gui/qt/startwindow.ui +++ b/src/gui/qt/startwindow.ui @@ -166,6 +166,9 @@ Quit + + Ctrl+Q + @@ -179,5 +182,22 @@ - + + + actionQuit + triggered() + startWindow + close() + + + -1 + -1 + + + 221 + 168 + + + + diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 357982b6..f211c568 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -19,6 +19,8 @@ ***************************************************************************/ #include "startwindowimpl.h" +#include "playerinterface.h" + #include #include #include @@ -84,7 +86,6 @@ startWindowImpl::startWindowImpl(ConfigFile *c) myTimeoutDialog = new timeoutMsgBoxImpl(this); - connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) ); connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) ); connect( actionInternet_Game, SIGNAL( triggered() ), this, SLOT( callGameLobbyDialog() ) ); @@ -129,6 +130,15 @@ startWindowImpl::startWindowImpl(ConfigFile *c) connect(this, SIGNAL(signalNetClientChatMsg(QString, QString)), myStartNetworkGameDialog, SLOT(receiveChatMsg(QString, QString))); connect(this, SIGNAL(signalNetClientChatMsg(QString, QString)), myGuiInterface->getMyW()->getMyChat(), SLOT(receiveMessage(QString, QString))); + connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned))); + + // Errors are handled globally, not within one dialog. + connect(this, SIGNAL(signalNetClientError(int, int)), this, SLOT(networkError(int, int))); + connect(this, SIGNAL(signalNetClientNotification(int)), this, SLOT(networkNotification(int))); + connect(this, SIGNAL(signalNetServerError(int, int)), this, SLOT(networkError(int, int))); + connect(this, SIGNAL(signalNetClientRemovedFromGame(int)), this, SLOT(networkNotification(int))); + connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr)), this, SLOT(networkStart(boost::shared_ptr))); + connect(this, SIGNAL(signalIrcConnect(QString)), myGameLobbyDialog->getLobbyChat(), SLOT(connected(QString))); connect(this, SIGNAL(signalIrcSelfJoined(QString, QString)), myGameLobbyDialog->getLobbyChat(), SLOT(selfJoined(QString, QString))); connect(this, SIGNAL(signalIrcPlayerJoined(QString)), myGameLobbyDialog->getLobbyChat(), SLOT(playerJoined(QString))); @@ -520,3 +530,348 @@ void startWindowImpl::callSettingsDialog() { myGuiInterface->getMyW()->applySettings(mySettingsDialog); } } + +void startWindowImpl::showTimeoutDialog(int msgID, unsigned duration) { + + if(myTimeoutDialog->isHidden()) { + myTimeoutDialog->setMySession(mySession); + myTimeoutDialog->setMsgID((NetTimeoutReason)msgID); + myTimeoutDialog->setTimeoutDuration(duration); + myTimeoutDialog->show(); + myTimeoutDialog->raise(); + myTimeoutDialog->activateWindow(); + myTimeoutDialog->startTimeout(); + } +} + +void startWindowImpl::hideTimeoutDialog() { myTimeoutDialog->hide(); } + +void startWindowImpl::networkError(int errorID, int /*osErrorID*/) { + + hideTimeoutDialog(); + switch (errorID) { + case ERR_SOCK_SERVERADDR_NOT_SET: + {QMessageBox::warning(this, tr("Network Error"), + tr("Server address was not set."), + QMessageBox::Close); } + break; + case ERR_SOCK_INVALID_PORT: + { QMessageBox::warning(this, tr("Network Error"), + tr("An invalid port was set (ports 0-1023 are not allowed)."), + QMessageBox::Close); } + break; + case ERR_SOCK_CREATION_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not create a socket for TCP communication."), + QMessageBox::Close); } + break; + case ERR_SOCK_SET_ADDR_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not set the IP address."), + QMessageBox::Close); } + break; + case ERR_SOCK_SET_PORT_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not set the port for this type of address."), + QMessageBox::Close); } + break; + case ERR_SOCK_RESOLVE_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("The server name could not be resolved."), + QMessageBox::Close); } + break; + case ERR_SOCK_BIND_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Bind failed - please choose a different port."), + QMessageBox::Close); } + break; + case ERR_SOCK_LISTEN_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: \"listen\" failed."), + QMessageBox::Close); } + break; + case ERR_SOCK_ACCEPT_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Server execution was terminated."), + QMessageBox::Close); } + break; + case ERR_SOCK_CONNECT_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not connect to the server."), + QMessageBox::Close); } + break; + case ERR_SOCK_CONNECT_TIMEOUT: + { QMessageBox::warning(this, tr("Network Error"), + tr("Connection timed out.\nPlease check the server address.\n\nIf the server is behind a NAT-Router, make sure port forwarding has been set up on server side."), + QMessageBox::Close); } + break; + case ERR_SOCK_SELECT_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: \"select\" failed."), + QMessageBox::Close); } + break; + case ERR_SOCK_SEND_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: \"send\" failed."), + QMessageBox::Close); } + break; + case ERR_SOCK_RECV_FAILED: // Sometimes windows reports recv failed on close. + case ERR_SOCK_CONN_RESET: + { QMessageBox::warning(this, tr("Network Error"), + tr("Connection was closed by the server."), + QMessageBox::Close); } + break; + case ERR_SOCK_CONN_EXISTS: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal network error: Duplicate TCP connection."), + QMessageBox::Close); } + break; + case ERR_SOCK_INVALID_PACKET: + { QMessageBox::warning(this, tr("Network Error"), + tr("An invalid network packet was received.\nPlease make sure that all players use the same version of PokerTH."), + QMessageBox::Close); } + break; + case ERR_SOCK_INVALID_STATE: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal state error.\nPlease make sure that all players use the same version of PokerTH."), + QMessageBox::Close); } + break; + case ERR_SOCK_INVALID_SERVERLIST_URL: + case ERR_SOCK_DOWNLOAD_INVALID_URL: + { QMessageBox::warning(this, tr("Network Error"), + tr("Invalid server list URL.\nPlease correct the address in the settings."), + QMessageBox::Close); } + break; + case ERR_SOCK_OPEN_MD5_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not open the server list MD5 file.\nPlease make sure that the server list URL is correct."), + QMessageBox::Close); } + break; + case ERR_SOCK_INVALID_SERVERLIST_MD5: + { QMessageBox::warning(this, tr("Network Error"), + tr("Synchronization of the PokerTH internet server list has failed.\nPlease make sure that the server list URL is correct."), + QMessageBox::Close); } + break; + case ERR_SOCK_INVALID_SERVERLIST_XML: + { QMessageBox::warning(this, tr("Network Error"), + tr("The PokerTH internet server list contains invalid data.\nIf you use a custom server list, please make sure its format is correct."), + QMessageBox::Close); } + break; + case ERR_SOCK_UNZIP_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not unzip the PokerTH internet server list."), + QMessageBox::Close); } + break; + case ERR_SOCK_DOWNLOAD_INIT_FAILED: + case ERR_SOCK_DOWNLOAD_SELECT_FAILED: + case ERR_SOCK_DOWNLOAD_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not download the PokerTH internet server list.\nPlease make sure you are directly connected to the internet."), + QMessageBox::Close); } + break; + case ERR_SOCK_DOWNLOAD_OPEN_FAILED: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not open the target file when downloading the server list."), + QMessageBox::Close); } + break; + case ERR_NET_VERSION_NOT_SUPPORTED: + { QMessageBox msgBox(QMessageBox::Warning, tr("Network Error"), + tr("The PokerTH server does not support this version of the game.
Please go to http://www.pokerth.net and download the latest version."), + QMessageBox::Close, this); + msgBox.setTextFormat(Qt::RichText); + msgBox.exec(); + } + break; + case ERR_NET_SERVER_FULL: + { QMessageBox::warning(this, tr("Network Error"), + tr("Sorry, this server is already full."), + QMessageBox::Close); } + break; + case ERR_NET_INVALID_PASSWORD: + { QMessageBox::warning(this, tr("Network Error"), + tr("Invalid password when joining the game.\nPlease reenter the password and try again."), + QMessageBox::Close); } + break; + case ERR_NET_INVALID_PASSWORD_STR: + { QMessageBox::warning(this, tr("Network Error"), + tr("The password is too long. Please choose another one."), + QMessageBox::Close); } + break; + case ERR_NET_PLAYER_NAME_IN_USE: + { /*myChangeHumanPlayerNameDialog->label_Message->setText(tr("Your player name is already used by another player.\nPlease choose a different name.")); + myChangeHumanPlayerNameDialog->exec();*/ } + break; + case ERR_NET_INVALID_PLAYER_NAME: + { /*myChangeHumanPlayerNameDialog->label_Message->setText(tr("The player name is too short, too long or invalid. Please choose another one.")); + myChangeHumanPlayerNameDialog->exec();*/ } + break; + case ERR_NET_INVALID_GAME_NAME: + { QMessageBox::warning(this, tr("Network Error"), + tr("The game name is either too short or too long. Please choose another one."), + QMessageBox::Close); } + break; + case ERR_NET_UNKNOWN_GAME: + { QMessageBox::warning(this, tr("Network Error"), + tr("The game could not be found."), + QMessageBox::Close); } + break; + case ERR_NET_INVALID_CHAT_TEXT: + { QMessageBox::warning(this, tr("Network Error"), + tr("The chat text is invalid."), + QMessageBox::Close); } + break; + case ERR_NET_UNKNOWN_PLAYER_ID: + { QMessageBox::warning(this, tr("Network Error"), + tr("The server referred to an unknown player. Aborting."), + QMessageBox::Close); } + break; + case ERR_NET_NO_CURRENT_PLAYER: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal error: The current player could not be found."), + QMessageBox::Close); } + break; + case ERR_NET_PLAYER_NOT_ACTIVE: + { QMessageBox::warning(this, tr("Network Error"), + tr("Internal error: The current player is not active."), + QMessageBox::Close); } + break; + case ERR_NET_PLAYER_KICKED: + { mySession->terminateNetworkClient(); + QMessageBox::warning(this, tr("Network Error"), + tr("You were kicked from the server."), + QMessageBox::Close); } + break; + case ERR_NET_PLAYER_BANNED: + { mySession->terminateNetworkClient(); + QMessageBox::warning(this, tr("Network Error"), + tr("You were temporarily banned from the server."), + QMessageBox::Close); } + break; + case ERR_NET_SESSION_TIMED_OUT: + { mySession->terminateNetworkClient(); + QMessageBox::warning(this, tr("Network Error"), + tr("Your server connection timed out due to inactivity. You are very welcome to reconnect!"), + QMessageBox::Close); } + break; + case ERR_NET_INVALID_PLAYER_COUNT: + { QMessageBox::warning(this, tr("Network Error"), + tr("The client player count is invalid."), + QMessageBox::Close); } + break; + case ERR_NET_TOO_MANY_MANUAL_BLINDS: + { QMessageBox::warning(this, tr("Network Error"), + tr("Too many manual blinds were set. Please reconfigure the manual blinds."), + QMessageBox::Close); } + break; + case ERR_NET_INVALID_AVATAR_FILE: + case ERR_NET_WRONG_AVATAR_SIZE: + { QMessageBox::warning(this, tr("Network Error"), + tr("An invalid avatar file was configured. Please choose a different avatar."), + QMessageBox::Close); } + break; + case ERR_NET_AVATAR_TOO_LARGE: + { QMessageBox::warning(this, tr("Network Error"), + tr("The selected avatar file is too large. Please choose a different avatar."), + QMessageBox::Close); } + break; + case ERR_NET_AVATAR_UPLOAD_BLOCKED: + { QMessageBox::warning(this, tr("Network Error"), + tr("You cannot upload a new avatar file at this time. Please try again in a few seconds."), + QMessageBox::Close); } + break; + case ERR_NET_INVALID_REQUEST_ID: + { QMessageBox::warning(this, tr("Network Error"), + tr("An internal avatar error occured. Please report this to an admin in the lobby chat."), + QMessageBox::Close); } + break; + case ERR_NET_START_TIMEOUT: + { QMessageBox::warning(this, tr("Network Error"), + tr("Could not start game: Synchronization failed."), + QMessageBox::Close); } + break; + case ERR_NET_SERVER_MAINTENANCE: + { QMessageBox::warning(this, tr("Network Error"), + tr("The server is down for maintenance. Please try again later."), + QMessageBox::Close); } + break; + default: { QMessageBox::warning(this, tr("Network Error"), + tr("An internal error occured."), + QMessageBox::Close); } + } + // close dialogs + myGameLobbyDialog->reject(); + myConnectToServerDialog->reject(); + myStartNetworkGameDialog->reject(); +} + +void startWindowImpl::networkNotification(int notificationId) +{ + hideTimeoutDialog(); + switch (notificationId) + { + case NTF_NET_REMOVED_KICKED: + { QMessageBox::warning(this, tr("Network Notification"), + tr("You were kicked from the game."), + QMessageBox::Close); } + break; + case NTF_NET_REMOVED_GAME_FULL: + case NTF_NET_JOIN_GAME_FULL: + { QMessageBox::warning(this, tr("Network Notification"), + tr("Sorry, this game is already full."), + QMessageBox::Close); } + break; + case NTF_NET_REMOVED_ALREADY_RUNNING: + case NTF_NET_JOIN_ALREADY_RUNNING: + { QMessageBox::warning(this, tr("Network Notification"), + tr("Unable to join - the server has already started the game."), + QMessageBox::Close); } + break; + case NTF_NET_REMOVED_TIMEOUT: + { QMessageBox::warning(this, tr("Network Notification"), + tr("Your admin state timed out due to inactivity. Feel free to create a new game!"), + QMessageBox::Close); } + break; + case NTF_NET_JOIN_INVALID_PASSWORD: + { QMessageBox::warning(this, tr("Network Notification"), + tr("Invalid password when joining the game.\nPlease reenter the password and try again."), + QMessageBox::Close); } + break; + case NTF_NET_NEW_RELEASE_AVAILABLE: + { QMessageBox msgBox(QMessageBox::Information, tr("Network Notification"), + tr("A new release of PokerTH is available.
Please go to http://www.pokerth.net and download the latest version."), + QMessageBox::Close, this); + msgBox.setTextFormat(Qt::RichText); + msgBox.exec(); + } + break; + case NTF_NET_OUTDATED_BETA: + { QMessageBox msgBox(QMessageBox::Information, tr("Network Notification"), + tr("This beta release of PokerTH is outdated.
Please go to http://www.pokerth.net and download the latest version."), + QMessageBox::Close, this); + msgBox.setTextFormat(Qt::RichText); + msgBox.exec(); + } + break; + } +} + +void startWindowImpl::networkStart(boost::shared_ptr game) +{ + mySession->startClientGame(game); + + //send playerNicksList to chat for nick-autocompletition + myGuiInterface->getMyW()->getMyChat()->setPlayerNicksList(getPlayerNicksList()); +} + + +QStringList startWindowImpl::getPlayerNicksList() { + + QStringList list; + PlayerListConstIterator it_c; + + for (it_c=mySession->getCurrentGame()->getSeatsList()->begin(); it_c!=mySession->getCurrentGame()->getSeatsList()->end(); it_c++) { + list << QString::fromUtf8((*it_c)->getMyName().c_str()); + } + + return list; +} \ No newline at end of file diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index 4b72edd4..47361789 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -103,6 +103,15 @@ public slots: void startNewLocalGame(newGameDialogImpl* =0); + void showTimeoutDialog(int msgID, unsigned duration); + void hideTimeoutDialog(); + + void networkError(int, int); + void networkNotification(int); + + void networkStart(boost::shared_ptr game); + QStringList getPlayerNicksList(); + private: ConfigFile *myConfig;