comparison libervia.py @ 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
64 64
65 class BridgeCall(LiberviaJsonProxy): 65 class BridgeCall(LiberviaJsonProxy):
66 def __init__(self): 66 def __init__(self):
67 LiberviaJsonProxy.__init__(self, "/json_api", 67 LiberviaJsonProxy.__init__(self, "/json_api",
68 ["getContacts", "sendMessage", "sendMblog", "getMblogNodes", "getProfileJid", "getHistory", 68 ["getContacts", "sendMessage", "sendMblog", "getMblogNodes", "getProfileJid", "getHistory",
69 "getPresenceStatus", "getRoomJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed"]) 69 "getPresenceStatus", "getRoomJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed",
70 "tarotGamePlayCards"])
70 71
71 class BridgeSignals(LiberviaJsonProxy): 72 class BridgeSignals(LiberviaJsonProxy):
72 def __init__(self): 73 def __init__(self):
73 LiberviaJsonProxy.__init__(self, "/json_signal_api", 74 LiberviaJsonProxy.__init__(self, "/json_signal_api",
74 ["getSignals"]) 75 ["getSignals"])
171 self._roomUserLeftCb(*args) 172 self._roomUserLeftCb(*args)
172 elif name == 'tarotGameStarted': 173 elif name == 'tarotGameStarted':
173 self._tarotGameStartedCb(*args) 174 self._tarotGameStartedCb(*args)
174 elif name == 'tarotGameNew' or \ 175 elif name == 'tarotGameNew' or \
175 name == 'tarotGameChooseContrat' or \ 176 name == 'tarotGameChooseContrat' or \
176 name == 'tarotGameShowCards': 177 name == 'tarotGameShowCards' or \
178 name == 'tarotGameInvalidCards' or \
179 name == 'tarotGameCardsPlayed' or \
180 name == 'tarotGameYourTurn':
177 self._tarotGameGenericCb(name, args[0], args[1:]) 181 self._tarotGameGenericCb(name, args[0], args[1:])
178 182
179 def _getProfileJidCB(self, jid): 183 def _getProfileJidCB(self, jid):
180 self.whoami = JID(jid) 184 self.whoami = JID(jid)
181 #we can now ask our status 185 #we can now ask our status