Mercurial > libervia-backend
comparison src/plugins/plugin_misc_tarot.py @ 362:208107419b17
Quiz game: buzzer, timer, answer management
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 12 Jun 2011 22:34:15 +0200 |
parents | 141eeb7cd9e6 |
children | f964dcec1611 |
comparison
equal
deleted
inserted
replaced
361:141eeb7cd9e6 | 362:208107419b17 |
---|---|
734 #nothing left on the table | 734 #nothing left on the table |
735 for player in game_data['players']: | 735 for player in game_data['players']: |
736 players_data[player]['played'] = None | 736 players_data[player]['played'] = None |
737 if len(game_data['hand'][current_player]) == 0: | 737 if len(game_data['hand'][current_player]) == 0: |
738 #no card lef: the game is finished | 738 #no card lef: the game is finished |
739 to_jid = jid.JID(room_jid.userhost()) #FIXME: gof: | 739 to_jid = room_jid |
740 mess = self.createGameElt(to_jid) | 740 mess = self.createGameElt(to_jid) |
741 chien_elt = mess.firstChildElement().addChild(self.__give_scores(*self.__calculate_scores(game_data))) | 741 chien_elt = mess.firstChildElement().addChild(self.__give_scores(*self.__calculate_scores(game_data))) |
742 self.host.profiles[profile].xmlstream.send(mess) | 742 self.host.profiles[profile].xmlstream.send(mess) |
743 game_data['init_player'] = (game_data['init_player'] + 1) % len(game_data['players']) #we change the dealer | 743 game_data['init_player'] = (game_data['init_player'] + 1) % len(game_data['players']) #we change the dealer |
744 for player in game_data['players']: | 744 for player in game_data['players']: |
748 next_player = game_data['first_player'] = self.__next_player(game_data, winner) | 748 next_player = game_data['first_player'] = self.__next_player(game_data, winner) |
749 else: | 749 else: |
750 next_player = self.__next_player(game_data) | 750 next_player = self.__next_player(game_data) |
751 | 751 |
752 #finally, we tell to the next player to play | 752 #finally, we tell to the next player to play |
753 to_jid = jid.JID(room_jid.userhost()+"/"+next_player) #FIXME: gof: | 753 to_jid = jid.JID(room_jid.userhost()+"/"+next_player) |
754 mess = self.createGameElt(to_jid) | 754 mess = self.createGameElt(to_jid) |
755 yourturn_elt = mess.firstChildElement().addElement('your_turn') | 755 yourturn_elt = mess.firstChildElement().addElement('your_turn') |
756 self.host.profiles[profile].xmlstream.send(mess) | 756 self.host.profiles[profile].xmlstream.send(mess) |
757 | 757 |
758 elif elt.name == 'your_turn': | 758 elif elt.name == 'your_turn': |