Browse Source

Remove minimal rounds requirement from voting config

pull/12/head
Anton Tarasenko 2 years ago
parent
commit
5daa6e8e02
  1. 7
      config/AcediaVoting.ini
  2. 11
      sources/BaseAPI/API/Commands/Voting/VotingSettings.uc

7
config/AcediaVoting.ini

@ -1,11 +1,6 @@
[default VotingSettings]
;= Determines the duration of the voting period, specified in seconds.
votingTime=30
;= Minimal amount of rounds player has to play before being allowed to vote.
;= If every player played the same amount of rounds, then voting is allowed even if they played
;= less that specified value
;= `0` to disable.
minimalRoundsToVote=1
;= Determines whether spectators are allowed to vote.
allowSpectatorVoting=false
;= Specifies which group(s) of players are allowed to see who makes what vote.
@ -16,7 +11,6 @@ allowedToVoteGroup="everybody"
[moderator VotingSettings]
votingTime=30
minimalRoundsToVote=0
allowSpectatorVoting=true
allowedToSeeVotesGroup="admin"
allowedToVoteGroup="moderator"
@ -24,6 +18,5 @@ allowedToVoteGroup="admin"
[admin VotingSettings]
votingTime=30
minimalRoundsToVote=0
allowSpectatorVoting=true
allowedToVoteGroup="admin"

11
sources/BaseAPI/API/Commands/Voting/VotingSettings.uc

@ -4,13 +4,7 @@ class VotingSettings extends FeatureConfig
/// Determines the duration of the voting period, specified in seconds.
var public config float votingTime;
/// Minimal amount of rounds player has to play before being allowed to vote.
///
/// If every player played the same amount of rounds, then voting is allowed even if they played
/// less that specified value.
///
/// `0` to disable.
var public config int minimalRoundsToVote;
/// Determines whether spectators are allowed to vote.
var public config bool allowSpectatorVoting;
/// Specifies which group(s) of players are allowed to see who makes what vote.
@ -25,7 +19,6 @@ protected function HashTable ToData() {
data = __().collections.EmptyHashTable();
data.SetFloat(P("votingTime"), votingTime);
data.SetInt(P("minimalRoundsToVote"), minimalRoundsToVote);
data.SetBool(P("allowSpectatorVoting"), allowSpectatorVoting);
arrayOfTexts = _.collections.EmptyArrayList();
@ -52,7 +45,6 @@ protected function FromData(HashTable source) {
return;
}
votingTime = source.GetFloat(P("votingTime"), 30.0);
minimalRoundsToVote = source.GetInt(P("minimalRoundsToVote"), 1);
allowSpectatorVoting = source.GetBool(P("allowSpectatorVoting"), false);
allowedToSeeVotesGroup.length = 0;
@ -72,7 +64,6 @@ protected function FromData(HashTable source) {
protected function DefaultIt() {
votingTime = 30.0;
minimalRoundsToVote = 1;
allowSpectatorVoting = false;
allowedToSeeVotesGroup.length = 0;
allowedToVoteGroup.length = 0;

Loading…
Cancel
Save