Commit f46d68b5 authored by Matt Lowe's avatar Matt Lowe
Browse files

Server was using message limit for commands

Server was using getMaxMessageCountPerInterval over
getMaxCommandCountPerInterval.

Raised command limit from 10 to 20
parent 1e06a971
...@@ -234,7 +234,7 @@ Response::ResponseCode Server_ProtocolHandler::processGameCommandContainer(const ...@@ -234,7 +234,7 @@ Response::ResponseCode Server_ProtocolHandler::processGameCommandContainer(const
return Response::RespNotInRoom; return Response::RespNotInRoom;
int commandCountingInterval = server->getCommandCountingInterval(); int commandCountingInterval = server->getCommandCountingInterval();
int maxMessageCountPerInterval = server->getMaxMessageCountPerInterval(); int maxCommandCountPerInterval = server->getMaxCommandCountPerInterval();
GameEventStorage ges; GameEventStorage ges;
Response::ResponseCode finalResponseCode = Response::RespOk; Response::ResponseCode finalResponseCode = Response::RespOk;
for (int i = cont.game_command_size() - 1; i >= 0; --i) { for (int i = cont.game_command_size() - 1; i >= 0; --i) {
...@@ -252,7 +252,7 @@ Response::ResponseCode Server_ProtocolHandler::processGameCommandContainer(const ...@@ -252,7 +252,7 @@ Response::ResponseCode Server_ProtocolHandler::processGameCommandContainer(const
for (int i = 0; i < commandCountOverTime.size(); ++i) for (int i = 0; i < commandCountOverTime.size(); ++i)
totalCount += commandCountOverTime[i]; totalCount += commandCountOverTime[i];
if (totalCount > maxMessageCountPerInterval) if (totalCount > maxCommandCountPerInterval)
return Response::RespChatFlood; return Response::RespChatFlood;
} }
......
...@@ -260,7 +260,7 @@ bool Servatrice::initServer() ...@@ -260,7 +260,7 @@ bool Servatrice::initServer()
maxMessageSizePerInterval = settingsCache->value("security/max_message_size_per_interval", 1000).toInt(); maxMessageSizePerInterval = settingsCache->value("security/max_message_size_per_interval", 1000).toInt();
maxGamesPerUser = settingsCache->value("security/max_games_per_user", 5).toInt(); maxGamesPerUser = settingsCache->value("security/max_games_per_user", 5).toInt();
commandCountingInterval = settingsCache->value("game/command_counting_interval", 10).toInt(); commandCountingInterval = settingsCache->value("game/command_counting_interval", 10).toInt();
maxCommandCountPerInterval = settingsCache->value("game/max_command_count_per_interval", 10).toInt(); maxCommandCountPerInterval = settingsCache->value("game/max_command_count_per_interval", 20).toInt();
try { if (settingsCache->value("servernetwork/active", 0).toInt()) { try { if (settingsCache->value("servernetwork/active", 0).toInt()) {
qDebug() << "Connecting to ISL network."; qDebug() << "Connecting to ISL network.";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment