Add option to servatrice to disable replay storage.

This commit is contained in:
woogerboy21 2015-08-10 15:29:30 -04:00
parent de1b925b7d
commit fefceac2c6
3 changed files with 9 additions and 0 deletions

View file

@ -193,6 +193,11 @@ roomlist\1\game_types\3\name="GameType3"
; default is 120
max_game_inactivity_time=120
; All actions during a game are recorded and stored in the database as a replay that all participants of
; the game can go back to and review after the game is closed. This can require a fairly large amount of
; storage to save all the information. Disable this option to prevent the storing of replay data in
; the database. Default value is true.
store_replays=true
[security]
; You may want to restrict the number of users that can connect to your server at any given time.

View file

@ -162,6 +162,7 @@ bool Servatrice::initServer()
authenticationMethod = AuthenticationNone;
}
qDebug() << "Store Replays: " << settingsCache->value("game/store_replays", true).toBool();
qDebug() << "Client ID Required: " << clientIdRequired;
bool maxUserLimitEnabled = settingsCache->value("security/enable_max_user_limit", false).toBool();
qDebug() << "Maximum user limit enabled: " << maxUserLimitEnabled;

View file

@ -642,6 +642,9 @@ void Servatrice_DatabaseInterface::storeGameInformation(const QString &roomName,
if (!checkSql())
return;
if (!settingsCache->value("game/store_replays", 1).toBool() )
return;
QVariantList gameIds1, playerNames, gameIds2, userIds, replayNames;
QSetIterator<QString> playerIterator(allPlayersEver);
while (playerIterator.hasNext()) {