Adding tests for ranking games, fixing small issue when creating ranking games.
This commit is contained in:
@@ -984,7 +984,7 @@ ServerGame::CheckPassword(const string &password) const
|
||||
}
|
||||
|
||||
bool
|
||||
ServerGame::CheckSettings(const GameData &data)
|
||||
ServerGame::CheckSettings(const GameData &data, const string &password)
|
||||
{
|
||||
bool retVal = true;
|
||||
if (data.gameType == GAME_TYPE_RANKING)
|
||||
@@ -994,7 +994,8 @@ ServerGame::CheckSettings(const GameData &data)
|
||||
|| (data.firstSmallBlind != RANKING_GAME_START_SBLIND)
|
||||
|| (data.raiseIntervalMode != RAISE_ON_HANDNUMBER)
|
||||
|| (data.raiseMode != DOUBLE_BLINDS)
|
||||
|| (data.raiseSmallBlindEveryHandsValue != RANKING_GAME_RAISE_EVERY_HAND))
|
||||
|| (data.raiseSmallBlindEveryHandsValue != RANKING_GAME_RAISE_EVERY_HAND)
|
||||
|| (!password.empty()))
|
||||
{
|
||||
retVal = false;
|
||||
}
|
||||
|
||||
@@ -1349,7 +1349,7 @@ ServerLobbyThread::HandleNetPacketCreateGame(SessionWrapper session, const std::
|
||||
{
|
||||
SendJoinGameFailed(session.sessionData, gameId, NTF_NET_JOIN_GUEST_FORBIDDEN);
|
||||
}
|
||||
else if (!ServerGame::CheckSettings(tmpData))
|
||||
else if (!ServerGame::CheckSettings(tmpData, password))
|
||||
{
|
||||
SendJoinGameFailed(session.sessionData, gameId, NTF_NET_JOIN_INVALID_SETTINGS);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
bool IsPasswordProtected() const;
|
||||
bool CheckPassword(const std::string &password) const;
|
||||
static bool CheckSettings(const GameData &data);
|
||||
static bool CheckSettings(const GameData &data, const std::string &password);
|
||||
const GameData &GetGameData() const;
|
||||
|
||||
boost::shared_ptr<PlayerData> GetPlayerDataByUniqueId(unsigned playerId) const;
|
||||
|
||||
Reference in New Issue
Block a user