Added notification if a new release or beta release of PokerTH is available.
Removed last traces of deprecated blind values.
This commit is contained in:
@@ -72,13 +72,18 @@ Server Reply: Init ACK
|
|||||||
0 1 2 3
|
0 1 2 3
|
||||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Message Type = 2 | Message Length = 12 |
|
| Message Type = 2 | Message Length = 16 |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| Latest Game Version | Latest Beta Revision |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Your Session ID |
|
| Your Session ID |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Your Player ID |
|
| Your Player ID |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
Latest Game Version:
|
||||||
|
Major Version << 8 | Minor Version (network byte order).
|
||||||
|
Latest Beta Revision:
|
||||||
|
0 for stable releases, else contains beta release svn revision.
|
||||||
Session ID:
|
Session ID:
|
||||||
Unique Session ID which is not known by other players
|
Unique Session ID which is not known by other players
|
||||||
Player ID:
|
Player ID:
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
: myFactory(factory), myGui(gui), actualHand(0), actualBoard(0),
|
: myFactory(factory), myGui(gui), actualHand(0), actualBoard(0),
|
||||||
startQuantityPlayers(startData.numberOfPlayers),
|
startQuantityPlayers(startData.numberOfPlayers),
|
||||||
startCash(gameData.startMoney), startSmallBlind(gameData.firstSmallBlind),
|
startCash(gameData.startMoney), startSmallBlind(gameData.firstSmallBlind),
|
||||||
startHandsBeforeRaiseSmallBlind(gameData.handsBeforeRaise),
|
|
||||||
myGameID(gameId), actualSmallBlind(gameData.firstSmallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
|
myGameID(gameId), actualSmallBlind(gameData.firstSmallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ private:
|
|||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
int startCash;
|
int startCash;
|
||||||
int startSmallBlind;
|
int startSmallBlind;
|
||||||
int startHandsBeforeRaiseSmallBlind;
|
|
||||||
int myGameID;
|
int myGameID;
|
||||||
int guiPlayerNum;
|
int guiPlayerNum;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,12 @@
|
|||||||
|
|
||||||
#define DEBUG_MODE 0
|
#define DEBUG_MODE 0
|
||||||
|
|
||||||
|
#define POKERTH_VERSION_MAJOR 0
|
||||||
|
#define POKERTH_VERSION_MINOR 6
|
||||||
|
#define POKERTH_VERSION ((POKERTH_VERSION_MAJOR << 8) | POKERTH_VERSION_MINOR)
|
||||||
|
|
||||||
|
#define POKERTH_BETA_REVISION 0
|
||||||
|
|
||||||
enum GameState {
|
enum GameState {
|
||||||
GAME_STATE_PREFLOP = 0,
|
GAME_STATE_PREFLOP = 0,
|
||||||
GAME_STATE_FLOP,
|
GAME_STATE_FLOP,
|
||||||
|
|||||||
+1
-3
@@ -52,10 +52,9 @@ enum AfterManualBlindsMode
|
|||||||
// For the sake of simplicity, this is a struct.
|
// For the sake of simplicity, this is a struct.
|
||||||
struct GameData
|
struct GameData
|
||||||
{
|
{
|
||||||
GameData() : maxNumberOfPlayers(0), startMoney(0), smallBlind(0), firstSmallBlind(0), raiseIntervalMode(RAISE_ON_HANDNUMBER), raiseSmallBlindEveryHandsValue(8), raiseSmallBlindEveryMinutesValue(0), raiseMode(DOUBLE_BLINDS), afterManualBlindsMode(AFTERMB_DOUBLE_BLINDS), afterMBAlwaysRaiseValue(0), handsBeforeRaise(1), guiSpeed(4), playerActionTimeoutSec(20) {}
|
GameData() : maxNumberOfPlayers(0), startMoney(0), firstSmallBlind(0), raiseIntervalMode(RAISE_ON_HANDNUMBER), raiseSmallBlindEveryHandsValue(8), raiseSmallBlindEveryMinutesValue(1), raiseMode(DOUBLE_BLINDS), afterManualBlindsMode(AFTERMB_DOUBLE_BLINDS), afterMBAlwaysRaiseValue(0), guiSpeed(4), playerActionTimeoutSec(20) {}
|
||||||
int maxNumberOfPlayers;
|
int maxNumberOfPlayers;
|
||||||
int startMoney;
|
int startMoney;
|
||||||
int smallBlind; // deprecated
|
|
||||||
int firstSmallBlind;
|
int firstSmallBlind;
|
||||||
RaiseIntervalMode raiseIntervalMode;
|
RaiseIntervalMode raiseIntervalMode;
|
||||||
int raiseSmallBlindEveryHandsValue;
|
int raiseSmallBlindEveryHandsValue;
|
||||||
@@ -64,7 +63,6 @@ struct GameData
|
|||||||
std::list<int> manualBlindsList;
|
std::list<int> manualBlindsList;
|
||||||
AfterManualBlindsMode afterManualBlindsMode;
|
AfterManualBlindsMode afterManualBlindsMode;
|
||||||
int afterMBAlwaysRaiseValue;
|
int afterMBAlwaysRaiseValue;
|
||||||
int handsBeforeRaise; // deprecated
|
|
||||||
int guiSpeed;
|
int guiSpeed;
|
||||||
int playerActionTimeoutSec;
|
int playerActionTimeoutSec;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ void gameLobbyDialogImpl::gameSelected(QTreeWidgetItem* item, QTreeWidgetItem*)
|
|||||||
GameInfo info(mySession->getClientGameInfo(item->data(0, Qt::UserRole).toUInt()));
|
GameInfo info(mySession->getClientGameInfo(item->data(0, Qt::UserRole).toUInt()));
|
||||||
|
|
||||||
hideShowGameDescription(TRUE);
|
hideShowGameDescription(TRUE);
|
||||||
label_SmallBlind->setText(QString::number(info.data.smallBlind));
|
label_SmallBlind->setText(QString::number(info.data.firstSmallBlind));
|
||||||
label_StartCash->setText(QString::number(info.data.startMoney));
|
label_StartCash->setText(QString::number(info.data.startMoney));
|
||||||
label_MaximumNumberOfPlayers->setText(QString::number(info.data.maxNumberOfPlayers));
|
label_MaximumNumberOfPlayers->setText(QString::number(info.data.maxNumberOfPlayers));
|
||||||
|
|
||||||
|
|||||||
@@ -3583,6 +3583,18 @@ void mainWindowImpl::networkNotification(int notificationId)
|
|||||||
tr("Invalid password when joining the game.\nPlease reenter the password and try again."),
|
tr("Invalid password when joining the game.\nPlease reenter the password and try again."),
|
||||||
QMessageBox::Close); }
|
QMessageBox::Close); }
|
||||||
break;
|
break;
|
||||||
|
case NTF_NET_NEW_RELEASE_AVAILABLE:
|
||||||
|
// TODO use dialog with link to pokerth.net
|
||||||
|
{ QMessageBox::information(this, 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); }
|
||||||
|
break;
|
||||||
|
case NTF_NET_OUTDATED_BETA:
|
||||||
|
// TODO use dialog with link to pokerth.net
|
||||||
|
{ QMessageBox::information(this, 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); }
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3781,7 +3793,7 @@ void mainWindowImpl::mouseOverFlipCards(bool front) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainWindowImpl::closeEvent(QCloseEvent */*event*/) { quitPokerTH(); }
|
void mainWindowImpl::closeEvent(QCloseEvent * /*event*/) { quitPokerTH(); }
|
||||||
|
|
||||||
void mainWindowImpl::quitPokerTH() {
|
void mainWindowImpl::quitPokerTH() {
|
||||||
|
|
||||||
|
|||||||
@@ -554,6 +554,12 @@ ClientStateWaitSession::InternalProcess(ClientThread &client, boost::shared_ptr<
|
|||||||
// Everything is fine - we are in the lobby.
|
// Everything is fine - we are in the lobby.
|
||||||
NetPacketInitAck::Data initAckData;
|
NetPacketInitAck::Data initAckData;
|
||||||
packet->ToNetPacketInitAck()->GetData(initAckData);
|
packet->ToNetPacketInitAck()->GetData(initAckData);
|
||||||
|
// Check current game version.
|
||||||
|
if (initAckData.latestGameVersion != POKERTH_VERSION)
|
||||||
|
client.GetCallback().SignalNetClientNotification(NTF_NET_NEW_RELEASE_AVAILABLE);
|
||||||
|
else if (POKERTH_BETA_REVISION && initAckData.latestBetaRevision != POKERTH_BETA_REVISION)
|
||||||
|
client.GetCallback().SignalNetClientNotification(NTF_NET_OUTDATED_BETA);
|
||||||
|
|
||||||
client.SetGuiPlayerId(initAckData.playerId);
|
client.SetGuiPlayerId(initAckData.playerId);
|
||||||
|
|
||||||
client.SetState(ClientStateWaitJoin::Instance());
|
client.SetState(ClientStateWaitJoin::Instance());
|
||||||
|
|||||||
@@ -138,6 +138,8 @@ struct GCC_PACKED NetPacketInitData
|
|||||||
struct GCC_PACKED NetPacketInitAckData
|
struct GCC_PACKED NetPacketInitAckData
|
||||||
{
|
{
|
||||||
NetPacketHeader head;
|
NetPacketHeader head;
|
||||||
|
u_int16_t latestGameVersion;
|
||||||
|
u_int16_t latestBetaRevision;
|
||||||
u_int32_t sessionId;
|
u_int32_t sessionId;
|
||||||
u_int32_t playerId;
|
u_int32_t playerId;
|
||||||
};
|
};
|
||||||
@@ -1278,6 +1280,8 @@ NetPacketInitAck::SetData(const NetPacketInitAck::Data &inData)
|
|||||||
{
|
{
|
||||||
NetPacketInitAckData *tmpData = (NetPacketInitAckData *)GetRawData();
|
NetPacketInitAckData *tmpData = (NetPacketInitAckData *)GetRawData();
|
||||||
|
|
||||||
|
tmpData->latestGameVersion = htons(inData.latestGameVersion);
|
||||||
|
tmpData->latestBetaRevision = htons(inData.latestBetaRevision);
|
||||||
tmpData->sessionId = htonl(inData.sessionId);
|
tmpData->sessionId = htonl(inData.sessionId);
|
||||||
tmpData->playerId = htonl(inData.playerId);
|
tmpData->playerId = htonl(inData.playerId);
|
||||||
|
|
||||||
@@ -1290,6 +1294,8 @@ NetPacketInitAck::GetData(NetPacketInitAck::Data &outData) const
|
|||||||
{
|
{
|
||||||
NetPacketInitAckData *tmpData = (NetPacketInitAckData *)GetRawData();
|
NetPacketInitAckData *tmpData = (NetPacketInitAckData *)GetRawData();
|
||||||
|
|
||||||
|
outData.latestGameVersion = ntohs(tmpData->latestGameVersion);
|
||||||
|
outData.latestBetaRevision = ntohs(tmpData->latestBetaRevision);
|
||||||
outData.sessionId = ntohl(tmpData->sessionId);
|
outData.sessionId = ntohl(tmpData->sessionId);
|
||||||
outData.playerId = ntohl(tmpData->playerId);
|
outData.playerId = ntohl(tmpData->playerId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -606,6 +606,8 @@ ServerLobbyThread::EstablishSession(SessionWrapper session)
|
|||||||
// Send ACK to client.
|
// Send ACK to client.
|
||||||
boost::shared_ptr<NetPacket> initAck(new NetPacketInitAck);
|
boost::shared_ptr<NetPacket> initAck(new NetPacketInitAck);
|
||||||
NetPacketInitAck::Data initAckData;
|
NetPacketInitAck::Data initAckData;
|
||||||
|
initAckData.latestGameVersion = POKERTH_VERSION;
|
||||||
|
initAckData.latestBetaRevision = POKERTH_BETA_REVISION;
|
||||||
initAckData.sessionId = session.sessionData->GetId(); // TODO: currently unused.
|
initAckData.sessionId = session.sessionData->GetId(); // TODO: currently unused.
|
||||||
initAckData.playerId = session.playerData->GetUniqueId();
|
initAckData.playerId = session.playerData->GetUniqueId();
|
||||||
static_cast<NetPacketInitAck *>(initAck.get())->SetData(initAckData);
|
static_cast<NetPacketInitAck *>(initAck.get())->SetData(initAckData);
|
||||||
|
|||||||
@@ -200,6 +200,8 @@ class NetPacketInitAck : public NetPacket
|
|||||||
public:
|
public:
|
||||||
struct Data
|
struct Data
|
||||||
{
|
{
|
||||||
|
u_int16_t latestGameVersion;
|
||||||
|
u_int16_t latestBetaRevision;
|
||||||
u_int32_t sessionId;
|
u_int32_t sessionId;
|
||||||
u_int32_t playerId;
|
u_int32_t playerId;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -87,6 +87,10 @@
|
|||||||
#define NTF_NET_JOIN_ALREADY_RUNNING 207
|
#define NTF_NET_JOIN_ALREADY_RUNNING 207
|
||||||
#define NTF_NET_JOIN_INVALID_PASSWORD 208
|
#define NTF_NET_JOIN_INVALID_PASSWORD 208
|
||||||
|
|
||||||
|
// Notifications - version
|
||||||
|
#define NTF_NET_NEW_RELEASE_AVAILABLE 209
|
||||||
|
#define NTF_NET_OUTDATED_BETA 210
|
||||||
|
|
||||||
// This is an internal message which is not reported.
|
// This is an internal message which is not reported.
|
||||||
#define MSG_SOCK_INTERNAL_PENDING 0
|
#define MSG_SOCK_INTERNAL_PENDING 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user