Mercurial > libervia-web
diff libervia.tac @ 37:b306aa090438
Tarot game: game launching (first hand showed), and contract selection
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 18 May 2011 01:45:28 +0200 |
parents | 1d406077b49b |
children | 7bea2ae0c4fb |
line wrap: on
line diff
--- a/libervia.tac Tue May 17 01:33:12 2011 +0200 +++ b/libervia.tac Wed May 18 01:45:28 2011 +0200 @@ -128,7 +128,15 @@ """Give the path of all the tarot cards""" return map(lambda x: x[len(LIBERVIA_DIR):],glob.glob(os.path.join(LIBERVIA_DIR,CARDS_DIR,'*_*.png'))); + def jsonrpc_tarotGameReady(self, player, referee): + """Tell to the server that we are ready to start the game""" + profile = self.session.sat_profile + self.sat_host.bridge.tarotGameReady(player, referee) + def jsonrpc_tarotGameContratChoosed(self, player_nick, referee, contrat): + """Tell to the server that we are ready to start the game""" + profile = self.session.sat_profile + self.sat_host.bridge.tarotGameContratChoosed(player_nick, referee, contrat, profile) class Register(jsonrpc.JSONRPC): """This class manage the registration procedure with SàT @@ -353,7 +361,8 @@ sys.exit(1) self.bridge.register("connected", self.signal_handler.connected) self.bridge.register("connectionError", self.signal_handler.connectionError) - for signal_name in ['presenceUpdate', 'personalEvent', 'newMessage', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted']: + for signal_name in ['presenceUpdate', 'personalEvent', 'newMessage', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', + 'tarotGameChooseContrat']: self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name)) root.putChild('json_signal_api', self.signal_handler) root.putChild('json_api', MethodHandler(self))