Example #1
0
    def process(self):
        def by_trophy(plr):
            return plr['trophies']

        players = DataBase.getAllPlayers(self)
        players.sort(key=by_trophy, reverse=True)
        FriendListMessage(self.client, self.player, players).send()
    def process(self):
        if self.type == 1:

            def by_trophy(plr):
                return plr['trophies']

            players = DataBase.getAllPlayers(self)
            players.sort(key=by_trophy, reverse=True)

            if self.is_local == 1 or self.type == 0:
                GetLeaderboardLocalOkMessage(self.client, self.player,
                                             players).send()
            else:
                GetLeaderboardGlobalOkMessage(self.client, self.player,
                                              players).send()

        elif self.type == 2:
            if self.is_local == 1:
                GetLeaderboardClubLocalOkMessage(self.client, self.player,
                                                 self.type).send()
            else:
                GetLeaderboardClubGlobalOkMessage(self.client, self.player,
                                                  self.type).send()
 def process(self):
     self.players = DataBase.getAllPlayers(self)
     if self.high_id == 0:
         PlayerProfileMessage(self.client, self.player, self.high_id,
                              self.low_id, self.players).send()