2007-05-13 17:50:48 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2007 by Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* 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 *
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
#ifndef SERVERGUIWRAPPER_H
|
|
|
|
|
#define SERVERGUIWRAPPER_H
|
|
|
|
|
|
|
|
|
|
#include <guiinterface.h>
|
|
|
|
|
|
|
|
|
|
class ConfigFile;
|
2007-05-14 21:18:24 +00:00
|
|
|
class Session;
|
2007-05-13 17:50:48 +00:00
|
|
|
|
|
|
|
|
class ServerGuiWrapper : public GuiInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-09-26 11:48:33 +00:00
|
|
|
ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb, IrcCallback *irccb);
|
2007-05-13 17:50:48 +00:00
|
|
|
~ServerGuiWrapper();
|
|
|
|
|
|
|
|
|
|
void initGui(int speed);
|
|
|
|
|
|
|
|
|
|
Session &getSession();
|
|
|
|
|
void setSession(boost::shared_ptr<Session> session);
|
|
|
|
|
|
|
|
|
|
void refreshSet() const;
|
|
|
|
|
void refreshCash() const;
|
|
|
|
|
void refreshAction(int =-1, int =-1) const;
|
|
|
|
|
void refreshChangePlayer() const;
|
|
|
|
|
void refreshPot() const;
|
|
|
|
|
void refreshGroupbox(int =-1, int =-1) const;
|
|
|
|
|
void refreshAll() const;
|
|
|
|
|
void refreshPlayerName() const;
|
2007-05-26 17:06:03 +00:00
|
|
|
void refreshButton() const;
|
2007-06-07 14:06:22 +00:00
|
|
|
void refreshGameLabels(GameState state) const;
|
2007-05-29 18:37:49 +00:00
|
|
|
|
2007-11-01 00:28:32 +00:00
|
|
|
void setPlayerAvatar(int myUniqueID, const std::string &myAvatar) const;
|
|
|
|
|
|
2007-06-10 12:46:29 +00:00
|
|
|
void waitForGuiUpdateDone() const;
|
|
|
|
|
|
2007-08-07 00:05:29 +00:00
|
|
|
void dealBeRoCards(int);
|
2007-05-14 12:40:42 +00:00
|
|
|
void dealHoleCards();
|
|
|
|
|
void dealFlopCards();
|
|
|
|
|
void dealTurnCard();
|
|
|
|
|
void dealRiverCard();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void nextPlayerAnimation();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-08-07 13:07:39 +00:00
|
|
|
void beRoAnimation2(int);
|
|
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void preflopAnimation1();
|
|
|
|
|
void preflopAnimation2();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void flopAnimation1();
|
|
|
|
|
void flopAnimation2();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void turnAnimation1();
|
|
|
|
|
void turnAnimation2();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void riverAnimation1();
|
|
|
|
|
void riverAnimation2();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void postRiverAnimation1();
|
|
|
|
|
void postRiverRunAnimation1();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void flipHolecardsAllIn();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void nextRoundCleanGui();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-05-14 12:40:42 +00:00
|
|
|
void meInAction();
|
2007-10-19 20:43:53 +00:00
|
|
|
void updateMyButtonsState();
|
2007-06-08 22:14:05 +00:00
|
|
|
void disableMyButtons();
|
|
|
|
|
void startTimeoutAnimation(int playerId, int timeoutSec);
|
|
|
|
|
void stopTimeoutAnimation(int playerId);
|
2007-05-13 17:50:48 +00:00
|
|
|
|
|
|
|
|
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
|
|
|
|
void logNewGameHandMsg(int gameID, int handID) ;
|
2007-10-17 14:46:20 +00:00
|
|
|
void logPlayerWinsMsg(std::string playerName, int pot, bool main);
|
|
|
|
|
void logPlayerSitsOut(std::string playerName);
|
2007-10-03 22:42:24 +00:00
|
|
|
void logNewBlindsSetsMsg(int sbSet, int bbSet, std::string sbName, std::string bbName);
|
2007-05-26 19:28:34 +00:00
|
|
|
void logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1) ;
|
|
|
|
|
void logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt = -1, std::string showHas = "shows") ;
|
2007-06-11 20:35:12 +00:00
|
|
|
void logPlayerWinGame(std::string playerName, int gameID);
|
2007-10-03 22:42:24 +00:00
|
|
|
void flushLogAtGame(int gameID);
|
|
|
|
|
void flushLogAtHand();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
|
|
|
|
void SignalNetClientConnect(int actionID);
|
|
|
|
|
void SignalNetClientGameInfo(int actionID);
|
|
|
|
|
void SignalNetClientError(int errorID, int osErrorID);
|
2007-09-06 19:09:05 +00:00
|
|
|
void SignalNetClientNotification(int notificationId);
|
2007-10-20 22:22:11 +00:00
|
|
|
void SignalNetClientStatsUpdate(const ServerStats &stats);
|
2007-09-06 19:09:05 +00:00
|
|
|
void SignalNetClientRemovedFromGame(int notificationId);
|
2007-09-02 16:36:52 +00:00
|
|
|
void SignalNetClientSelfJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
|
|
|
|
void SignalNetClientPlayerJoined(unsigned playerId, const std::string &playerName, PlayerRights rights);
|
|
|
|
|
void SignalNetClientPlayerChanged(unsigned playerId, const std::string &newPlayerName);
|
|
|
|
|
void SignalNetClientPlayerLeft(unsigned playerId, const std::string &playerName);
|
2007-10-03 13:36:47 +00:00
|
|
|
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
|
2007-05-25 16:03:12 +00:00
|
|
|
void SignalNetClientChatMsg(const std::string &playerName, const std::string &msg);
|
2007-06-10 23:28:25 +00:00
|
|
|
void SignalNetClientWaitDialog();
|
2007-05-13 17:50:48 +00:00
|
|
|
|
2007-09-04 12:44:11 +00:00
|
|
|
void SignalNetClientGameListNew(unsigned gameId);
|
|
|
|
|
void SignalNetClientGameListRemove(unsigned gameId);
|
2007-09-29 20:20:01 +00:00
|
|
|
void SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mode);
|
2007-10-12 14:32:25 +00:00
|
|
|
void SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId);
|
2007-09-02 16:36:52 +00:00
|
|
|
void SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId);
|
|
|
|
|
void SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId);
|
2007-05-20 00:16:29 +00:00
|
|
|
void SignalNetClientGameStart(boost::shared_ptr<Game> game);
|
2007-05-13 17:50:48 +00:00
|
|
|
|
|
|
|
|
void SignalNetServerSuccess(int actionID);
|
|
|
|
|
void SignalNetServerError(int errorID, int osErrorID);
|
|
|
|
|
|
2007-09-27 20:59:00 +00:00
|
|
|
void SignalIrcConnect(const std::string &server);
|
|
|
|
|
void SignalIrcSelfJoined(const std::string &nickName, const std::string &channel);
|
|
|
|
|
void SignalIrcPlayerJoined(const std::string &nickName);
|
2007-09-30 16:19:44 +00:00
|
|
|
void SignalIrcPlayerChanged(const std::string &oldNick, const std::string &newNick);
|
|
|
|
|
void SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason);
|
2007-09-27 20:59:00 +00:00
|
|
|
void SignalIrcPlayerLeft(const std::string &nickName);
|
2007-09-26 11:48:33 +00:00
|
|
|
void SignalIrcChatMsg(const std::string &nickName, const std::string &msg);
|
2007-09-30 16:19:44 +00:00
|
|
|
void SignalIrcError(int errorCode);
|
|
|
|
|
void SignalIrcServerError(int errorCode);
|
2007-09-26 11:48:33 +00:00
|
|
|
|
2007-05-13 17:50:48 +00:00
|
|
|
private:
|
|
|
|
|
|
2007-05-14 21:18:24 +00:00
|
|
|
boost::shared_ptr<Session> mySession;
|
|
|
|
|
ConfigFile *myConfig;
|
|
|
|
|
|
2007-05-13 17:50:48 +00:00
|
|
|
ClientCallback *myClientcb;
|
|
|
|
|
ServerCallback *myServercb;
|
2007-09-26 11:48:33 +00:00
|
|
|
IrcCallback *myIrccb;
|
2007-05-13 17:50:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|