Mercurial > libervia-backend
diff src/plugins/plugin_misc_quiz.py @ 372:f964dcec1611
core: plugins refactored according to bridge + updatedValue now use profile
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 06 Jul 2011 01:06:18 +0200 |
parents | 208107419b17 |
children | afe9cfd2ddbb |
line wrap: on
line diff
--- a/src/plugins/plugin_misc_quiz.py Wed Jul 06 01:04:24 2011 +0200 +++ b/src/plugins/plugin_misc_quiz.py Wed Jul 06 01:06:18 2011 +0200 @@ -64,18 +64,18 @@ self.host = host self.games={} self.waiting_inv = {} #Invitation waiting for people to join to launch a game - host.bridge.addMethod("quizGameLaunch", ".communication", in_sign='ass', out_sign='', method=self.quizGameLaunch) #args: room_jid, players, profile - host.bridge.addMethod("quizGameCreate", ".communication", in_sign='sass', out_sign='', method=self.quizGameCreate) #args: room_jid, players, profile - host.bridge.addMethod("quizGameReady", ".communication", in_sign='sss', out_sign='', method=self.newPlayerReady) #args: player, referee, profile - host.bridge.addMethod("quizGameAnswer", ".communication", in_sign='ssss', out_sign='', method=self.playerAnswer) - host.bridge.addSignal("quizGameStarted", ".communication", signature='ssass') #args: room_jid, referee, players, profile - host.bridge.addSignal("quizGameNew", ".communication", + host.bridge.addMethod("quizGameLaunch", ".plugin", in_sign='ass', out_sign='', method=self.quizGameLaunch) #args: room_jid, players, profile + host.bridge.addMethod("quizGameCreate", ".plugin", in_sign='sass', out_sign='', method=self.quizGameCreate) #args: room_jid, players, profile + host.bridge.addMethod("quizGameReady", ".plugin", in_sign='sss', out_sign='', method=self.newPlayerReady) #args: player, referee, profile + host.bridge.addMethod("quizGameAnswer", ".plugin", in_sign='ssss', out_sign='', method=self.playerAnswer) + host.bridge.addSignal("quizGameStarted", ".plugin", signature='ssass') #args: room_jid, referee, players, profile + host.bridge.addSignal("quizGameNew", ".plugin", signature='sa{ss}s', doc = { 'summary': 'Start a new game', 'param_0': "room_jid: jid of game's room", 'param_1': "game_data: data of the game", 'param_2': '%(doc_profile)s'}) - host.bridge.addSignal("quizGameQuestion", ".communication", + host.bridge.addSignal("quizGameQuestion", ".plugin", signature = 'sssis', doc = { 'summary': "Send the current question", 'param_0': "room_jid: jid of game's room", @@ -83,14 +83,14 @@ 'param_2': "question: question to ask", 'param_3': "timer: timer", 'param_4': '%(doc_profile)s'}) - host.bridge.addSignal("quizGamePlayerBuzzed", ".communication", + host.bridge.addSignal("quizGamePlayerBuzzed", ".plugin", signature = 'ssbs', doc = { 'summary': "A player just pressed the buzzer", 'param_0': "room_jid: jid of game's room", 'param_1': "player: player who pushed the buzzer", 'param_2': "pause: should the game be paused ?", 'param_3': '%(doc_profile)s'}) - host.bridge.addSignal("quizGamePlayerSays", ".communication", + host.bridge.addSignal("quizGamePlayerSays", ".plugin", signature = 'sssis', doc = { 'summary': "A player just pressed the buzzer", 'param_0': "room_jid: jid of game's room", @@ -98,7 +98,7 @@ 'param_2': "text: what the player say", 'param_3': "delay: how long, in seconds, the text must appear", 'param_4': '%(doc_profile)s'}) - host.bridge.addSignal("quizGameAnswerResult", ".communication", + host.bridge.addSignal("quizGameAnswerResult", ".plugin", signature = 'ssba{si}s', doc = { 'summary': "Result of the just given answer", 'param_0': "room_jid: jid of game's room", @@ -106,12 +106,12 @@ 'param_2': "good_answer: True if the answer is right", 'param_3': "score: dict of score with player as key", 'param_4': '%(doc_profile)s'}) - host.bridge.addSignal("quizGameTimerExpired", ".communication", + host.bridge.addSignal("quizGameTimerExpired", ".plugin", signature = 'ss', doc = { 'summary': "Nobody answered the question in time", 'param_0': "room_jid: jid of game's room", 'param_1': '%(doc_profile)s'}) - host.bridge.addSignal("quizGameTimerRestarted", ".communication", + host.bridge.addSignal("quizGameTimerRestarted", ".plugin", signature = 'sis', doc = { 'summary': "Nobody answered the question in time", 'param_0': "room_jid: jid of game's room",