Mercurial > libervia-backend
comparison src/plugins/plugin_misc_tarot.py @ 372:f964dcec1611
core: plugins refactored according to bridge + updatedValue now use profile
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 06 Jul 2011 01:06:18 +0200 |
parents | 208107419b17 |
children | cf005701624b |
comparison
equal
deleted
inserted
replaced
371:3ea41a199b36 | 372:f964dcec1611 |
---|---|
63 info(_("Plugin Tarot initialization")) | 63 info(_("Plugin Tarot initialization")) |
64 self.host = host | 64 self.host = host |
65 self.games={} | 65 self.games={} |
66 self.waiting_inv = {} #Invitation waiting for people to join to launch a game | 66 self.waiting_inv = {} #Invitation waiting for people to join to launch a game |
67 self.contrats = [_('Passe'), _('Petite'), _('Garde'), _('Garde Sans'), _('Garde Contre')] | 67 self.contrats = [_('Passe'), _('Petite'), _('Garde'), _('Garde Sans'), _('Garde Contre')] |
68 host.bridge.addMethod("tarotGameLaunch", ".communication", in_sign='ass', out_sign='', method=self.launchGame) #args: room_jid, players, profile | 68 host.bridge.addMethod("tarotGameLaunch", ".plugin", in_sign='ass', out_sign='', method=self.launchGame) #args: room_jid, players, profile |
69 host.bridge.addMethod("tarotGameCreate", ".communication", in_sign='sass', out_sign='', method=self.createGame) #args: room_jid, players, profile | 69 host.bridge.addMethod("tarotGameCreate", ".plugin", in_sign='sass', out_sign='', method=self.createGame) #args: room_jid, players, profile |
70 host.bridge.addMethod("tarotGameReady", ".communication", in_sign='sss', out_sign='', method=self.newPlayerReady) #args: player, referee, profile | 70 host.bridge.addMethod("tarotGameReady", ".plugin", in_sign='sss', out_sign='', method=self.newPlayerReady) #args: player, referee, profile |
71 host.bridge.addMethod("tarotGameContratChoosed", ".communication", in_sign='ssss', out_sign='', method=self.contratChoosed) #args: player, referee, contrat, profile | 71 host.bridge.addMethod("tarotGameContratChoosed", ".plugin", in_sign='ssss', out_sign='', method=self.contratChoosed) #args: player, referee, contrat, profile |
72 host.bridge.addMethod("tarotGamePlayCards", ".communication", in_sign='ssa(ss)s', out_sign='', method=self.play_cards) #args: player, referee, cards, profile | 72 host.bridge.addMethod("tarotGamePlayCards", ".plugin", in_sign='ssa(ss)s', out_sign='', method=self.play_cards) #args: player, referee, cards, profile |
73 host.bridge.addSignal("tarotGameStarted", ".communication", signature='ssass') #args: room_jid, referee, players, profile | 73 host.bridge.addSignal("tarotGameStarted", ".plugin", signature='ssass') #args: room_jid, referee, players, profile |
74 host.bridge.addSignal("tarotGameNew", ".communication", signature='sa(ss)s') #args: room_jid, hand, profile | 74 host.bridge.addSignal("tarotGameNew", ".plugin", signature='sa(ss)s') #args: room_jid, hand, profile |
75 host.bridge.addSignal("tarotGameChooseContrat", ".communication", signature='sss') #args: room_jid, xml_data, profile | 75 host.bridge.addSignal("tarotGameChooseContrat", ".plugin", signature='sss') #args: room_jid, xml_data, profile |
76 host.bridge.addSignal("tarotGameShowCards", ".communication", signature='ssa(ss)a{ss}s') #args: room_jid, type ["chien", "poignée",...], cards, data[dict], profile | 76 host.bridge.addSignal("tarotGameShowCards", ".plugin", signature='ssa(ss)a{ss}s') #args: room_jid, type ["chien", "poignée",...], cards, data[dict], profile |
77 host.bridge.addSignal("tarotGameCardsPlayed", ".communication", signature='ssa(ss)s') #args: room_jid, player, type ["chien", "poignée",...], cards, data[dict], profile | 77 host.bridge.addSignal("tarotGameCardsPlayed", ".plugin", signature='ssa(ss)s') #args: room_jid, player, type ["chien", "poignée",...], cards, data[dict], profile |
78 host.bridge.addSignal("tarotGameYourTurn", ".communication", signature='ss') #args: room_jid, profile | 78 host.bridge.addSignal("tarotGameYourTurn", ".plugin", signature='ss') #args: room_jid, profile |
79 host.bridge.addSignal("tarotGameScore", ".communication", signature='ssasass') #args: room_jid, xml_data, winners (list of nicks), loosers (list of nicks), profile | 79 host.bridge.addSignal("tarotGameScore", ".plugin", signature='ssasass') #args: room_jid, xml_data, winners (list of nicks), loosers (list of nicks), profile |
80 host.bridge.addSignal("tarotGameInvalidCards", ".communication", signature='ssa(ss)a(ss)s') #args: room_jid, game phase, played_cards, invalid_cards, profile | 80 host.bridge.addSignal("tarotGameInvalidCards", ".plugin", signature='ssa(ss)a(ss)s') #args: room_jid, game phase, played_cards, invalid_cards, profile |
81 host.trigger.add("MUC user joined", self.userJoinedTrigger) | 81 host.trigger.add("MUC user joined", self.userJoinedTrigger) |
82 self.deck_ordered = [] | 82 self.deck_ordered = [] |
83 for value in ['excuse']+map(str,range(1,22)): | 83 for value in ['excuse']+map(str,range(1,22)): |
84 self.deck_ordered.append(TarotCard(("atout",value))) | 84 self.deck_ordered.append(TarotCard(("atout",value))) |
85 for suit in ["pique", "coeur", "carreau", "trefle"]: | 85 for suit in ["pique", "coeur", "carreau", "trefle"]: |