Problem: teams in pub get imbalanced and a shuffle is required. There is a shuffle system but it never seems to happen, I don't even know how to work it, it isn't discoverable.
Rab> ?help how do u shuffle the teams
Bosshawk> its !shufflevote right at the end of the round but its a small window to request it
Solution: create a command !shufflevote (also create !voteshuffle for the same thing)
put this command in !helpall
what it does:
- add 1 to shuffle counter
- at end of round, if counter >= 3 then shuffle:
- at end of round, expire shuffle votes older than 10 mins:
Rab> ?help how do u shuffle the teams
Bosshawk> its !shufflevote right at the end of the round but its a small window to request it
Solution: create a command !shufflevote (also create !voteshuffle for the same thing)
put this command in !helpall
what it does:
- add 1 to shuffle counter
Code:
List<DateTime> shuffleVotes = new List<DateTime>(); ... shuffleVotes.Items.Add(DateTime.UtcNow);
Code:
int shuffleVoteRequirement = 3;
if (shuffleVotes.Items.Count >= shuffleVoteRequirement)
{
shuffle();
shuffleVotes.Items.Clear();
}
Code:
int shuffleVoteExpirationMinutes = 10;
List<DateTime> votesToKeep = new List<DateTime>();
foreach (DateTime vote in shuffleVotes)
{
if (vote > DateTime.UtcNow.AddMinutes(-1 * shuffleVoteExpirationMinutes) )
{
votesToKeep.Items.Add(vote);
}
}
shuffleVotes.Items.Clear();
foreach (DateTime vote in votesToKeep)
{
shuffleVotes.Items.Add(vote);
}
votesToKeep.Items.Clear();

Comment