comparison frontends/quick_frontend/quick_app.py @ 87:66d784082930

Tarot game - Tarot plugin: game session start, first draft - wix: Tarot: names of players are now printed - wix: Tarot: game session start first draft - wix : Tarot: card can be compared and sorted
author Goffi <goffi@goffi.org>
date Tue, 11 May 2010 23:58:32 +0930
parents 4b5f2d55b6ac
children 23caf1051099
comparison
equal deleted inserted replaced
86:4b5f2d55b6ac 87:66d784082930
45 self.bridge.register("roomJoined", self.roomJoined) 45 self.bridge.register("roomJoined", self.roomJoined)
46 self.bridge.register("roomUserJoined", self.roomUserJoined) 46 self.bridge.register("roomUserJoined", self.roomUserJoined)
47 self.bridge.register("roomUserLeft", self.roomUserLeft) 47 self.bridge.register("roomUserLeft", self.roomUserLeft)
48 self.bridge.register("roomNewSubject", self.roomNewSubject) 48 self.bridge.register("roomNewSubject", self.roomNewSubject)
49 self.bridge.register("tarotGameStarted", self.tarotGameStarted) 49 self.bridge.register("tarotGameStarted", self.tarotGameStarted)
50 self.bridge.register("tarotGameNew", self.tarotGameNew)
50 self.bridge.register("subscribe", self.subscribe) 51 self.bridge.register("subscribe", self.subscribe)
51 self.bridge.register("paramUpdate", self.paramUpdate) 52 self.bridge.register("paramUpdate", self.paramUpdate)
52 self.bridge.register("contactDeleted", self.contactDeleted) 53 self.bridge.register("contactDeleted", self.contactDeleted)
53 self.bridge.register("updatedValue", self.updatedValue, "request") 54 self.bridge.register("updatedValue", self.updatedValue, "request")
54 self.bridge.register("askConfirmation", self.askConfirmation, "request") 55 self.bridge.register("askConfirmation", self.askConfirmation, "request")
248 debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject}) 249 debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})
249 250
250 def tarotGameStarted(self, room_jid, players, profile): 251 def tarotGameStarted(self, room_jid, players, profile):
251 if not self.__check_profile(profile): 252 if not self.__check_profile(profile):
252 return 253 return
253 print "Tarot Game Started \o/" 254 debug (_("Tarot Game Started \o/"))
254 if self.chat_wins.has_key(room_jid): 255 if self.chat_wins.has_key(room_jid):
255 self.chat_wins[room_jid].startGame("Tarot") 256 self.chat_wins[room_jid].startGame("Tarot", players)
256 debug (_("new Tarot game started in room [%(room_jid)s]") % {'room_jid':room_jid}) 257 debug (_("new Tarot game started in room [%(room_jid)s] with %(players)s") % {'room_jid':room_jid, 'players':[str(player) for player in players]})
257 258
258 259 def tarotGameNew(self, room_jid, hand, profile):
260 if not self.__check_profile(profile):
261 return
262 debug (_("New Tarot Game"))
263 print "hand:", hand
264 if self.chat_wins.has_key(room_jid):
265 self.chat_wins[room_jid].getGame("Tarot").newGame(hand)
266
267
259 268
260 def subscribe(self, type, raw_jid, profile): 269 def subscribe(self, type, raw_jid, profile):
261 """Called when a subsciption maangement signal is received""" 270 """Called when a subsciption management signal is received"""
262 if not self.__check_profile(profile): 271 if not self.__check_profile(profile):
263 return 272 return
264 entity = JID(raw_jid) 273 entity = JID(raw_jid)
265 if type=="subscribed": 274 if type=="subscribed":
266 # this is a subscription confirmation, we just have to inform user 275 # this is a subscription confirmation, we just have to inform user