comparison frontends/quick_frontend/quick_app.py @ 85:fc7583282d40

Tarot Game plugin: first draft - SàT: beginning of the plugin - Tarot Plugin: 1 method createTarotGame et 1 signal tarotGameStarted - wix: added "Game" menu in group chat to start Tarot game
author Goffi <goffi@goffi.org>
date Fri, 07 May 2010 17:09:30 +0930
parents db0a0f000e37
children 4b5f2d55b6ac
comparison
equal deleted inserted replaced
84:7471ffcda33b 85:fc7583282d40
44 self.bridge.register("presenceUpdate", self.presenceUpdate) 44 self.bridge.register("presenceUpdate", self.presenceUpdate)
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("subscribe", self.subscribe) 50 self.bridge.register("subscribe", self.subscribe)
50 self.bridge.register("paramUpdate", self.paramUpdate) 51 self.bridge.register("paramUpdate", self.paramUpdate)
51 self.bridge.register("contactDeleted", self.contactDeleted) 52 self.bridge.register("contactDeleted", self.contactDeleted)
52 self.bridge.register("updatedValue", self.updatedValue, "request") 53 self.bridge.register("updatedValue", self.updatedValue, "request")
53 self.bridge.register("askConfirmation", self.askConfirmation, "request") 54 self.bridge.register("askConfirmation", self.askConfirmation, "request")
213 return 214 return
214 debug (_("Room [%(room_name)s] joined by %(profile)s, users presents:%(users)s") % {'room_name':room_id+'@'+room_service, 'profile': profile, 'users':room_nicks}) 215 debug (_("Room [%(room_name)s] joined by %(profile)s, users presents:%(users)s") % {'room_name':room_id+'@'+room_service, 'profile': profile, 'users':room_nicks})
215 room_jid=room_id+'@'+room_service 216 room_jid=room_id+'@'+room_service
216 self.chat_wins[room_jid].setUserNick(user_nick) 217 self.chat_wins[room_jid].setUserNick(user_nick)
217 self.chat_wins[room_jid].setType("group") 218 self.chat_wins[room_jid].setType("group")
219 self.chat_wins[room_jid].id = room_jid
218 self.chat_wins[room_jid].setPresents([user_nick]+room_nicks) 220 self.chat_wins[room_jid].setPresents([user_nick]+room_nicks)
219 221
220 222
221 def roomUserJoined(self, room_id, room_service, user_nick, user_data, profile): 223 def roomUserJoined(self, room_id, room_service, user_nick, user_data, profile):
222 """Called when an user joined a MUC room""" 224 """Called when an user joined a MUC room"""
242 return 244 return
243 room_jid=room_id+'@'+room_service 245 room_jid=room_id+'@'+room_service
244 if self.chat_wins.has_key(room_jid): 246 if self.chat_wins.has_key(room_jid):
245 self.chat_wins[room_jid].setSubject(subject) 247 self.chat_wins[room_jid].setSubject(subject)
246 debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject}) 248 debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})
249
250 def tarotGameStarted(self, room_jid, players, profile):
251 if not self.__check_profile(profile):
252 return
253 print "Tarot Game Started \o/"
247 254
248 255
249 def subscribe(self, type, raw_jid, profile): 256 def subscribe(self, type, raw_jid, profile):
250 """Called when a subsciption maangement signal is received""" 257 """Called when a subsciption maangement signal is received"""
251 if not self.__check_profile(profile): 258 if not self.__check_profile(profile):