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
This commit is contained in:
Goffi 2010-05-07 17:09:30 +09:30
commit fe4db2366b

View file

@ -46,6 +46,7 @@ class QuickApp():
self.bridge.register("roomUserJoined", self.roomUserJoined)
self.bridge.register("roomUserLeft", self.roomUserLeft)
self.bridge.register("roomNewSubject", self.roomNewSubject)
self.bridge.register("tarotGameStarted", self.tarotGameStarted)
self.bridge.register("subscribe", self.subscribe)
self.bridge.register("paramUpdate", self.paramUpdate)
self.bridge.register("contactDeleted", self.contactDeleted)
@ -215,6 +216,7 @@ class QuickApp():
room_jid=room_id+'@'+room_service
self.chat_wins[room_jid].setUserNick(user_nick)
self.chat_wins[room_jid].setType("group")
self.chat_wins[room_jid].id = room_jid
self.chat_wins[room_jid].setPresents([user_nick]+room_nicks)
@ -244,6 +246,11 @@ class QuickApp():
if self.chat_wins.has_key(room_jid):
self.chat_wins[room_jid].setSubject(subject)
debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})
def tarotGameStarted(self, room_jid, players, profile):
if not self.__check_profile(profile):
return
print "Tarot Game Started \o/"
def subscribe(self, type, raw_jid, profile):