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
This commit is contained in:
parent
f335cb60a7
commit
5d458899dc
1 changed files with 92 additions and 17 deletions
|
|
@ -47,6 +47,7 @@ class QuickApp():
|
|||
self.bridge.register("roomUserLeft", self.roomUserLeft)
|
||||
self.bridge.register("roomNewSubject", self.roomNewSubject)
|
||||
self.bridge.register("tarotGameStarted", self.tarotGameStarted)
|
||||
self.bridge.register("tarotGameNew", self.tarotGameNew)
|
||||
self.bridge.register("subscribe", self.subscribe)
|
||||
self.bridge.register("paramUpdate", self.paramUpdate)
|
||||
self.bridge.register("contactDeleted", self.contactDeleted)
|
||||
|
|
@ -250,15 +251,23 @@ class QuickApp():
|
|||
def tarotGameStarted(self, room_jid, players, profile):
|
||||
if not self.__check_profile(profile):
|
||||
return
|
||||
print "Tarot Game Started \o/"
|
||||
debug (_("Tarot Game Started \o/"))
|
||||
if self.chat_wins.has_key(room_jid):
|
||||
self.chat_wins[room_jid].startGame("Tarot")
|
||||
debug (_("new Tarot game started in room [%(room_jid)s]") % {'room_jid':room_jid})
|
||||
self.chat_wins[room_jid].startGame("Tarot", players)
|
||||
debug (_("new Tarot game started in room [%(room_jid)s] with %(players)s") % {'room_jid':room_jid, 'players':[str(player) for player in players]})
|
||||
|
||||
def tarotGameNew(self, room_jid, hand, profile):
|
||||
if not self.__check_profile(profile):
|
||||
return
|
||||
debug (_("New Tarot Game"))
|
||||
print "hand:", hand
|
||||
if self.chat_wins.has_key(room_jid):
|
||||
self.chat_wins[room_jid].getGame("Tarot").newGame(hand)
|
||||
|
||||
|
||||
|
||||
|
||||
def subscribe(self, type, raw_jid, profile):
|
||||
"""Called when a subsciption maangement signal is received"""
|
||||
"""Called when a subsciption management signal is received"""
|
||||
if not self.__check_profile(profile):
|
||||
return
|
||||
entity = JID(raw_jid)
|
||||
|
|
|
|||
Loading…
Reference in a new issue