comparison libervia.tac @ 39:305e81c7a32c

Tarot game: a game can now be finished
author Goffi <goffi@goffi.org>
date Sun, 22 May 2011 00:15:01 +0200
parents 7bea2ae0c4fb
children 7782a786b2f0
comparison
equal deleted inserted replaced
38:7bea2ae0c4fb 39:305e81c7a32c
135 135
136 def jsonrpc_tarotGameContratChoosed(self, player_nick, referee, contrat): 136 def jsonrpc_tarotGameContratChoosed(self, player_nick, referee, contrat):
137 """Tell to the server that we are ready to start the game""" 137 """Tell to the server that we are ready to start the game"""
138 profile = self.session.sat_profile 138 profile = self.session.sat_profile
139 self.sat_host.bridge.tarotGameContratChoosed(player_nick, referee, contrat, profile) 139 self.sat_host.bridge.tarotGameContratChoosed(player_nick, referee, contrat, profile)
140
141 def jsonrpc_tarotGamePlayCards(self, player_nick, referee, cards):
142 """Tell to the server that we are ready to start the game"""
143 profile = self.session.sat_profile
144 self.sat_host.bridge.tarotGamePlayCards(player_nick, referee, cards, profile)
140 145
141 class Register(jsonrpc.JSONRPC): 146 class Register(jsonrpc.JSONRPC):
142 """This class manage the registration procedure with SàT 147 """This class manage the registration procedure with SàT
143 It provide an api for the browser, check password and setup the web server""" 148 It provide an api for the browser, check password and setup the web server"""
144 149
360 import sys 365 import sys
361 sys.exit(1) 366 sys.exit(1)
362 self.bridge.register("connected", self.signal_handler.connected) 367 self.bridge.register("connected", self.signal_handler.connected)
363 self.bridge.register("connectionError", self.signal_handler.connectionError) 368 self.bridge.register("connectionError", self.signal_handler.connectionError)
364 for signal_name in ['presenceUpdate', 'personalEvent', 'newMessage', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew', 369 for signal_name in ['presenceUpdate', 'personalEvent', 'newMessage', 'roomJoined', 'roomUserJoined', 'roomUserLeft', 'tarotGameStarted', 'tarotGameNew',
365 'tarotGameChooseContrat', 'tarotGameShowCards']: 370 'tarotGameChooseContrat', 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn']:
366 self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name)) 371 self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name))
367 root.putChild('json_signal_api', self.signal_handler) 372 root.putChild('json_signal_api', self.signal_handler)
368 root.putChild('json_api', MethodHandler(self)) 373 root.putChild('json_api', MethodHandler(self))
369 root.putChild('register_api', _register) 374 root.putChild('register_api', _register)
370 root.putChild('blog', MicroBlog(self)) 375 root.putChild('blog', MicroBlog(self))