Fixed some compiler warnings. Added error if game is running.
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
//
|
//
|
||||||
#include "clientbero.h"
|
#include "clientbero.h"
|
||||||
|
|
||||||
ClientBeRo::ClientBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
|
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, int /*qP*/, int dP, int sB, GameState gS)
|
||||||
: BeRoInterface(), myHand(hi), highestCardsValue(0), myBeRoID(gS), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRound(1), playersTurn(dP), minimumRaise(0)
|
: BeRoInterface(), myHand(hi), highestCardsValue(0), myBeRoID(gS), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRound(1), playersTurn(dP), minimumRaise(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ ClientPlayer::getMyLastRelativeSet() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientPlayer::setMyAction(int theValue, bool blind)
|
ClientPlayer::setMyAction(int theValue, bool /*blind*/)
|
||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
myAction = theValue;
|
myAction = theValue;
|
||||||
@@ -421,20 +421,20 @@ ClientPlayer::riverEngine()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientPlayer::evaluation(int bet, int raise)
|
ClientPlayer::evaluation(int /*bet*/, int /*raise*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientPlayer::preflopCardsValue(int* cards)
|
ClientPlayer::preflopCardsValue(int* /*cards*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientPlayer::flopCardsValue(int* cards)
|
ClientPlayer::flopCardsValue(int* /*cards*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -446,7 +446,7 @@ ClientPlayer::readFile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientPlayer::turnCardsValue(int* cards)
|
ClientPlayer::turnCardsValue(int* /*cards*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,9 +121,9 @@ void joinNetworkGameDialogImpl::fillServerProfileList() {
|
|||||||
TiXmlElement* profile = docHandle.FirstChild( "PokerTH" ).FirstChild( "ServerProfiles" ).FirstChild().ToElement();
|
TiXmlElement* profile = docHandle.FirstChild( "PokerTH" ).FirstChild( "ServerProfiles" ).FirstChild().ToElement();
|
||||||
if ( profile ) {
|
if ( profile ) {
|
||||||
|
|
||||||
for( profile; profile; profile = profile->NextSiblingElement()) {
|
for( ; profile; profile = profile->NextSiblingElement()) {
|
||||||
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget,0);
|
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget,0);
|
||||||
item->setData(0, 0, QString::fromUtf8(profile->Attribute("Name")));
|
item->setData(0, 0, QString::fromUtf8(profile->Attribute("Name")));
|
||||||
item->setData(1, 0, QString::fromUtf8(profile->Attribute("Address")));
|
item->setData(1, 0, QString::fromUtf8(profile->Attribute("Address")));
|
||||||
item->setData(2, 0, profile->Attribute("Port"));
|
item->setData(2, 0, profile->Attribute("Port"));
|
||||||
|
|||||||
@@ -570,7 +570,6 @@ int
|
|||||||
ClientStateWaitGame::InternalProcess(ClientThread &client, boost::shared_ptr<NetPacket> packet)
|
ClientStateWaitGame::InternalProcess(ClientThread &client, boost::shared_ptr<NetPacket> packet)
|
||||||
{
|
{
|
||||||
int retVal = MSG_SOCK_INTERNAL_PENDING;
|
int retVal = MSG_SOCK_INTERNAL_PENDING;
|
||||||
ClientContext &context = client.GetContext();
|
|
||||||
|
|
||||||
if (packet->ToNetPacketGameStart())
|
if (packet->ToNetPacketGameStart())
|
||||||
{
|
{
|
||||||
@@ -653,7 +652,6 @@ int
|
|||||||
ClientStateWaitHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetPacket> packet)
|
ClientStateWaitHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetPacket> packet)
|
||||||
{
|
{
|
||||||
int retVal = MSG_SOCK_INTERNAL_PENDING;
|
int retVal = MSG_SOCK_INTERNAL_PENDING;
|
||||||
ClientContext &context = client.GetContext();
|
|
||||||
|
|
||||||
if (packet->ToNetPacketHandStart())
|
if (packet->ToNetPacketHandStart())
|
||||||
{
|
{
|
||||||
@@ -717,7 +715,6 @@ int
|
|||||||
ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetPacket> packet)
|
ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetPacket> packet)
|
||||||
{
|
{
|
||||||
int retVal = MSG_SOCK_INTERNAL_PENDING;
|
int retVal = MSG_SOCK_INTERNAL_PENDING;
|
||||||
ClientContext &context = client.GetContext();
|
|
||||||
|
|
||||||
if (packet.get())
|
if (packet.get())
|
||||||
{
|
{
|
||||||
@@ -1095,7 +1092,7 @@ ClientStateFinal::~ClientStateFinal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ClientStateFinal::Process(ClientThread &client)
|
ClientStateFinal::Process(ClientThread &/*client*/)
|
||||||
{
|
{
|
||||||
Thread::Msleep(10);
|
Thread::Msleep(10);
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
ClientSenderCallback(ClientThread &client) : m_client(client) {}
|
ClientSenderCallback(ClientThread &client) : m_client(client) {}
|
||||||
virtual ~ClientSenderCallback() {}
|
virtual ~ClientSenderCallback() {}
|
||||||
|
|
||||||
virtual void SignalNetError(SOCKET sock, int errorID, int osErrorID)
|
virtual void SignalNetError(SOCKET /*sock*/, int errorID, int osErrorID)
|
||||||
{
|
{
|
||||||
// For now, we ignore the socket.
|
// For now, we ignore the socket.
|
||||||
// Just signal the error.
|
// Just signal the error.
|
||||||
|
|||||||
@@ -981,7 +981,7 @@ NetPacketInitAck::ToNetPacketInitAck() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketInitAck::InternalCheck(const NetPacketHeader* data) const
|
NetPacketInitAck::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1186,9 +1186,8 @@ NetPacketGameListUpdate::ToNetPacketGameListUpdate() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketGameListUpdate::InternalCheck(const NetPacketHeader* data) const
|
NetPacketGameListUpdate::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1246,7 +1245,7 @@ NetPacketGameListPlayerJoined::ToNetPacketGameListPlayerJoined() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketGameListPlayerJoined::InternalCheck(const NetPacketHeader* data) const
|
NetPacketGameListPlayerJoined::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1306,7 +1305,7 @@ NetPacketGameListPlayerLeft::ToNetPacketGameListPlayerLeft() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketGameListPlayerLeft::InternalCheck(const NetPacketHeader* data) const
|
NetPacketGameListPlayerLeft::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1364,7 +1363,7 @@ NetPacketRetrievePlayerInfo::ToNetPacketRetrievePlayerInfo() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketRetrievePlayerInfo::InternalCheck(const NetPacketHeader* data) const
|
NetPacketRetrievePlayerInfo::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1748,7 +1747,6 @@ NetPacketJoinGameAck::ToNetPacketJoinGameAck() const
|
|||||||
void
|
void
|
||||||
NetPacketJoinGameAck::InternalCheck(const NetPacketHeader* data) const
|
NetPacketJoinGameAck::InternalCheck(const NetPacketHeader* data) const
|
||||||
{
|
{
|
||||||
u_int16_t dataLen = ntohs(data->length);
|
|
||||||
NetPacketJoinGameAckData *tmpData = (NetPacketJoinGameAckData *)data;
|
NetPacketJoinGameAckData *tmpData = (NetPacketJoinGameAckData *)data;
|
||||||
// Semantic checks
|
// Semantic checks
|
||||||
int maxNumPlayers = ntohs(tmpData->maxNumberOfPlayers);
|
int maxNumPlayers = ntohs(tmpData->maxNumberOfPlayers);
|
||||||
@@ -1820,7 +1818,7 @@ NetPacketPlayerJoined::ToNetPacketPlayerJoined() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketPlayerJoined::InternalCheck(const NetPacketHeader* data) const
|
NetPacketPlayerJoined::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1878,7 +1876,7 @@ NetPacketPlayerLeft::ToNetPacketPlayerLeft() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketPlayerLeft::InternalCheck(const NetPacketHeader* data) const
|
NetPacketPlayerLeft::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1936,7 +1934,7 @@ NetPacketKickPlayer::ToNetPacketKickPlayer() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketKickPlayer::InternalCheck(const NetPacketHeader* data) const
|
NetPacketKickPlayer::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -1973,7 +1971,7 @@ NetPacketStartEvent::ToNetPacketStartEvent() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketStartEvent::InternalCheck(const NetPacketHeader* data) const
|
NetPacketStartEvent::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -2907,7 +2905,7 @@ NetPacketEndOfHandHideCards::ToNetPacketEndOfHandHideCards() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketEndOfHandHideCards::InternalCheck(const NetPacketHeader* data) const
|
NetPacketEndOfHandHideCards::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -2963,7 +2961,7 @@ NetPacketEndOfGame::ToNetPacketEndOfGame() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketEndOfGame::InternalCheck(const NetPacketHeader* data) const
|
NetPacketEndOfGame::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
@@ -3265,7 +3263,7 @@ NetPacketError::ToNetPacketError() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetPacketError::InternalCheck(const NetPacketHeader* data) const
|
NetPacketError::InternalCheck(const NetPacketHeader*) const
|
||||||
{
|
{
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ void
|
|||||||
AbstractServerGameStateRunning::HandleNewSession(ServerGameThread &server, SessionWrapper session)
|
AbstractServerGameStateRunning::HandleNewSession(ServerGameThread &server, SessionWrapper session)
|
||||||
{
|
{
|
||||||
// Do not accept new sessions in this state.
|
// Do not accept new sessions in this state.
|
||||||
// TODO
|
server.SessionError(session, ERR_NET_GAME_ALREADY_RUNNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
NetPacket &operator=(const NetPacket& right); // not allowed
|
||||||
|
|
||||||
void Check(const NetPacketHeader *data) const;
|
void Check(const NetPacketHeader *data) const;
|
||||||
virtual void InternalCheck(const NetPacketHeader *data) const = 0;
|
virtual void InternalCheck(const NetPacketHeader *data) const = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user