core: plugins refactored according to bridge + updatedValue now use profile
This commit is contained in:
parent
b3322dabae
commit
ad29111416
1 changed files with 164 additions and 155 deletions
|
|
@ -64,18 +64,18 @@ class Quiz():
|
|||
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 @@ class Quiz():
|
|||
'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 @@ class Quiz():
|
|||
'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 @@ class Quiz():
|
|||
'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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue