Mercurial > libervia-backend
changeset 1257:83ed877541e3
plugin misc_room_game, radiocol, tarot: fixes bridge method "prepareRoom" declaration (add "async=True")
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 22 Oct 2014 14:38:20 +0200 |
parents | 4b27b9bf31b0 |
children | c585df65828a |
files | src/plugins/plugin_misc_radiocol.py src/plugins/plugin_misc_room_game.py src/plugins/plugin_misc_tarot.py |
diffstat | 3 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/plugin_misc_radiocol.py Wed Oct 22 14:16:01 2014 +0200 +++ b/src/plugins/plugin_misc_radiocol.py Wed Oct 22 14:38:20 2014 +0200 @@ -69,7 +69,7 @@ RoomGame._init_(self, host, PLUGIN_INFO, (NC_RADIOCOL, RADIOC_TAG), game_init={'queue': [], 'upload': True, 'playing': None, 'playing_time': 0, 'to_delete': {}}) self.host = host - host.bridge.addMethod("radiocolLaunch", ".plugin", in_sign='asss', out_sign='', method=self.prepareRoom) + host.bridge.addMethod("radiocolLaunch", ".plugin", in_sign='asss', out_sign='', method=self.prepareRoom, async=True) host.bridge.addMethod("radiocolCreate", ".plugin", in_sign='sass', out_sign='', method=self.createGame) host.bridge.addMethod("radiocolSongAdded", ".plugin", in_sign='sss', out_sign='', method=self.radiocolSongAdded, async=True) host.bridge.addSignal("radiocolPlayers", ".plugin", signature='ssass') # room_jid, referee, players, profile
--- a/src/plugins/plugin_misc_room_game.py Wed Oct 22 14:16:01 2014 +0200 +++ b/src/plugins/plugin_misc_room_game.py Wed Oct 22 14:38:20 2014 +0200 @@ -407,7 +407,7 @@ profile = self.host.memory.getProfileName(profile_key) if not profile: log.error(_("Unknown profile")) - return + return defer.succeed(None) if other_players is None: other_players = [] @@ -419,11 +419,11 @@ if room_jid_s is not None and room_jid_s != "": # a room name has been specified if room_jid_s in self.host.plugins["XEP-0045"].clients[profile].joined_rooms: roomJoined(self.host.plugins["XEP-0045"].clients[profile].joined_rooms[room_jid_s]) - return + return defer.succeed(None) else: room_jid_s = self.getUniqueName(profile_key=profile_key) if room_jid_s == "": - return + return defer.succeed(None) user_jid = self.host.getJidNStream(profile)[0] d = self.host.plugins["XEP-0045"].join(JID(room_jid_s), user_jid.user, {}, profile) return d.addCallback(roomJoined)
--- a/src/plugins/plugin_misc_tarot.py Wed Oct 22 14:16:01 2014 +0200 +++ b/src/plugins/plugin_misc_tarot.py Wed Oct 22 14:38:20 2014 +0200 @@ -62,7 +62,7 @@ game_init={'hand_size': 18, 'init_player': 0, 'current_player': None, 'contrat': None, 'stage': None}, player_init={'score': 0}) self.contrats = [_('Passe'), _('Petite'), _('Garde'), _('Garde Sans'), _('Garde Contre')] - host.bridge.addMethod("tarotGameLaunch", ".plugin", in_sign='asss', out_sign='', method=self.prepareRoom) # args: players, room_jid, profile + host.bridge.addMethod("tarotGameLaunch", ".plugin", in_sign='asss', out_sign='', method=self.prepareRoom, async=True) # args: players, room_jid, profile host.bridge.addMethod("tarotGameCreate", ".plugin", in_sign='sass', out_sign='', method=self.createGame) # args: room_jid, players, profile host.bridge.addMethod("tarotGameReady", ".plugin", in_sign='sss', out_sign='', method=self.playerReady) # args: player, referee, profile host.bridge.addMethod("tarotGamePlayCards", ".plugin", in_sign='ssa(ss)s', out_sign='', method=self.play_cards) # args: player, referee, cards, profile