Skip to content

Ranking

Highscore lists and leaderboards behind client.ranking.

ranking.service

Highscore lists and event leaderboards.

Classes:

Name Description
RankingService

Highscore lists and event leaderboards.

Attributes:

Name Type Description
logger

logger module-attribute

logger = logging.getLogger(__name__)

RankingService

RankingService(client: 'EmpireClient')

Bases: BaseService

Highscore lists and event leaderboards.

Methods:

Name Description
get_highscore

Search for a highscore entry (e.g. player rank).

get_ranking_list

Get a page of an event leaderboard, from a rank.

get_own_ranking_page

Get the page of an event leaderboard that holds your own score.

get_ranking_window

Get the page of an event leaderboard around a score, e.g. a search hit.

search_leaderboard

Search an event leaderboard for a name.

get_colossus_highscore

Get colossus donors around a name or rank; -1 selects your own page.

get_season_info

Request the current season's division, medals and passes.

get_season_ranks

Request your current season and season-event ranks.

get_highscore

get_highscore(list_type: RankingType, search_value: str, league_type_id: LeagueTypeId = -1, *, timeout: float = 5.0) -> list[HighscoreRow]

Search for a highscore entry (e.g. player rank).

Parameters:

Name Type Description Default
list_type RankingType

The highscore list (LT)

required
search_value str

Name to search for, a rank as text, or "-1" for your own rank

required
league_type_id LeagueTypeId

League type id (LID); -1 for none, the client default

-1
timeout float

Timeout in seconds

5.0

Returns:

Type Description
list[HighscoreRow]

The page's rows, each in its list's layout (see HIGHSCORE_ROW_LAYOUTS)

Note: 'hgh' is shared with the alliance-search command. Requests for it run one at a time, but after one times out its late reply can be taken by the next, a search_alliances() call included: the reply's LT and LID need not be the ones asked for, so no reply is refused on them (see GetHighscoreRequest).

get_ranking_list

get_ranking_list(list_type: RankingType, rank: int, max_results: int, league_type_id: LeagueTypeId, sub_division_id: int | None = None, event_id: Event | None = None, *, timeout: float = 5.0) -> list[LeaderboardScore]

Get a page of an event leaderboard, from a rank.

Only works while the list's event runs: the client sends llsp only from event leaderboards, and a live server answered NO_EVENT (145) for every list with no event running, the regular highscore lists included (use get_highscore for those).

Parameters:

Name Type Description Default
list_type RankingType

The event's highscore list (LT), e.g. RankingType.GRAND_NOBILITY_PRIZE

required
rank int

The first rank on the page

required
max_results int

Entries per page (M)

required
league_type_id LeagueTypeId

The league (LID): the league of the event whose leaderboard it is, as its sei entry names it (client.events.league_id(event_id)), or another of its leagues 1 to its league count; -1 only for the donation ranking. The client pairs RankingType.GRAND_NOBILITY_PRIZE (53) with event 83 (LongtermPointEventGlobalLeaderBoardDialog, bundle line 100411); the other dialogs are given their event

required
sub_division_id int | None

The alliance event subdivision (SDI), for an alliance event's subdivision ranking

None
event_id Event | None

The alliance Grand Tournament or raid event (EID), for those events' rankings

None
timeout float

Timeout in seconds

5.0

Returns:

Type Description
list[LeaderboardScore]

List of entries from that rank

Raises:

Type Description
CommandError

NO_EVENT (145) when the list's event is not running

Client: LeaderBoardDataProvider (bundle line 75933), built only by GlobalLeaderBoardComponent.init (bundle line 34989) for event leaderboard dialogs

get_own_ranking_page

get_own_ranking_page(list_type: RankingType, max_results: int, league_type_id: LeagueTypeId, sub_division_id: int | None = None, event_id: Event | None = None, *, timeout: float = 5.0) -> list[LeaderboardScore]

Get the page of an event leaderboard that holds your own score.

Parameters:

Name Type Description Default
list_type RankingType

The event's highscore list (LT)

required
max_results int

Entries per page (M)

required
league_type_id LeagueTypeId

The league (LID), as for get_ranking_list: the event's league, client.events.league_id(event_id)

required
sub_division_id int | None

The alliance event subdivision (SDI), as for get_ranking_list

None
event_id Event | None

The alliance Grand Tournament or raid event (EID), as for get_ranking_list

None
timeout float

Timeout in seconds

5.0

Returns:

Type Description
list[LeaderboardScore]

The entries on your page

Raises:

Type Description
CommandError

a live server refused a Grand Nobility Prize list's own page with league -1 (GENERAL_ERROR, 1) and answered it with the event's league

Client: LeaderBoardDataProvider.getCurrentPlayerPage (bundle line 75941)

get_ranking_window

get_ranking_window(list_type: RankingType, score_id: str, max_results: int, league_type_id: LeagueTypeId | None, sub_division_id: int | None = None, event_id: Event | None = None, *, timeout: float = 5.0) -> list[LeaderboardScore]

Get the page of an event leaderboard around a score, e.g. a search hit.

Parameters:

Name Type Description Default
list_type RankingType

The event's highscore list (LT)

required
score_id str

A score id from search_leaderboard (SI); empty for your own page

required
max_results int

Entries per page (M)

required
league_type_id LeagueTypeId | None

The league the score is in (LID): the search result's league_type_id, or for your own page (empty score_id) the event's league, as for get_ranking_list

required
sub_division_id int | None

The alliance event subdivision (SDI), as for get_ranking_list

None
event_id Event | None

The alliance Grand Tournament or raid event (EID), as for get_ranking_list

None
timeout float

Timeout in seconds

5.0

Returns:

Type Description
list[LeaderboardScore]

The entries on that page

Client: LeaderBoardDataProvider.getCurrentSearchPage (bundle line 75943)

search_leaderboard

search_leaderboard(list_type: RankingType, search_value: str, sub_division_id: int | None = None, event_id: Event | None = None, *, timeout: float = 5.0) -> list[LeaderboardSearchResult]

Search an event leaderboard for a name.

Page to a hit with get_ranking_window, passing its league_type_id and one of its score_ids; the client pages to the first hit, or to your own page when there is none. The search itself takes no league: C2SSearchLeaderboardScoresEventVO sends only LT and SV, and the answer groups the hits by league.

Parameters:

Name Type Description Default
list_type RankingType

The event's highscore list (LT)

required
search_value str

The name to search for (SV); must not be empty

required
sub_division_id int | None

The alliance event subdivision (SDI), as for get_ranking_list

None
event_id Event | None

The alliance Grand Tournament or raid event (EID), as for get_ranking_list

None
timeout float

Timeout in seconds

5.0

Returns:

Type Description
list[LeaderboardSearchResult]

The matching score ids, grouped by league

Raises:

Type Description
ValueError

For an empty search, which the client never sends

Client: LeaderBoardDataProvider.searchLeaderBoard (bundle line 75942), onSearchDataReceived (bundle line 75952)

get_colossus_highscore

get_colossus_highscore(search_value: str = '-1', *, timeout: float = 5.0) -> GetColossusHighscoreResponse

Get colossus donors around a name or rank; -1 selects your own page.

Points remain donation units: the client multiplies them by .01, or .01093 for coin colossus. This command names no event; the server selects the running colossus. Refusals raise CommandError. Client: C2SColossusGetHighscoreVO (bundle 59205), parse_CHE (139783-139790).

get_season_info

get_season_info(*, timeout: float = 5.0) -> GetSeasonInfoResponse

Request the current season's division, medals and passes.

Client: SeasonLeagueServer.requestKLI and parseKLI (bundle 142652-142671).

get_season_ranks

get_season_ranks(*, timeout: float = 5.0) -> tuple[SeasonHighscoreRank, ...]

Request your current season and season-event ranks.

Season board pages use get_highscore with KINGDOMS_LEAGUE_SEASON or KINGDOMS_LEAGUE_SEASON_EVENT. Client: SeasonLeagueServer.requestKLH and parseKLH (bundle 142672-142682).

ranking.models

Highscore and leaderboard models.

Commands:

  • hgh: A page of a highscore list, around a rank or a searched name
  • llsp: A page of an event leaderboard, from a rank
  • llsw: A page of an event leaderboard, around a score or your own rank
  • slse: Search an event leaderboard for a name

Classes:

Name Description
HighscoreAlliance

An alliance on a highscore list: [alliance_id, name, member_count, glory points].

HighscorePlayerRow

A player's row: [rank, score, owner_record, display_name?, shown_rank?], or [rank, owner_record]

HighscoreAllianceRow

An alliance's row: [rank, score, alliance].

HighscoreStormIslandsRow

A Storm Islands alliance row: [is_storm_lord, rank, score, alliance].

HighscoreTournamentRow

A tournament row: [rank, score, player_id, player_name], with no owner record.

GetHighscoreRequest

A page of a highscore list, around a rank or a searched name.

GetHighscoreResponse

A page of a highscore list, the reply to hgh.

GetRankingListRequest

A page of an event leaderboard, starting at a rank.

GetRankingWindowRequest

A page of an event leaderboard around a score, or around your own rank.

SearchRankingListRequest

Search an event leaderboard for a name.

LeaderboardScore

One entry of an event leaderboard page: an entry of llsp's L.

GetRankingListResponse

A page of an event leaderboard, the reply to llsp.

GetRankingWindowResponse

A page of an event leaderboard around a score, the reply to llsw.

LeaderboardSearchResult

The scores that matched a search in one league: an entry of slse's L.

SearchRankingListResponse

The scores that matched a leaderboard search, the reply to slse.

Attributes:

Name Type Description
logger
LeagueTypeId

A league's LID: a LeagueType, or -1 for none.

HighscoreRow

One row of a hgh reply; HIGHSCORE_ROW_LAYOUTS and the row's shape pick which.

HIGHSCORE_ROW_LAYOUTS dict[int, _RowModel]

The lists whose rows have a layout of their own.

logger module-attribute

logger = logging.getLogger(__name__)

LeagueTypeId module-attribute

LeagueTypeId = Annotated[Literal[-1] | EnumOrInt['LeagueType'], Field(union_mode='left_to_right')]

A league's LID: a LeagueType, or -1 for none.

Client: CastleHighscoreDialog.setLeagueTitleById (bundle line 27528) titles only an id above 0

HighscoreRow module-attribute

One row of a hgh reply; HIGHSCORE_ROW_LAYOUTS and the row's shape pick which.

HIGHSCORE_ROW_LAYOUTS module-attribute

HIGHSCORE_ROW_LAYOUTS: dict[int, _RowModel] = {RankingType.ALLIANCE_CARGO_POINTS: HighscoreStormIslandsRow, RankingType.TOURNAMENT_FAME: HighscoreTournamentRow}

The lists whose rows have a layout of their own.

Every other list's row is an alliance's when its third entry is an array, else a player's, as SeasonLeagueMainDialogRanksItem tells them apart (bundle lines 91889, 91908); the other dialogs each read one of those two layouts.

HighscoreAlliance pydantic-model

Bases: BasePayload

An alliance on a highscore list: [alliance_id, name, member_count, glory points].

Client: AllianceHighscoreInfoVO.fillFromParamObject (bundle line 27680), which reads nothing from a value that is not an array

Fields:

Validators:

  • _from_row
  • _text → name

alliance_id pydantic-field

alliance_id: ClientInt = 0

Alliance id

name pydantic-field

name: str = ''

Alliance name

member_count pydantic-field

member_count: ClientInt = 0

Number of members

glory_points pydantic-field

glory_points: ClientInt = 0

The alliance's current glory points

HighscorePlayerRow pydantic-model

Bases: BasePayload

A player's row: [rank, score, owner_record, display_name?, shown_rank?], or [rank, owner_record] without a score.

Client: CastleHighscoreDialog.onGetHighscoreData (bundle lines 27559-27568), CastleGenericHighscoreDialog.onGetHighscoreData (bundle lines 30827-30836), CastleSingleplayerRankingItem.update (bundle line 91695) for the row without a score, TempServerEventDialogRankingItem.updateWithNewData (bundle lines 118343-118344) for the display name and the shown rank, which 0 leaves at rank

Fields:

Validators:

  • _from_row
  • _owner → owner

rank pydantic-field

rank: ClientInt = 0

Rank on the list

score pydantic-field

score: ClientInt = 0

The listed value; 0 on a row without one

owner pydantic-field

owner: MapObject | None = None

The player's owner record; None when unreadable

display_name pydantic-field

display_name: str | None = None

The name the Outer Realms lists show; None when the row has none

shown_rank pydantic-field

shown_rank: int | None = None

The rank the previous-run and Outer Realms lists show; None to show rank

HighscoreAllianceRow pydantic-model

Bases: BasePayload

An alliance's row: [rank, score, alliance].

Client: CastleHighscoreDialog.onGetHighscoreData (bundle lines 27541-27558), CastleAllianceRankingItem.update (bundle line 91645), the generic alliance highscore dialog (bundle lines 38131-38134)

Fields:

Validators:

rank pydantic-field

rank: ClientInt = 0

Rank on the list

score pydantic-field

score: ClientInt = 0

The listed value

alliance pydantic-field

The alliance

HighscoreStormIslandsRow pydantic-model

Bases: HighscoreAllianceRow

A Storm Islands alliance row: [is_storm_lord, rank, score, alliance].

Client: CastleEilandAllianceRankingItem.update (bundle lines 98076-98079), shown for HighscoreConst.ALLIANCE_CARGO_POINTS (bundle line 98052)

Fields:

Validators:

is_storm_lord pydantic-field

is_storm_lord: bool = False

The alliance holds the Storm Islands

HighscoreTournamentRow pydantic-model

Bases: BasePayload

A tournament row: [rank, score, player_id, player_name], with no owner record.

Client: ACastleTournamentRankListItem.parseItemData (bundle line 59120), CastleTournamentRankListItem.parseItemData (bundle line 118660)

Fields:

Validators:

rank pydantic-field

rank: ClientInt = 0

Rank on the list

score pydantic-field

score: ClientInt = 0

Tournament points

player_id pydantic-field

player_id: ClientInt = 0

The player's id

player_name pydantic-field

player_name: str = ''

The player's name

GetHighscoreRequest pydantic-model

Bases: BaseRequest

A page of a highscore list, around a rank or a searched name.

Payload: {"LT": list_type, "LID": league_type_id, "SV": search_value}

The keys follow the client's order: the constructor initialises LT and LID before it sets SV, which it encodes as it encodes any text it sends.

The reply carries LT and LID, but not always the ones asked for, so no reply is refused on them: the highscore dialog switches to the list and league the reply names (CastleHighscoreDialog.onGetHighscoreData, bundle lines 27533-27535), and offers the legend list (7) only in the level-cap league, falling back to honor (5) elsewhere (setLeague, bundle line 27482; switchOverallCategory, bundle lines 27506-27519). A live server answered LT 7 around your own rank ("-1", LID -1) for a league-1 player with LT 5 and LID 1.

Client: C2SGetHighscoreVO (bundle line 14674)

Fields:

list_type pydantic-field

list_type: RankingType

Wire key LT

The highscore list

league_type_id pydantic-field

league_type_id: LeagueTypeId = -1

Wire key LID

The league, a level band (see GameData.league_type); -1 for none

search_value pydantic-field

search_value: str

Wire key SV

A name, or a rank as text; "-1" asks for the page around your own rank

GetHighscoreResponse pydantic-model

Bases: BaseResponse

A page of a highscore list, the reply to hgh.

The client has no row parser of its own: each dialog reads the rows in its list's layout, so the rows are read by HIGHSCORE_ROW_LAYOUTS and their shape.

Client: HGHCommand.executeCommand (bundle line 124377)

Fields:

Validators:

list_type pydantic-field

list_type: int | None = None

Wire key LT

league_type_id pydantic-field

league_type_id: LeagueTypeId = -1

Wire key LID

League type id; -1 for none

last_rank pydantic-field

last_rank: int | None = None

Wire key LR

search_value pydantic-field

search_value: str | None = None

Wire key SV

rows pydantic-field

rows: tuple[HighscoreRow, ...] = ()

Wire key L

The page's rows, in the list's layout

GetRankingListRequest pydantic-model

Bases: BaseRequest

A page of an event leaderboard, starting at a rank.

Payload: {"LT": list_type, "LID": league_type_id, "M": max_results, "R": rank}

The client pages only event leaderboards this way (score, long-term point, alliance Grand Tournament/raid and donation events), and always with a league: LeaderBoardDataProvider sends the league it was built with on every page. The score and long-term point dialogs build it with the event's league, the LID of the event's sei entry, and page through leagues 1 to the event's league count (GlobalLeaderBoardLeagueComponent, bundle line 100470; AScoreEventVO.parseBasicsFromParamObject, bundle line 14967); the alliance Grand Tournament dialog passes the event's league (bundle line 47284); only the donation ranking passes none, so -1 (bundle line 115740). A live server answered NO_EVENT (145) for every list with no event running, the regular highscore lists included; read those with hgh.

Client: C2SListLeaderboardScoresPageVO (bundle line 76002), sent by LeaderBoardDataProvider (bundle line 75933), which only GlobalLeaderBoardComponent.init (bundle line 34989) builds, for ScoreEventGlobalLeaderBoardDialog and LongtermPointEventGlobalLeaderBoardDialog (AGlobalLeaderBoardDialog.showLoaded, bundle line 100442), AllianceMobilizationEventDialogLeaderboard.show (bundle line 47278) and DonationEventDialogRanking (bundle line 115737)

The alliance Grand Tournament and raid leaderboards also send SDI and EID: LeaderBoardDataProvider.sendCommand (bundle line 75949) copies the {SDI, EID} (subdivision tab) or {EID} (division tab) that AllianceMobilizationEventDialogRanking.switchTab (bundle line 75910) and AllianceRaidEventRankingDialog.switchTab (bundle line 75633) show the leaderboard with onto every request, after the VO's own keys.

Fields:

list_type pydantic-field

list_type: RankingType

Wire key LT

The highscore list

league_type_id pydantic-field

league_type_id: LeagueTypeId

Wire key LID

The event's league, a level band (see GameData.league_type); -1 for the donation ranking

max_results pydantic-field

max_results: int

Wire key M

Entries per page

rank pydantic-field

rank: int = 1

Wire key R

The first rank on the page

sub_division_id pydantic-field

sub_division_id: int | None = None

Wire key SDI

The alliance event subdivision, for its subdivision ranking

event_id pydantic-field

event_id: EnumOrInt['Event'] | None = None

Wire key EID

The alliance Grand Tournament or raid event

accepts_reply

accepts_reply(payload: Any) -> bool

Whether a reply is for this request, as the client tells.

A reply is refused only when its LT is another list and its league (LID, or -1 without one) is the one asked for; a reply for another list in another league is taken, as the client takes it.

Client: LeaderBoardDataProvider.onScoreDataReceived (bundle line 75957), which then adopts the reply's LID

GetRankingWindowRequest pydantic-model

Bases: BaseRequest

A page of an event leaderboard around a score, or around your own rank.

Payload: {"LT": list_type, "LID": league_type_id, "M": max_results, "SI": score_id}

SI is a score id from a slse search result, or empty for the page holding your own score; the client encodes it as it encodes any text it sends. The reply is shaped like llsp's. LID, SDI and EID are sent as for llsp: your own page goes with the event's league, a search hit's page with the hit's league. A live server refused a Grand Nobility Prize list's own page with league -1 (GENERAL_ERROR, 1) and answered it with the event's league.

Client: C2SListLeaderboardScoresWindowVO (bundle line 76012), sent by LeaderBoardDataProvider.getCurrentPlayerPage (bundle line 75941) with no score id and getCurrentSearchPage (bundle line 75943) with a search result's league and score id

Fields:

list_type pydantic-field

list_type: RankingType

Wire key LT

The highscore list

league_type_id pydantic-field

league_type_id: LeagueTypeId | None

Wire key LID

The event's league, or a search hit's, a level band (see GameData.league_type); -1 for the donation ranking, None for a hit without one

max_results pydantic-field

max_results: int

Wire key M

Entries per page

score_id pydantic-field

score_id: str = ''

Wire key SI

The score to page around, from a search result; empty for your own

sub_division_id pydantic-field

sub_division_id: int | None = None

Wire key SDI

The alliance event subdivision, for its subdivision ranking

event_id pydantic-field

event_id: EnumOrInt['Event'] | None = None

Wire key EID

The alliance Grand Tournament or raid event

accepts_reply

accepts_reply(payload: Any) -> bool

Whether a reply is for this request, as the client tells.

A reply is refused only when its LT is another list and its league (LID, or -1 without one) is the one asked for; a reply for another list in another league is taken, as the client takes it.

Client: LeaderBoardDataProvider.onScoreDataReceived (bundle line 75957), which then adopts the reply's LID

SearchRankingListRequest pydantic-model

Bases: BaseRequest

Search an event leaderboard for a name.

Payload: {"LT": list_type, "SV": search_value}

The client encodes SV as it encodes any text it sends, and sends nothing for an empty search. It then pages to the first hit with llsw, or to your own page when there is none. SDI and EID are sent as for llsp.

Client: C2SSearchLeaderboardScoresEventVO (bundle line 76022), sent by LeaderBoardDataProvider.searchLeaderBoard (bundle line 75942)

Fields:

list_type pydantic-field

list_type: RankingType

Wire key LT

The highscore list

search_value pydantic-field

search_value: str

Wire key SV

The name to search for

sub_division_id pydantic-field

sub_division_id: int | None = None

Wire key SDI

The alliance event subdivision, for its subdivision ranking

event_id pydantic-field

event_id: EnumOrInt['Event'] | None = None

Wire key EID

The alliance Grand Tournament or raid event

accepts_reply

accepts_reply(payload: Any) -> bool

Whether a reply is for this list: its LT, when sent, is the one asked for.

Client: LeaderBoardDataProvider.onSearchDataReceived (bundle line 75953) skips a reply only when its LT differs and the dialog's league is the reply's LID or -1. The search sends no league, so the library cannot tell the dialog's and refuses any other LT.

LeaderboardScore pydantic-model

Bases: BasePayload

One entry of an event leaderboard page: an entry of llsp's L.

Client: AGlobalLeaderBoardItem getters (bundle lines 47303-47316) and LeaderBoardDataProvider.onScoreDataReceived (bundle line 75957).

Fields:

Validators:

  • _getters_guard_every_key

rank pydantic-field

rank: ClientInt = -1

Wire key R

Rank on the list

score pydantic-field

score: int | float = -1

Wire key S

Points

player_name pydantic-field

player_name: str = ''

Wire key P

Player name

alliance_name pydantic-field

alliance_name: str = ''

Wire key A

Alliance name, empty without one

instance_id pydantic-field

instance_id: ClientInt | None = None

Wire key I

Game server (instance) the player is on

score_id pydantic-field

score_id: int | str | None = None

Wire key SI

Paging key that search results are matched against; not an owner id

GetRankingListResponse pydantic-model

Bases: BaseResponse

A page of an event leaderboard, the reply to llsp.

Client: LLSPCommand.executeCommand (bundle line 124397), LeaderBoardDataProvider.onScoreDataReceived (bundle line 75957).

Fields:

Validators:

list_type pydantic-field

list_type: int | None = None

Wire key LT

league_type_id pydantic-field

league_type_id: LeagueTypeId | None = None

Wire key LID

League type id; -1 for the donation ranking, None for none

scores pydantic-field

Wire key L

The page's entries

total pydantic-field

total: int = 0

Wire key T

Number of scores on the whole list

GetRankingWindowResponse pydantic-model

Bases: GetRankingListResponse

A page of an event leaderboard around a score, the reply to llsw.

Client: LLSWCommand.executeCommand (bundle line 124411), which hands the reply to LeaderBoardDataProvider.onScoreDataReceived (bundle line 75957) as LLSPCommand does

Fields:

Validators:

LeaderboardSearchResult pydantic-model

Bases: BasePayload

The scores that matched a search in one league: an entry of slse's L.

Client: LeaderBoardDataProvider.onSearchDataReceived (bundle line 75952)

Fields:

Validators:

league_type_id pydantic-field

league_type_id: LeagueTypeId | None = None

Wire key LID

The league the scores are in

score_ids pydantic-field

score_ids: list[str]

Wire key L

The matching scores' ids

SearchRankingListResponse pydantic-model

Bases: BaseResponse

The scores that matched a leaderboard search, the reply to slse.

The client throws on a missing L or a result that is not an object; the library reads those as no results, and a score id that is a number as text.

Client: SLSECommand.executeCommand (bundle line 124440), LeaderBoardDataProvider.onSearchDataReceived (bundle line 75952)

Fields:

Validators:

list_type pydantic-field

list_type: int | None = None

Wire key LT

league_type_id pydantic-field

league_type_id: LeagueTypeId = -1

Wire key LID

League type id; -1 for none

results pydantic-field

Wire key L

The matches, grouped by league, in the client's order

Dedicated event boards

client.ranking.get_colossus_highscore(search_value="-1") returns donor records and pagination metadata. Search by donor name or rank; use the last rank to stop paging. Donation points are before the client conversion (.01, or .01093 for coin colossus). The request contains no event id and addresses the server's current colossus.

get_season_info() returns division, medals, passes and payout information supplied by the server. Missing sections remain None. get_season_ranks() returns your own ranks; use get_highscore() with RankingType.KINGDOMS_LEAGUE_SEASON or KINGDOMS_LEAGUE_SEASON_EVENT for paginated player boards and their alliance equivalents for alliance boards. These requests concern the current season, not a previous run.

Dedicated event board protocols, whose records differ from generic highscore rows.

Classes:

Name Description
ColossusHighscoreRow

A donor. Points are donation units, before the event's conversion rate.

GetColossusHighscoreRequest

Client: C2SColossusGetHighscoreVO (bundle lines 59205-59210).

GetColossusHighscoreResponse

Client: CastleSpecialEventData.parse_CHE (bundle lines 139783-139790).

SeasonDivision

Client: SeasonLeagueServer.parseDivisionInfo (bundle line 142655).

SeasonMedal

A medal balance. Client: SeasonLeagueServer.parseMedalInfo (bundle lines 142656-142662).

SeasonPromotionPass

A purchased promotion pass. Client: SeasonLeagueServer.parsePassInfo (bundle line 142664).

SeasonPasses

Client: SeasonLeagueServer.parsePassInfo (bundle line 142664).

SeasonRank

Client: SeasonLeagueServer.parseRankInfo (bundle line 142669).

GetSeasonInfoRequest

Client: C2SGetSeasonInfoEventVO (bundle lines 142729-142733).

GetSeasonInfoResponse

Snapshot of the sections supplied by kli; absent sections stay None.

SeasonHighscoreRank

Client: SeasonLeagueServer.parseKLH (bundle lines 142673-142682).

GetSeasonRanksRequest

Client: C2SGetSeasonLeagueHighscoreEventVO (bundle lines 142737-142741).

GetSeasonRanksResponse

Client: SeasonLeagueServer.parseKLH (bundle lines 142673-142682), a bare array.

Attributes:

Name Type Description
logger
T

logger module-attribute

logger = logging.getLogger(__name__)

T module-attribute

T = TypeVar('T', bound=BasePayload)

ColossusHighscoreRow pydantic-model

Bases: BasePayload

A donor. Points are donation units, before the event's conversion rate.

Client: CastleSpecialEventData.parse_CHE (bundle lines 139783-139790).

Fields:

rank pydantic-field

rank: ClientInt

Wire key CR

Donor rank

player_name pydantic-field

player_name: str

Wire key PN

Donor name

donation_points pydantic-field

donation_points: float

Wire key CP

Donated points before event conversion

player_id pydantic-field

player_id: ClientInt

Wire key PID

Donor player id

GetColossusHighscoreRequest pydantic-model

Bases: BaseRequest

Client: C2SColossusGetHighscoreVO (bundle lines 59205-59210).

Fields:

search_value pydantic-field

search_value: str = '-1'

Wire key SV

Name or rank; -1 for your own rank

GetColossusHighscoreResponse pydantic-model

Bases: BaseResponse

Client: CastleSpecialEventData.parse_CHE (bundle lines 139783-139790).

Fields:

Validators:

  • _read_rows → rows

own_donation_points pydantic-field

own_donation_points: float

Wire key OP

Your points before event conversion

last_rank pydantic-field

last_rank: ClientInt

Wire key LR

Last rank on the server

rows pydantic-field

Wire key HS

This page's donors

SeasonDivision pydantic-model

Bases: BasePayload

Client: SeasonLeagueServer.parseDivisionInfo (bundle line 142655).

Fields:

division_id pydantic-field

division_id: ClientInt = 0

Wire key KLDID

Season division id

size pydantic-field

size: ClientInt = 0

Wire key KLDS

Players in the division

SeasonMedal pydantic-model

Bases: BasePayload

A medal balance. Client: SeasonLeagueServer.parseMedalInfo (bundle lines 142656-142662).

Fields:

Validators:

  • _row

medal_id pydantic-field

medal_id: ClientInt

Season medal id

amount pydantic-field

amount: ClientInt

Medals held

SeasonPromotionPass pydantic-model

Bases: BasePayload

A purchased promotion pass. Client: SeasonLeagueServer.parsePassInfo (bundle line 142664).

Fields:

Validators:

  • _id

promotion_id pydantic-field

promotion_id: ClientInt

Promotion whose pass was purchased

SeasonPasses pydantic-model

Bases: BasePayload

Client: SeasonLeagueServer.parsePassInfo (bundle line 142664).

Keys: CommKeys (dll.pretty lines 80786, 80796-80797).

Fields:

Validators:

season_enabled pydantic-field

season_enabled: bool = False

Wire key KLP

Whether the season pass is enabled

event_enabled pydantic-field

event_enabled: bool = False

Wire key KLEPE

Whether the event pass is enabled

promotions pydantic-field

promotions: tuple[SeasonPromotionPass, ...] = ()

Wire key KLPP

Purchased promotion passes

SeasonRank pydantic-model

Bases: BasePayload

Client: SeasonLeagueServer.parseRankInfo (bundle line 142669).

Fields:

promotion_id pydantic-field

promotion_id: ClientInt = 0

Wire key KLRID

Current promotion id

medal_points pydantic-field

medal_points: ClientInt = 0

Wire key KLMP

Promotion medal points

GetSeasonInfoRequest pydantic-model

Bases: BaseRequest

Client: C2SGetSeasonInfoEventVO (bundle lines 142729-142733).

GetSeasonInfoResponse pydantic-model

Bases: BaseResponse

Snapshot of the sections supplied by kli; absent sections stay None.

Client: SeasonLeagueServer.parseKLI (bundle lines 142653-142671).

Fields:

Validators:

division pydantic-field

division: SeasonDivision | None = None

Wire key KLD

Season division

player_medals pydantic-field

player_medals: tuple[SeasonMedal, ...] | None = None

Wire key KLM

Your medal balances

alliance_medals pydantic-field

alliance_medals: tuple[SeasonMedal, ...] | None = None

Wire key KLAM

Alliance medal balances

passes pydantic-field

passes: SeasonPasses | None = None

Wire key KLSP

Purchased passes

rank pydantic-field

rank: SeasonRank | None = None

Wire key KLR

Your promotion progress

payout_seconds pydantic-field

payout_seconds: ClientInt | None = None

Wire key RD

Seconds until medal payout

event_dialog_seen pydantic-field

event_dialog_seen: bool | None = None

Wire key KLSE

Event introduction was seen

season_dialog_seen pydantic-field

season_dialog_seen: bool | None = None

Wire key KLS

Season introduction was seen

SeasonHighscoreRank pydantic-model

Bases: BasePayload

Client: SeasonLeagueServer.parseKLH (bundle lines 142673-142682).

Fields:

Validators:

  • _row

list_type pydantic-field

list_type: EnumOrInt[RankingType]

Season highscore list

rank pydantic-field

rank: ClientInt

Your rank on this list

GetSeasonRanksRequest pydantic-model

Bases: BaseRequest

Client: C2SGetSeasonLeagueHighscoreEventVO (bundle lines 142737-142741).

GetSeasonRanksResponse pydantic-model

Bases: BaseResponse

Client: SeasonLeagueServer.parseKLH (bundle lines 142673-142682), a bare array.

Fields:

Validators:

  • _array

ranks pydantic-field

Your season and current event ranks

client.events.get_horizon_rank(alliance_id) returns only your alliance's rank; get_horizon_timers() returns relink/revival seconds. Both require a running Beyond the Horizon event. get_player_performance(event, player_id) requests gpe counters as PerformanceStatistic values (unknown ids stay integers). get_outer_realms_ranks() returns current daily and overall points/ranks. Unavailable event context raises EventNotRunningError; unavailable server context and other refusals raise CommandError. Transport failures propagate.

Outer Realms and Beyond the Horizon board pages already use ranking.get_highscore(): select the current list or OUTER_REALMS_PREVIOUS_RUN_PLAYER, HORIZON_PREVIOUS_RUN_ALLIANCE or HORIZON_PREVIOUS_RUN_PLAYER for previous-run boards. Those rows carry their display name and shown rank; owner information is retained when supplied. abgph, trt, gpe and tsh carry no pagination controls or previous-run selector.

Own-rank and performance reads for event servers.

Classes:

Name Description
GetHorizonRankRequest

Client: C2SAllianceBattleGroundGetOwnRanksVO (bundle lines 71938-71942).

GetHorizonRankResponse

Client: AllianceBattleGroundEventVO.parseOwnRanks (bundle line 114240).

GetHorizonTimersRequest

Client: C2SAllianceBattleGroundGetTimersVO (bundle lines 54330-54334).

GetHorizonTimersResponse

Client: CastleAllianceBattleGroundData.parseTRT (bundle line 144811).

PlayerPerformanceStatistic

Client: PlayerPerformanceVO.getPerformanceData (bundle lines 27997-28001).

GetPlayerPerformanceRequest

Client: C2SGetPlayerPerformanceVO (bundle lines 34268-34272).

GetPlayerPerformanceResponse

Client: PlayerPerformanceVO.parseData and getPerformanceData (bundle 27996-28001).

GetOuterRealmsRanksRequest

Client: C2STemporaryServerHighscoreVO (bundle lines 60050-60054).

GetOuterRealmsRanksResponse

Client: TempServerEventVO.parseOwnRanks (bundle line 118163).

Attributes:

Name Type Description
logger

logger module-attribute

logger = logging.getLogger(__name__)

GetHorizonRankRequest pydantic-model

Bases: BaseRequest

Client: C2SAllianceBattleGroundGetOwnRanksVO (bundle lines 71938-71942).

Fields:

alliance_id pydantic-field

alliance_id: int

Wire key AID

Your alliance id

GetHorizonRankResponse pydantic-model

Bases: BaseResponse

Client: AllianceBattleGroundEventVO.parseOwnRanks (bundle line 114240).

Fields:

alliance_rank pydantic-field

alliance_rank: ClientInt

Wire key R

Your alliance's rank

GetHorizonTimersRequest pydantic-model

Bases: BaseRequest

Client: C2SAllianceBattleGroundGetTimersVO (bundle lines 54330-54334).

GetHorizonTimersResponse pydantic-model

Bases: BaseResponse

Client: CastleAllianceBattleGroundData.parseTRT (bundle line 144811).

Keys: CommKeys (dll.pretty lines 80880-80881).

Fields:

relink_seconds: float

Wire key STNL

Seconds until the next tower relink

revive_seconds pydantic-field

revive_seconds: float

Wire key STNR

Seconds until the next tower revival

PlayerPerformanceStatistic pydantic-model

Bases: BasePayload

Client: PlayerPerformanceVO.getPerformanceData (bundle lines 27997-28001).

Fields:

statistic_id pydantic-field

statistic_id: EnumOrInt[PerformanceStatistic]

Wire key PSI

Performance statistic

amount pydantic-field

amount: float

Wire key AMT

Statistic amount

GetPlayerPerformanceRequest pydantic-model

Bases: BaseRequest

Client: C2SGetPlayerPerformanceVO (bundle lines 34268-34272).

Fields:

player_id pydantic-field

player_id: int

Wire key PID

Player whose performance is requested

event_id pydantic-field

event_id: EnumOrInt[Event]

Wire key EID

Event whose performance is requested

GetPlayerPerformanceResponse pydantic-model

Bases: BaseResponse

Client: PlayerPerformanceVO.parseData and getPerformanceData (bundle 27996-28001).

Fields:

Validators:

points pydantic-field

points: float

Wire key AMT

Player's current event points

statistics pydantic-field

statistics: tuple[PlayerPerformanceStatistic, ...] = ()

Wire key PST

Player's performance counters

amount

amount(statistic: PerformanceStatistic | int) -> float

The first matching counter, or 0 when the server supplied none, as in the client.

GetOuterRealmsRanksRequest pydantic-model

Bases: BaseRequest

Client: C2STemporaryServerHighscoreVO (bundle lines 60050-60054).

GetOuterRealmsRanksResponse pydantic-model

Bases: BaseResponse

Client: TempServerEventVO.parseOwnRanks (bundle line 118163).

Fields:

Validators:

daily_points pydantic-field

daily_points: ClientInt

Wire key DHS

Your daily points

daily_rank pydantic-field

daily_rank: ClientInt

Wire key DR

Your daily rank; 0 when unranked

overall_points pydantic-field

overall_points: ClientInt

Wire key HS

Your overall points

overall_rank pydantic-field

overall_rank: ClientInt

Wire key R

Your overall rank; 0 when unranked