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] [default VotingSettings]
;= Determines the duration of the voting period, specified in seconds. ;= Determines the duration of the voting period, specified in seconds.
votingTime=30 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. ;= Determines whether spectators are allowed to vote.
allowSpectatorVoting=false allowSpectatorVoting=false
;= Specifies which group(s) of players are allowed to see who makes what vote. ;= Specifies which group(s) of players are allowed to see who makes what vote.
@ -16,7 +11,6 @@ allowedToVoteGroup="everybody"
[moderator VotingSettings] [moderator VotingSettings]
votingTime=30 votingTime=30
minimalRoundsToVote=0
allowSpectatorVoting=true allowSpectatorVoting=true
allowedToSeeVotesGroup="admin" allowedToSeeVotesGroup="admin"
allowedToVoteGroup="moderator" allowedToVoteGroup="moderator"
@ -24,6 +18,5 @@ allowedToVoteGroup="admin"
[admin VotingSettings] [admin VotingSettings]
votingTime=30 votingTime=30
minimalRoundsToVote=0
allowSpectatorVoting=true allowSpectatorVoting=true
allowedToVoteGroup="admin" 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. /// Determines the duration of the voting period, specified in seconds.
var public config float votingTime; 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. /// Determines whether spectators are allowed to vote.
var public config bool allowSpectatorVoting; var public config bool allowSpectatorVoting;
/// Specifies which group(s) of players are allowed to see who makes what vote. /// 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 = __().collections.EmptyHashTable();
data.SetFloat(P("votingTime"), votingTime); data.SetFloat(P("votingTime"), votingTime);
data.SetInt(P("minimalRoundsToVote"), minimalRoundsToVote);
data.SetBool(P("allowSpectatorVoting"), allowSpectatorVoting); data.SetBool(P("allowSpectatorVoting"), allowSpectatorVoting);
arrayOfTexts = _.collections.EmptyArrayList(); arrayOfTexts = _.collections.EmptyArrayList();
@ -52,7 +45,6 @@ protected function FromData(HashTable source) {
return; return;
} }
votingTime = source.GetFloat(P("votingTime"), 30.0); votingTime = source.GetFloat(P("votingTime"), 30.0);
minimalRoundsToVote = source.GetInt(P("minimalRoundsToVote"), 1);
allowSpectatorVoting = source.GetBool(P("allowSpectatorVoting"), false); allowSpectatorVoting = source.GetBool(P("allowSpectatorVoting"), false);
allowedToSeeVotesGroup.length = 0; allowedToSeeVotesGroup.length = 0;
@ -72,7 +64,6 @@ protected function FromData(HashTable source) {
protected function DefaultIt() { protected function DefaultIt() {
votingTime = 30.0; votingTime = 30.0;
minimalRoundsToVote = 1;
allowSpectatorVoting = false; allowSpectatorVoting = false;
allowedToSeeVotesGroup.length = 0; allowedToSeeVotesGroup.length = 0;
allowedToVoteGroup.length = 0; allowedToVoteGroup.length = 0;

Loading…
Cancel
Save