From 7ab6ff9f54ed03528e08a0bfcec57e86ce9cb24a Mon Sep 17 00:00:00 2001 From: James Scott Date: Sun, 16 Dec 2012 21:07:17 -0500 Subject: [PATCH] added basic end logic --- plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin.py b/plugin.py index 05a0bfd..3a496e5 100644 --- a/plugin.py +++ b/plugin.py @@ -180,9 +180,12 @@ class Cah(callbacks.Plugin): schedule.addEvent(self.endround, time.time() + 60, "round_%s" % channel) except Exception as e: #TODO: add no more round logic - self._msg(channel, "TODO END GAME LOGIC.") - print e - pass + + playerScores = sorted(cah.score.iteritems(), key=operator.itemgetter(1), reverse=True) + scores = [] + for name, score in playerScores.iteritems(): + scores.append("%s: %d" % (name, score)) + self.msg(channel, "Game Over! Scores: %s " % ", ".join(scores)) def endround(self): channel = self.channel