Пример #1
0
    def encode(self):
        DataBase.CountClub(self, 1, 100, 2, 30)
        self.writeString(self.requestedName)
        self.writeVint(self.count)

        for i in self.club_list:
            if self.requestedName.lower() in self.club_data[self.club_list.index(i)]['name'].lower():
                DataBase.loadClub(self, i)
                self.writeInt(0)  # ClubHighID
                self.writeInt(i)  # ClubLowID
                self.writeString(self.clubName)  # Club name

                self.writeVint(8)  # BadgeID type
                self.writeVint(self.clubbadgeID)  # Club badge number

                self.writeVint(self.clubtype)  # Club type

                self.writeVint(self.clubmembercount)  # Member count

                self.writeVint(self.clubtrophies)  # Trophies total
                self.writeVint(self.clubtrophiesneeded)  # Trophies needed
                self.writeVint(0)  # Unknown

                self.writeString(self.clubregion)  # Region
                self.writeVint(self.clubmembercount)  # Members online
                self.writeVint(self.clubfriendlyfamily)  # Family friendly
    def encode(self):
        DataBase.CountClub(self, 1, 100, 2, 50)

        self.writeVint(self.AllianceCount)

        for i in self.club_list:
            DataBase.loadClub(self, i)
            self.writeInt(0)  # ClubHighID
            self.writeInt(i)  # ClubLowID
            self.writeString(self.clubName)  # Club name

            self.writeVint(8)  # BadgeID type
            self.writeVint(self.clubbadgeID)  # Club badge number

            self.writeVint(self.clubtype)  # Club type

            self.writeVint(self.clubmembercount)  # Member count

            self.writeVint(self.clubtrophies)  # Trophies total
            self.writeVint(self.clubtrophiesneeded)  # Trophies needed
            self.writeVint(0)  # Unknown

            self.writeString(self.clubregion)  # Region
            self.writeVint(self.clubmembercount)  # Members online
            self.writeVint(self.clubfriendlyfamily)  # Family friendly
Пример #3
0
 def process(self):
     DataBase.CountClub(self, 1, 100, 2, 30)
     self.AllianceCount = 0
     for i in self.club_list:
         if self.RequestedName.lower() in self.club_data[
                 self.club_list.index(i)]['name'].lower():
             self.AllianceCount += 1
     AllianceSearchResultMessage(self.client, self.player,
                                 self.RequestedName,
                                 self.AllianceCount).send()
Пример #4
0
    def encode(self):
        self.indexOfClub = 0
        self.writeVint(2)
        self.writeVint(0)
        self.writeVint(0)
        self.writeString(self.player.region)  # Player Region

        DataBase.CountClub(self, 1, 100, 2, 200)

        def by_trophy(club):
            print(club)
            return club['trophies']

        self.writeVint(self.AllianceCount)
        self.club_data.sort(key=by_trophy, reverse=True)

        for club in self.club_data:
            if club["clubID"] == self.player.club_low_id:
                self.indexOfClub = self.club_data.index(club) + 1
            DataBase.loadClub(self, club['clubID'])
            self.writeVint(0)  # Club High ID
            self.writeVint(club['clubID'])  # Club Low ID

            self.writeVint(1)
            self.writeVint(self.clubtrophies)  # Club Trophies
            self.writeVint(2)

            self.writeString(self.clubName)  # Club Name
            self.writeVint(self.clubmembercount)  # Club Members Count

            self.writeVint(8)  # Club Badge
            self.writeVint(self.clubbadgeID)  # Club Name Color

        self.writeVint(0)
        self.writeVint(self.indexOfClub)  # Index of the club
        self.writeVint(0)
        self.writeVint(0)
        self.writeString(self.player.region)
Пример #5
0
    def encode(self):
        self.writeVint(2)
        self.writeVint(0)
        self.writeVint(0)
        self.writeString()

        DataBase.CountClub(self, 1, 100, 2, 200)

        def by_trophy(club):
            print(club)
            return club['trophies']

        self.writeVint(self.AllianceCount)
        self.club_data.sort(key=by_trophy, reverse=True)

        for club in self.club_data:
            DataBase.loadClub(self, club['clubID'])
            self.writeVint(0)  # Club High ID
            self.writeVint(club['clubID'])  # Club Low ID

            self.writeVint(1)
            self.writeVint(self.clubtrophies)  # Club Trophies
            self.writeVint(2)

            self.writeString(self.clubName)  # Club Name
            self.writeVint(self.clubmembercount)  # Club Members Count

            self.writeVint(8)  # Club Badge
            self.writeVint(self.clubbadgeID)  # Club Name Color

        self.writeVint(0)
        self.writeVint(0)
        self.writeVint(0)
        self.writeVint(0)

        self.writeString("RO")