def get_rebirth_ranking_by_job_id(self, job_id, number_of_players=5, show_gm=False): """Fetches the top ranking players (by class) in terms of rebirths Uses Lazuli::get_db_all_hits to query, and utility.extract_name_and_value to process the data. Searches based on specific job IDs. Args: show_gm: Optional; Add GMs (Game Masters) to the list of rankings job_id: Int, representing specific Job ID to query number_of_players: Optional; Int e.g. Top 5 Ranking (default), Top 10 Ranking, etc. Returns: List of Tuples, representing player names and their corresponding rebirths """ if show_gm: prepared_statement = ( f"SELECT * FROM `characters` WHERE `job`={job_id} ORDER BY " f"`reborns`DESC LIMIT {number_of_players}") else: prepared_statement = ( f"SELECT * FROM `characters` WHERE `job`={job_id} AND `gm` < 1 " f"ORDER BY `reborns` DESC LIMIT {number_of_players}") player_data = self.get_db_all_hits(prepared_statement) return utils.extract_name_and_value(player_data, "reborns")
def get_rebirth_ranking(self, number_of_players=5, show_gm=False): """Fetches the top ranking players in terms of rebirths Uses Lazuli::get_db_all_hits to query, and utility.extract_name_and_value to process the data. Args: show_gm: Optional; Add GMs (Game Masters) to the list of rankings number_of_players: Optional; Int e.g. Top 5 Ranking (default), Top 10 Ranking, etc. Returns: List of Tuples, representing player names and their corresponding rebirths """ if show_gm: prepared_statement = ( f"SELECT * FROM `characters` ORDER BY `reborns` DESC " f"LIMIT {number_of_players}") else: prepared_statement = ( f"SELECT * FROM `characters` WHERE `gm` < 1 ORDER BY `reborns` " f"DESC LIMIT {number_of_players}") player_data = self.get_db_all_hits(prepared_statement) return utils.extract_name_and_value(player_data, "reborns")