error msg
This commit is contained in:
@@ -1383,7 +1383,7 @@ ServerLobbyThread::HandleNetPacketCreateGame(boost::shared_ptr<SessionData> sess
|
||||
// @TODO: uncomment in productive
|
||||
/*&& tmpData.gameType != GAME_TYPE_RANKING*/ ) {
|
||||
LOG_ERROR("not allowed due to ranklimit");
|
||||
SendJoinGameFailed(session, gameId, NTF_NET_JOIN_GAME_INVALID);
|
||||
SendJoinGameFailed(session, gameId, ERR_NET_PLAYER_BLOCKED);
|
||||
} else {
|
||||
boost::shared_ptr<ServerGame> game(
|
||||
new ServerGame(
|
||||
@@ -1436,7 +1436,7 @@ ServerLobbyThread::HandleNetPacketJoinGame(boost::shared_ptr<SessionData> sessio
|
||||
} else if (!game->CheckPassword(password)) {
|
||||
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_INVALID_PASSWORD);
|
||||
} else if (/*tmpData.gameType == GAME_TYPE_RANKING &&*/ !session->GetPlayerData()->IsPlayerAllowedToJoinCreateLimitRank(m_serverConfig.readConfigString("ServerLimitRankNum"), m_serverConfig.readConfigString("ServerLimitRankPeriod"))) {
|
||||
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_GAME_INVALID);
|
||||
SendJoinGameFailed(session, joinGame.gameid(), ERR_NET_PLAYER_BLOCKED);
|
||||
// } else if (tmpData.gameType == GAME_TYPE_RANKING && !joinGame.spectateonly()
|
||||
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR
|
||||
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6
|
||||
|
||||
+1
-6
@@ -32,9 +32,6 @@
|
||||
#include <ctime>
|
||||
#include <core/loghelper.h> // @TODO: remove in productive
|
||||
|
||||
#define SERVER_ALLOWED_RANKING_GAMES_PER_MINUTES 5
|
||||
#define SERVER_ALLOWED_RANKING_GAMES_MINUTES 60
|
||||
|
||||
using namespace std;
|
||||
|
||||
PlayerData::PlayerData(unsigned uniqueId, int number, PlayerType type, PlayerRights rights, bool isGameAdmin)
|
||||
@@ -275,9 +272,7 @@ PlayerData::IsPlayerAllowedToJoinCreateLimitRank(string num, string period)
|
||||
{
|
||||
bool retVal = false;
|
||||
LOG_ERROR("checking IsPlayerAllowedToJoinCreateLimitRank() ");
|
||||
// #define SERVER_ALLOWED_RANKING_GAMES_PER_MINUTES 5
|
||||
// #define SERVER_ALLOWED_RANKING_GAMES_MINUTES 60
|
||||
|
||||
|
||||
boost::mutex::scoped_lock lock(m_dataMutex);
|
||||
|
||||
long then = (long)time(NULL) - (long)(stoi(period) * 10);
|
||||
|
||||
Reference in New Issue
Block a user