X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fgames%2Fquiz.rb;h=b139c66a2fad25eb2ec8c9c0e31900ce2f0307a3;hb=452e323bfdb73d6b93ab96f5fc417891e4aa8f53;hp=d2562bdae829a75978215235a499bab9f8e2e56c;hpb=69a80e30cc532efae0a445337a782aca25360e84;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/games/quiz.rb b/data/rbot/plugins/games/quiz.rb index d2562bda..b139c66a 100644 --- a/data/rbot/plugins/games/quiz.rb +++ b/data/rbot/plugins/games/quiz.rb @@ -175,6 +175,22 @@ class QuizPlugin < Plugin @ask_mutex = Mutex.new end + def cleanup + @ask_mutex.synchronize do + # purge all waiting timers + @waiting.each do |chan, t| + @bot.timer.remove t.first + @bot.say chan, _("stopped quiz timer") + end + @waiting.clear + end + chans = @quizzes.keys + @quizzes.clear + chans.each do |chan| + @bot.say chan, _("quiz stopped") + end + end + # Function that returns whether a char is a "separator", used for hints # def is_sep( ch ) @@ -302,8 +318,8 @@ class QuizPlugin < Plugin if topic == "admin" _("Quiz game aministration commands (requires authentication): ") + [ _("'quiz autoask ' => enable/disable autoask mode"), - _("'quiz autoask delay ' => delay next quiz by seconds when in autoask mode"), - _("'quiz autoskip ' => enable/disable autoskip mode (autoskip implies instant autoask)"), + _("'quiz autoask delay