mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-11-03 08:14:28 -05:00
Possibly fixed #375 trivia bug
This commit is contained in:
@@ -57,11 +57,14 @@ public sealed class TriviaGame
|
||||
// loop until game is stopped
|
||||
// each iteration is one round
|
||||
var firstRun = true;
|
||||
try
|
||||
{
|
||||
while (!_isStopped)
|
||||
{
|
||||
if (errorCount >= 5)
|
||||
{
|
||||
Log.Warning("Trivia errored 5 times and will quit");
|
||||
await OnEnded(this);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -87,7 +90,8 @@ public sealed class TriviaGame
|
||||
try
|
||||
{
|
||||
// clear out all of the past guesses
|
||||
while (_inputs.Reader.TryRead(out _)) ;
|
||||
while (_inputs.Reader.TryRead(out _))
|
||||
;
|
||||
|
||||
await OnQuestion(this, question);
|
||||
}
|
||||
@@ -169,11 +173,17 @@ public sealed class TriviaGame
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
// make sure game is set as ended
|
||||
_isStopped = true;
|
||||
|
||||
await OnEnded(this);
|
||||
_ = OnEnded(this);
|
||||
}
|
||||
}
|
||||
|
||||
public IReadOnlyList<(ulong User, int points)> GetLeaderboard()
|
||||
|
||||
Reference in New Issue
Block a user