Player¶
Player profiles, search and Legendary skills behind client.player.
Global effect boosts can be purchased with
client.player.activate_global_effect_boost(effect_id, spend_rubies=True).
With ruby purchase confirmation enabled in the game, the SDK confirms the
server challenge once because this call explicitly authorizes spending.
The method requires a running booster event offering that effect.
This spends rubies: inspect state.get_event(Event.GLOBAL_EFFECT_BUFF) for
the offer's cost and boost_value before opting in. The method waits for
the purchase acknowledgement; player.boosted_global_effects changes when
the separate bie push arrives. After a timeout, check fresh state before
trying again.
player.service¶
Other players' details, player search and your Legendary skills.
Modules:
| Name | Description |
|---|---|
account |
Your coat of arms, premium flag, player name, email address and password. |
base |
What the player sections share: your player and your currencies. |
boosters |
Your boosters: reading them, hiring them with rubies and holding a feast. |
players |
Other players' info and the player search. |
protection |
Peace mode and Berimond protection. |
skills |
Legendary and sceat skills, opening loot boxes and choosing titles. |
standing |
Your level, VIP status, cargo points, skills, boosts, titles and achievements. |
training |
Relocation, the officers' school, your hero, loot boxes and gifts. |
Classes:
| Name | Description |
|---|---|
PlayerDetailsBulkResult |
What |
PlayerService |
Other players' details, finding a player by name, and your own player: currencies, skills, |
PlayerDetailsBulkResult
dataclass
¶
PlayerDetailsBulkResult(found: dict[int, GetPlayerInfoResponse] = dict(), failed: dict[int, CommandError | PacketError] = dict(), timed_out: list[int] = list())
What PlayerService.get_player_details_bulk got for each player.
Attributes:
| Name | Type | Description |
|---|---|---|
found |
dict[int, GetPlayerInfoResponse]
|
The replies, by player id. |
failed |
dict[int, CommandError | PacketError]
|
Players whose request the server refused, or whose reply could not be read. |
timed_out |
list[int]
|
Players whose reply did not come in time. |
complete |
bool
|
Whether every player was found. |
found
class-attribute
instance-attribute
¶
found: dict[int, GetPlayerInfoResponse] = field(default_factory=dict)
The replies, by player id.
failed
class-attribute
instance-attribute
¶
failed: dict[int, CommandError | PacketError] = field(default_factory=dict)
Players whose request the server refused, or whose reply could not be read.
timed_out
class-attribute
instance-attribute
¶
Players whose reply did not come in time.
PlayerService
¶
PlayerService(client: EmpireClient)
Bases: StandingMixin, BoostersMixin, TrainingMixin, AccountMixin, ProtectionMixin, PlayersMixin, SkillsMixin, PlayerBaseMixin, BaseService
Other players' details, finding a player by name, and your own player: currencies, skills, boosts, points and titles.
Reached as client.player.
Methods:
| Name | Description |
|---|---|
on_skill_list |
Register a callback for every skill list the server sends. |
on_achievement_finished |
Register a callback for every achievement you finish, called with the |
on_food_production |
Register a callback for each food production status the server sends: the login data's |
buy_level |
Buy your next level with rubies; see "Spending rubies" in the guides. |
get_vip_status |
Request your VIP status: points, level, VIP time left and premium commanders used today; it is |
get_cargo_points |
Your and your alliance's cargo points; both are applied to state. |
get_storm_islands_info |
Your and your alliance's Storm Islands standing; it and your cargo points are applied to state. |
get_title_ranks |
Request your top-X ranks, Storm Islands title and displayed title systems, as the client does when |
assign_title |
Give a Storm Islands title to a player, as the island's king does. |
revoke_title |
Take a Storm Islands title back from the player holding it. |
get_achievements |
Request your achievements, as the client does when the achievements dialog opens. |
get_boosts |
Request your boosters, premium account, production slots and feast; the reply also reaches |
hire_booster |
Hire a booster with rubies: the instructor, the marauder, an overseer, the caravan overloader or |
hold_feast |
Hold a feast for faster recruitment in every castle, paid from one of your castles' food or with |
get_training_programs |
Request the officers' school's training programs: those on offer, the one running and today's counts. |
activate_training_program |
Start the training program on offer in |
prolong_training_program |
Prolong the training program running, for rubies. |
reroll_training_programs |
Replace the training programs on offer, except those in |
choose_hero |
Pick your hero, the tutorial's quest character. |
activate_global_effect_boost |
Purchase the running booster event's ruby boost for a global effect. |
get_loot_boxes |
Request your loot boxes and key progress, as the client does when the mystery boxes open; |
send_gift_packages |
Send another player gift packages you hold, as many as |
change_coat_of_arms |
Change your coat of arms to |
unlock_symbol |
Unlock for good a premium symbol an achievement has earned you, for its coin or ruby price. |
buy_premium_flag |
Buy the premium flag your castles fly on the map, with rubies; see "Spending rubies" in the guides. |
get_player_name_change_info |
Request how often you have changed your name and when you may change it again; its |
change_player_name |
Change your player name to |
set_credentials |
Replace the temporary player name, email address or password the account started with; an empty one |
change_password |
Change your account's password from |
set_migration_password |
Give your account a password while its social login is migrated, as the client asks after an |
change_email |
Change your account's email address to |
cancel_email_change |
Cancel the email change in progress; your email address stays as it is. |
resend_verification_link |
Send another verification link: the account's, while its email address is unverified, or the email |
protection |
Your protection in |
get_protection |
Ask for your protection in |
start_peace_mode |
Buy peace mode: nobody can attack you, and you attack nobody, for |
cancel_peace_mode |
End your peace mode; the new stage arrives as a |
start_berimond_protection |
Buy Berimond protection; the reply also updates the running Berimond event. |
get_player_info |
Get detailed player information (gdi), including castle list with |
get_player_details |
Alias for |
get_player_details_bulk |
Get detailed info for several players, one gdi request after another. |
search_player_by_name |
|
get_skills |
The player's Legendary and sceat skills. |
add_legendary_skill_point |
Buy a Legendary skill level with skill points: the next level of a skill you hold, or the first |
buy_sceat_skill |
Buy a sceat skill level with sceat tokens or imperial ducats, as its row prices it; no rubies are spent. |
skip_sceat_skill_activation |
Finish a sceat skill's activation now, for rubies; see "Spending rubies" in the guides. |
reset_skills |
Take back every Legendary skill point, and the sceat skills with them. |
open_loot_box |
Open a loot box, or every box of the kind, with a mystery box key. |
select_titles |
Choose the title systems shown before and after your name. |
Attributes:
| Name | Type | Description |
|---|---|---|
cargo_points |
int | float | None
|
Your cargo points, from the last |
storm_islands |
StormIslandsInfo | None
|
Your and your alliance's Storm Islands standing, from the last |
skills |
SkillList | None
|
Your Legendary and sceat skills as the last |
spent_skill_points |
int | None
|
Points spent on your held Legendary skills; None until a skill list arrived. |
available_skill_points |
int | None
|
Legendary skill points left to spend; None until a skill list arrived. |
title_ids |
list[Title | int]
|
Your held titles, in glory, Berimond and Storm Islands order. |
boosts |
BoosterInfoResponse
|
Your boosters, premium account, production slots and feast. |
might |
MightPointsResponse
|
Your might points, from the last |
glory_points |
GloryPointsResponse
|
Your glory points, from the last |
food_production |
FoodProductionStatus | None
|
Whether your food production is frozen, from the login data's |
gallantry_points |
GallantryPointsResponse | None
|
Your Berimond points, from the last |
title_ranks |
TitleRanksResponse
|
Your top-X ranks, Storm Islands title and displayed title systems, from the last |
achievements |
AchievementsResponse
|
Your achievement points, finished achievements and progress. |
relocation |
RelocationInfoResponse | None
|
Your castle relocations, from the last |
officer_training |
OfficerTraining | None
|
The officers' school training program running, from the last |
training_programs |
TrainingProgramsResponse | None
|
The officers' school's training programs, from the last |
hero |
Hero | int | None
|
Your hero, from the last |
boosted_global_effects |
BoostedGlobalEffectsResponse | None
|
The global effects the running booster event boosts, from the last |
loot_boxes |
LootBoxesResponse | None
|
Your loot boxes and key progress; None until a |
daily_reset |
DailyResetResponse | None
|
When the daily reset comes, from the login data's |
gifts |
PlayerGiftsResponse | None
|
Your gift packages and how many you may still send, from the last |
coat_of_arms |
CoatOfArmsResponse | None
|
Your coat of arms, from the login data and the |
coat_of_arms_symbols |
CoatOfArmsSymbolsResponse | None
|
The premium symbols you have earned and unlocked, from the last |
premium_flag |
PremiumFlagResponse | None
|
Whether you own the premium flag, from the login data's |
player_name_change_info |
PlayerNameChangeInfoResponse | None
|
Your player name changes and cooldown, from the last |
credentials_status |
CredentialsStatus | None
|
Which of your player name, password and email address are temporary, from the last |
account_deletion |
AccountDeletion | None
|
When your account is deleted, from the last |
local_player |
Player
|
A snapshot of the local player. |
currencies |
dict[Currency | str, int]
|
A snapshot of the special currencies ( |
cargo_points
property
¶
Your cargo points, from the last gap; None until one arrived (get_cargo_points asks).
storm_islands
property
¶
Your and your alliance's Storm Islands standing, from the last sii; None until one arrived.
skills
property
¶
skills: SkillList | None
Your Legendary and sceat skills as the last skl listed them; None until one arrived.
spent_skill_points
property
¶
spent_skill_points: int | None
Points spent on your held Legendary skills; None until a skill list arrived.
available_skill_points
property
¶
available_skill_points: int | None
Legendary skill points left to spend; None until a skill list arrived.
title_ids
property
¶
Your held titles, in glory, Berimond and Storm Islands order.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought your points and title ranks |
GameDataNotLoadedError
|
The game data cannot be loaded |
boosts
property
¶
boosts: BoosterInfoResponse
Your boosters, premium account, production slots and feast.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought it |
might
property
¶
might: MightPointsResponse
Your might points, from the last gmu.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought it |
glory_points
property
¶
glory_points: GloryPointsResponse
Your glory points, from the last ufa.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought it |
food_production
property
¶
food_production: FoodProductionStatus | None
Whether your food production is frozen, from the login data's DTS and each push since; None until
one arrived.
gallantry_points
property
¶
gallantry_points: GallantryPointsResponse | None
Your Berimond points, from the last ufp push; None until one arrived (the login data has none).
title_ranks
property
¶
title_ranks: TitleRanksResponse
Your top-X ranks, Storm Islands title and displayed title systems, from the last uar.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought it |
achievements
property
¶
achievements: AchievementsResponse
Your achievement points, finished achievements and progress.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought it |
relocation
property
¶
relocation: RelocationInfoResponse | None
Your castle relocations, from the last gri; None until one arrived.
officer_training
property
¶
officer_training: OfficerTraining | None
The officers' school training program running, from the last gatp and the gtp since.
training_programs
property
¶
The officers' school's training programs, from the last gtp; None until one arrived.
hero
property
¶
Your hero, from the last hdc; None until one arrived or while you have yet to pick one.
boosted_global_effects
property
¶
boosted_global_effects: BoostedGlobalEffectsResponse | None
The global effects the running booster event boosts, from the last bie; None until one arrived.
loot_boxes
property
¶
loot_boxes: LootBoxesResponse | None
Your loot boxes and key progress; None until a gls arrived.
daily_reset
property
¶
daily_reset: DailyResetResponse | None
When the daily reset comes, from the login data's drt; None until it arrived.
gifts
property
¶
gifts: PlayerGiftsResponse | None
Your gift packages and how many you may still send, from the last pgl; None until one arrived.
coat_of_arms
property
¶
Your coat of arms, from the login data and the gem and change_coat_of_arms since; None before.
coat_of_arms_symbols
property
¶
The premium symbols you have earned and unlocked, from the last gus; None until one arrived.
premium_flag
property
¶
premium_flag: PremiumFlagResponse | None
Whether you own the premium flag, from the login data's gpf or the last push; None before one.
player_name_change_info
property
¶
Your player name changes and cooldown, from the last get_player_name_change_info; None before.
credentials_status
property
¶
Which of your player name, password and email address are temporary, from the last scd; None before.
account_deletion
property
¶
When your account is deleted, from the last psd push; None until one arrived.
local_player
property
¶
local_player: Player
A snapshot of the local player.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought it |
currencies
property
¶
A snapshot of the special currencies (Currency -> amount).
on_skill_list
¶
on_skill_list(callback: Callable[[SkillList], object]) -> None
Register a callback for every skill list the server sends.
That is each skl packet, including the reply to get_skills,
and the skl block of an ego push.
Client: SKLCommand.executeCommand (bundle line 129742) and
EGOCommand.executeCommand (bundle line 122801) both call parse_SKL.
Removing a callback not registered is a no-op.
Unregister a callback with on_skill_list.remove(callback).
on_achievement_finished
¶
on_achievement_finished(callback: Callable[[AchievementFinishedResponse], object]) -> None
Register a callback for every achievement you finish, called with the vfi push.
Client: VFICommand.exec (bundle line 121164) shows the level-up dialog or the achievement popup.
Unregister a callback with on_achievement_finished.remove(callback).
on_food_production
¶
on_food_production(callback: Callable[[FoodProductionStatus], object]) -> None
Register a callback for each food production status the server sends: the login data's DTS
and each DTS push, after food_production has it.
Client: CastleUserData.parse_DTS (bundle line 9925) fires DOWNTIME_STATUS_UPDATED on each one
Removing a callback not registered is a no-op.
Unregister a callback with on_food_production.remove(callback).
buy_level
¶
Buy your next level with rubies; see "Spending rubies" in the guides.
The client offers it from level 10 to 69 to a split-run test group it reads from the server, so the
server may refuse an account outside that group. The price is not worked out here, so this always
needs spend_rubies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spend_rubies
|
bool
|
Allow the rubies it costs; without it nothing is sent |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
StateNotLoadedError
|
No login has brought your level |
CommandError
|
The server refused |
Client: ButtonBuyLevelComponent.onClickButton and onConfirm (bundle lines 548838, 548859),
priced by buyLevelData.getLevelUpCost; updateButtonVisibility (bundle line 548864) shows the
button for SplitRunConst.BUY_LEVEL_TEST_PARAM and a level in range; BLVCommand.executeCommand
(bundle line 650885)
get_vip_status
¶
get_vip_status(*, timeout: float = 5.0) -> VipStatusResponse
Request your VIP status: points, level, VIP time left and premium commanders used today; it is applied to your player in state too.
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: C2SVIPInfoEvent (bundle line 400604), VIPCommand.exec (bundle line 653087)
get_cargo_points
¶
get_cargo_points(*, timeout: float = 5.0) -> CargoPointsResponse
Your and your alliance's cargo points; both are applied to state.
Client: CastleEilandPanel (bundle line 56736) asks while it knows none
get_storm_islands_info
¶
get_storm_islands_info(*, timeout: float = 5.0) -> StormIslandsInfo
Your and your alliance's Storm Islands standing; it and your cargo points are applied to state.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
Client: CastleStormIslandsMainDialog.showLoaded (bundle line 17524) asks while you are in an
alliance; SIICommand (bundle line 127742)
get_title_ranks
¶
get_title_ranks(*, timeout: float = 5.0) -> TitleRanksResponse
Request your top-X ranks, Storm Islands title and displayed title systems, as the client does when
the Storm Islands title ranking opens; the reply is also kept in title_ranks.
Client: CastleEilandRankingDialogTitle.show (bundle line 98292) sends C2SUserAchievedRanksVO
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
assign_title
¶
assign_title(title: Title | int, player_name: str, *, timeout: float = 5.0) -> AssignTitleResponse
Give a Storm Islands title to a player, as the island's king does.
The client asks for the title ranks after every title given (title_ranks), and so does
the library, without waiting for them.
Client: CastleEilandAssignTitleDialog.onConfirmAssignment (bundle line 98376),
APTCommand.executeCommand (bundle line 123623)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
Title | int
|
The title to give |
required |
player_name
|
str
|
The player to give it to |
required |
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
AssignTitleResponse
|
The title and the player given it |
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError
|
The server refused: |
EmpireTimeoutError / ConnectionClosedError
|
see |
revoke_title
¶
Take a Storm Islands title back from the player holding it.
Client: CastleEilandAssignTitleDialog.onConfirmAssignment (bundle line 98376) sends the title with
an empty name; APTCommand.executeCommand (bundle line 123623)
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused, e.g. |
EmpireTimeoutError / ConnectionClosedError
|
see |
get_achievements
¶
get_achievements(*, timeout: float = 5.0) -> AchievementsResponse
Request your achievements, as the client does when the achievements dialog opens.
The reply is what the server sent; achievements holds it merged over what was known.
Client: CastleAchievementDialog.showLoaded (bundle line 106960) sends C2SAchievementListVO
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
get_boosts
¶
get_boosts(*, timeout: float = 5.0) -> BoosterInfoResponse
Request your boosters, premium account, production slots and feast; the reply also reaches
boosts.
Client: C2SBoosterInfoVO (bundle line 149206); BOICommand.executeCommand (bundle line 627667)
hire_booster
¶
hire_booster(booster: BoosterId, *, spend_rubies: bool = False, private_offer_id: int = NO_OFFER, timeout: float = 5.0) -> HireResponse
Hire a booster with rubies: the instructor, the marauder, an overseer, the caravan overloader or the return speed booster; see "Spending rubies" in the guides.
Its price comes with the boosters and is not worked out here, so this always needs spend_rubies.
The tax collector is bribed with client.castle.bribe_tax_collector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
booster
|
BoosterId
|
The booster to hire |
required |
spend_rubies
|
bool
|
Allow the rubies it costs; without it nothing is sent |
False
|
private_offer_id
|
int
|
The booster sale the hire uses, -1 for none |
NO_OFFER
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
HireResponse
|
Coins and rubies, and the boosters after; the boosters also reach |
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError
|
The server refused |
Client: BuyBoosterCommand.execute (bundle line 459673) and
CastleBuyReturnSpeedBoosterDialog.onClick (bundle line 463069), each with
CastleBoosterSaleData.getOfferId (bundle line 52882)
hold_feast
¶
hold_feast(feast: Feast, castle_id: int, *, spend_rubies: bool = False, private_offer_id: int = -1, timeout: float = 5.0) -> HoldFeastResponse
Hold a feast for faster recruitment in every castle, paid from one of your castles' food or with rubies; on the feast you hold, extend it. See "Spending rubies" in the guides.
As the client offers it: while a feast runs only that one, extended; otherwise one your level is
in range of (FeastDef.offered_at), paid from a castle outside Berimond. A ruby feast needs
spend_rubies; on a food feast spend_rubies pays the food the castle lacks with rubies, as the
client's resource dialog does after a refusal for missing food. A food feast costs its
FeastDef.cost_food less client.castle.get_feast_cost_reduction() percent, as the dialogs show it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feast
|
Feast
|
The feast, a |
required |
castle_id
|
int
|
The castle that pays the food, a |
required |
spend_rubies
|
bool
|
Allow a ruby feast's price, and pay missing food with rubies |
False
|
private_offer_id
|
int
|
The resource merchant's private offer, which the client sends with the paid food, -1 for none |
-1
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
HoldFeastResponse
|
The feast you hold after; it also reaches |
Raises:
| Type | Description |
|---|---|
ValueError
|
Another feast runs, your level is out of the feast's range, the castle is in
Berimond, the feast is not in the game data, or it costs rubies and |
UnknownCastleError
|
|
StateNotLoadedError
|
No login has brought the player or the boosters |
GameDataNotLoadedError
|
The game data cannot be loaded |
CommandError
|
The server refused, |
Client: CastleFestivalPremiumShopVO.clickedBuyButton, canBeBought and isActiveFeastOutdated
(split.js lines 215420-215505) open the extend dialog while a feast runs, which sends its id
(CastleExtendFestivalDialog.onClick, split.js line 334119), and else CastleFestivalDialog, which
lists getFestivalItemsByLevel(userLevel) (split.js line 334547) and castles outside
FactionConst.KINGDOM_ID (split.js line 334400); PremiumFestivalItemVO.hasC2Costs (split.js line
333252); CastlePrivateOfferData.getPrivateOfferMerchantID (split.js line 660957)
get_training_programs
¶
get_training_programs(*, timeout: float = 5.0) -> TrainingProgramsResponse
Request the officers' school's training programs: those on offer, the one running and today's counts.
Client: OfficersSchoolDialogList.show (bundle line 85651) sends C2SGetTrainingProgramInfoVO;
GTPCommand.executeCommand (bundle line 126183)
activate_training_program
¶
activate_training_program(slot_id: int, *, spend_rubies: bool = False, timeout: float = 5.0) -> None
Start the training program on offer in slot_id.
Slot 1's program costs coins, slot 2's the day's event currency and slot 3's rubies, so slot 3
needs spend_rubies.
Raises:
| Type | Description |
|---|---|
ValueError
|
Slot 3 without |
CommandError
|
The server refused |
Client: OfficersSchoolEffectItem.onConfirmBuy (bundle line 85774), OfficersSchoolEffectVO.getCost
(bundle line 144773), ATPCommand.executeCommand (bundle line 126155)
prolong_training_program
¶
Prolong the training program running, for rubies.
Raises:
| Type | Description |
|---|---|
ValueError
|
Without |
CommandError
|
The server refused |
Client: OfficersSchoolDialogList.onBuyProlong (bundle line 85691),
OfficersSchoolData.getC2ProlongCosts (bundle line 144743), PTPCommand.executeCommand
(bundle line 126198)
reroll_training_programs
¶
reroll_training_programs(kept_slot_ids: Sequence[int] = (), *, premium: bool = False, spend_rubies: bool = False, timeout: float = 5.0) -> None
Replace the training programs on offer, except those in kept_slot_ids.
The reroll costs the day's event currency; a premium one costs rubies and needs spend_rubies.
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError
|
The server refused |
Client: OfficersSchoolDialogList.onConfirmSoftReroll and onConfirmHardReroll (bundle lines
85689-85690), OfficersSchoolData.sendReroll (bundle line 144706), RTPCommand.executeCommand
(bundle line 126211)
choose_hero
¶
Pick your hero, the tutorial's quest character.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
Client: CastleChooseHeroDialog.sendHeroIdToServer (bundle line 42429), HDCommand.executeCommand
(bundle line 124371)
activate_global_effect_boost
¶
activate_global_effect_boost(effect_id: GlobalEffect | int, *, spend_rubies: bool = False, timeout: float = 5.0) -> None
Purchase the running booster event's ruby boost for a global effect.
Read Event.GLOBAL_EFFECT_BUFF in state for the offered effects, ruby
costs and added strengths. The price is event data, not a fixed amount.
This waits for the server's acknowledgement only; the separate bie
push updates boosted_global_effects. A timeout is ambiguous:
inspect fresh state before considering another purchase.
Raises:
| Type | Description |
|---|---|
ValueError
|
Without |
EventNotRunningError
|
No global effect booster event is running |
CommandError
|
The server refused the purchase |
EmpireTimeoutError / ConnectionClosedError / NetworkError
|
transport failures |
Client: GlobalEffectEventDialogListItem.onBuy and
C2SActivateGlobalEffectBuffVO (Game.bundle.e2ca3c4ee155ea53c7c7.js)
get_loot_boxes
¶
get_loot_boxes(*, timeout: float = 5.0) -> LootBoxesResponse
Request your loot boxes and key progress, as the client does when the mystery boxes open;
the reply is also kept in loot_boxes.
Client: RewardHubMainDialogMysteryBoxes.show (bundle line 92142) sends C2SGetLootBoxesStatus
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
send_gift_packages
¶
send_gift_packages(receiver_id: int, package_id: PackageId, amount: int = 1, *, timeout: float = 5.0) -> None
Send another player gift packages you hold, as many as amount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
receiver_id
|
int
|
The player who gets them |
required |
package_id
|
PackageId
|
The package, a |
required |
amount
|
int
|
How many to send, 1 at least |
1
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError
|
The server refused, |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastlePlayerGiftSliderGiveDialog.onBtnOkClick (bundle line 68336) sends one to the slider's
held amount; GPGCommand.executeCommand (bundle line 127957)
change_coat_of_arms
¶
change_coat_of_arms(coat_of_arms: OwnerCrest, *, timeout: float = 5.0) -> ChangeCoatOfArmsResponse
Change your coat of arms to coat_of_arms; the reply's is also kept in coat_of_arms.
As in the client, no symbol is sent where the layout shows none. While an active quest asks you to create
your coat of arms, it also goes out as your avatar (lca) first, which needs the game data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coat_of_arms
|
OwnerCrest
|
The new coat of arms, e.g. |
required |
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
ChangeCoatOfArmsResponse
|
Your coat of arms and your coins and rubies after the change |
Raises:
| Type | Description |
|---|---|
GameDataNotLoadedError
|
A quest is active and the game data cannot be loaded |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastlePremiumMarketPlaceDialogFlag.sendNewCrest (bundle line 77020),
CastleQuestData.foundActiveQuestWithConditionType (bundle line 20339)
unlock_symbol
¶
unlock_symbol(symbol_id: CoatOfArmsSymbolId, *, spend_rubies: bool = False, timeout: float = 5.0) -> None
Unlock for good a premium symbol an achievement has earned you, for its coin or ruby price.
The game data's coat_of_arms_symbols lists the symbols. The new symbols arrive as a
gus push into coat_of_arms_symbols, as the client expects them to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol_id
|
CoatOfArmsSymbolId
|
The symbol, a premium |
required |
spend_rubies
|
bool
|
Allow the rubies a symbol priced in rubies costs |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
The game data has no such premium symbol, or it costs rubies and |
GameDataNotLoadedError
|
The game data cannot be loaded |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleBuyUnlockedCrestSymbolDialog.showLoaded and onClick (bundle lines 77181-77182),
which show the coin price, else the ruby price; BUSCommand.executeCommand (bundle line 125032)
buy_premium_flag
¶
Buy the premium flag your castles fly on the map, with rubies; see "Spending rubies" in the guides.
As in the premium shop, it is not offered while premium_flag says you own it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spend_rubies
|
bool
|
Allow the rubies it costs, |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
You own the premium flag, or |
CommandError
|
The server refused |
Client: CastleFlagPremiumShopVO.canBeBought (bundle line 396457), CastleBuyPremiumFlagDialog.onClick
(bundle line 396605); GBPCommand.executeCommand (bundle line 651488)
get_player_name_change_info
¶
get_player_name_change_info(*, timeout: float = 5.0) -> PlayerNameChangeInfoResponse
Request how often you have changed your name and when you may change it again; its
cost_rubies(game_data) prices the next change.
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: C2SChangePlayerNameInfo (bundle line 46362), GNCICommand.executeCommand (bundle line 120604)
change_player_name
¶
Change your player name to name, the name other players see. This cannot be undone but by another
paid change, and a cooldown follows it.
The first change is free, each later one costs rubies (the game data's player_name_changes), priced
from a fresh get_player_name_change_info. Whether the name you log in with changes too is unverified;
the client changes nothing about its login.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The new name |
required |
spend_rubies
|
bool
|
Allow the rubies the change costs |
False
|
timeout
|
float
|
Timeout in seconds, for each request |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
The cooldown runs, or the change costs rubies and |
GameDataNotLoadedError
|
The game data cannot be loaded |
CommandError
|
The server refused: |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleChangePlayerNameDialog.onClick and changeName (bundle lines 73164, 73185),
CPNECommand.executeCommand (bundle line 120509)
set_credentials
¶
set_credentials(*, name: str = '', email: str | SecretStr = '', password: str | SecretStr = '', timeout: float = 5.0) -> CredentialsStatus
Replace the temporary player name, email address or password the account started with; an empty one stays as it is. A new password replaces the one this client logs in again with.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Your new player name |
''
|
email
|
str | SecretStr
|
Your email address |
''
|
password
|
str | SecretStr
|
Your new password |
''
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
CredentialsStatus
|
Which of them are still temporary, also kept in |
Raises:
| Type | Description |
|---|---|
ValueError
|
A password shorter than 4 characters or with a character the client refuses |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleSelectUserName.sendUsernameToServer (bundle line 143150), CastleSaveAccountDialog
(bundle lines 72996-72999), SCDCommand.executeCommand (bundle line 120922)
change_password
¶
change_password(old_password: str | SecretStr, new_password: str | SecretStr, *, timeout: float = 5.0) -> None
Change your account's password from old_password to new_password; on success this client logs
in again with the new one.
Raises:
| Type | Description |
|---|---|
ValueError
|
A new password shorter than 4 characters or with a character the client refuses |
CommandError
|
The server refused, |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: OptionsDialogChangePasswordItem.changePassword (bundle line 72828), SCPCommand.executeCommand
(bundle line 120938)
set_migration_password
¶
Give your account a password while its social login is migrated, as the client asks after an slms
push says it has none. This client's own login password is left as it is.
Raises:
| Type | Description |
|---|---|
ValueError
|
A password shorter than 4 characters or with a character the client refuses |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleChangePasswordForSocialMigrationDialog.changePassword (bundle line 56679),
SPSLMSCommand.executeCommand (bundle line 121001)
change_email
¶
Change your account's email address to email. The change stays in progress until its verification link
is followed, and cancel_email_change cancels it.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused: |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleChangePlayerEmailDialog.changeEmail (bundle line 73243), RMCCommand.executeCommand
(bundle line 120886)
cancel_email_change
¶
cancel_email_change(*, timeout: float = 5.0) -> None
Cancel the email change in progress; your email address stays as it is.
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleChangePlayerEmailCancelDialog.onClick (bundle line 72770), CMCCommand.executeCommand
(bundle line 120496)
resend_verification_link
¶
resend_verification_link(link: VerificationLink, *, timeout: float = 5.0) -> None
Send another verification link: the account's, while its email address is unverified, or the email change's.
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: OptionsDialogAccountDetails.onSendAgainEmail (bundle line 72747), RSMCommand.executeCommand
(bundle line 120908)
protection
¶
protection(kingdom: Kingdom = GREEN) -> KingdomProtection | None
Your protection in kingdom as last sent (login data, uap pushes and replies); nothing is sent.
Its seconds count from when it arrived, client.state.get_last_packet_time("uap") for a push.
None when none came for that kingdom.
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought the player |
get_protection
¶
Ask for your protection in kingdom; the reply also updates protection, and in Berimond the event.
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: C2SUserAttackProtectionVO (bundle line 65923) and, for Berimond,
C2SUpdateFactionProtectionVO (bundle line 87993); UAPCommand (bundle line 129888)
start_peace_mode
¶
start_peace_mode(duration: PeaceModeDuration, *, spend_rubies: bool = False, timeout: float = 5.0) -> None
Buy peace mode: nobody can attack you, and you attack nobody, for duration.
It starts after a lead time; the stages arrive as uap pushes (see protection).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
PeaceModeDuration
|
How long; |
required |
spend_rubies
|
bool
|
Allow the rubies it costs |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleStartPeaceModeDialog.onClick (bundle line 35192) and setPrice
(bundle line 35188); C2SPeaceModeStartVO (bundle line 47478), MPSCommand (bundle line 125133)
cancel_peace_mode
¶
cancel_peace_mode(*, timeout: float = 5.0) -> None
End your peace mode; the new stage arrives as a uap push.
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleManagementDialog.cancelPeaceMode (bundle line 24682) sends C2SPeaceModeStartVO(-1)
start_berimond_protection
¶
start_berimond_protection(*, spend_rubies: bool = False, timeout: float = 5.0) -> StartBerimondProtectionResponse
Buy Berimond protection; the reply also updates the running Berimond event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spend_rubies
|
bool
|
Allow the rubies it costs, |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleFactionProtectionModeDialog.onClick (bundle line 64918), priced by
FactionConst.getPeaceC2Cost (dll line 19316); FFPCommand (bundle line 127785)
get_player_info
¶
get_player_info(player_id: int, *, timeout: float = 5.0) -> GetPlayerInfoResponse
Get detailed player information (gdi), including castle list with capture info.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
int
|
A player's id: |
required |
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
get_player_details
¶
get_player_details(player_id: int, *, timeout: float = 5.0) -> GetPlayerInfoResponse
Alias for get_player_info (both use the 'gdi' command).
get_player_details_bulk
¶
get_player_details_bulk(player_ids: list[int], send_delay: float = 0.0, *, timeout: float = 5.0) -> PlayerDetailsBulkResult
Get detailed info for several players, one gdi request after another.
Each request waits for its own reply before the next goes out: a gdi
error reply names no player, so only one request in flight at a time
tells which player it belongs to. Each runs as get_player_info
does, under the gdi command lock and taking only a reply whose
O.OID is the player asked for.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_ids
|
list[int]
|
Player ids to fetch, found as for |
required |
timeout
|
float
|
Seconds to wait for each reply |
5.0
|
send_delay
|
float
|
Seconds to wait between two requests; by default none, as each already waits for the one before it to be answered |
0.0
|
Returns:
| Type | Description |
|---|---|
PlayerDetailsBulkResult
|
Which players were found, which failed and why, and which timed out |
Raises:
| Type | Description |
|---|---|
ConnectionClosedError / NetworkError
|
the connection failed; the players fetched so far are lost |
ReceiveThreadError
|
called on the receive thread |
search_player_by_name
¶
search_player_by_name(player_name: str, *, timeout: float = 5.0) -> SearchPlayerResponse
get_skills
¶
get_skills(*, timeout: float = 5.0) -> GetSkillsResponse
The player's Legendary and sceat skills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
GetSkillsResponse
|
The |
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
The request failed |
add_legendary_skill_point
¶
add_legendary_skill_point(skill: LegendarySkill, *, timeout: float = 5.0) -> AddSkillPointResponse
Buy a Legendary skill level with skill points: the next level of a skill you hold, or the first of one you don't.
The client offers it when the skill is not at its last level, its tier and node are unlocked,
enough points are left (SkillList.available_points) and no sceat skill is being activated;
the server checks the same. Each level bought replaces the one before it in skills.
Client: CastleLegendSkillItem.onClick and canBuy (bundle lines 35643, 35652),
CastleLegendSkillData.parse_SKP (bundle line 112073)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill
|
LegendarySkill
|
The level to buy, e.g. |
required |
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
AddSkillPointResponse
|
The levels bought |
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused: |
GameDataNotLoadedError
|
The game data cannot be loaded |
EmpireTimeoutError / ConnectionClosedError
|
see |
buy_sceat_skill
¶
buy_sceat_skill(skill: SceatSkill, *, timeout: float = 5.0) -> None
Buy a sceat skill level with sceat tokens or imperial ducats, as its row prices it; no rubies are spent.
The client offers the next level of a skill you hold, or the first of one you don't, when its tier
and node are unlocked, you can afford it and no sceat skill is being activated in its Hall of Legends
tab. The reply carries nothing; the client buys nothing more until the next skill list (skl)
arrives, which skills then holds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill
|
SceatSkill
|
The level to buy, a |
required |
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleLegendSkillItem.onClick and canBuy (split.js lines 186511, 186593) with
CastleLegendSkillData.isAnyOtherSkillInProgress (split.js line 576996),
CastleSceatSkillVO.costCurrencyID (split.js line 121552); CastleLegendSkillData.parse_SKL
(split.js line 576615) ends the client's wait
skip_sceat_skill_activation
¶
skip_sceat_skill_activation(skill: SceatSkill, *, spend_rubies: bool = False, timeout: float = 5.0) -> None
Finish a sceat skill's activation now, for rubies; see "Spending rubies" in the guides.
The game skips by Hall of Legends tab, the one skill's tree is in, so a fresh skill list is read
first and nothing is sent unless skill is being activated. The price follows the time left and
your level and is not worked out here, so this always needs spend_rubies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill
|
SceatSkill
|
The sceat skill being activated, as |
required |
spend_rubies
|
bool
|
Allow the rubies it costs; without it nothing is sent |
False
|
timeout
|
float
|
Timeout in seconds, for each request |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
GameDataNotLoadedError
|
The game data cannot be loaded |
CommandError
|
The server refused |
Client: CastleLegendSkillSceatBottomMenu.update and onClick (split.js lines 409704, 409833)
offer the skip only for the skill in progress among the tab's trees, sceatTreeTabMap (split.js
line 576540); SceatSkillConst.getFastCompleteCostC2 (dll) prices it
reset_skills
¶
reset_skills(*, spend_rubies: bool = False, timeout: float = 5.0) -> GetSkillsResponse
Take back every Legendary skill point, and the sceat skills with them.
Free once the reset cooldown of 15 days has run out. Inside it the same request skips the
cooldown for 20 * resets**5 + (points spent + 50) * 30 rubies, priced from a fresh skill
list unless spend_rubies allows any price.
Client: CastleLegendSkillClassicSublayer.onClick (bundle line 78657) opens
CastleLegendSkillCooldownDialog inside the cooldown, whose skipWithRubies sends the
same request (bundle line 78885); LegendSkillConst.resetSkipCostC2 and
RESET_COOLDOWN_IN_SECONDS (dll lines 19474, 19470); CastleLegendSkillData.resetSkills
(bundle line 112104) then asks for the skill list
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spend_rubies
|
bool
|
Allow the rubies a reset inside the cooldown costs |
False
|
timeout
|
float
|
Timeout in seconds, for each request |
5.0
|
Returns:
| Type | Description |
|---|---|
GetSkillsResponse
|
The skill list after the reset, also kept in |
Raises:
| Type | Description |
|---|---|
ValueError
|
The cooldown is running and |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
open_loot_box
¶
open_loot_box(loot_box: LootBox, key: MysteryBoxKey = COMMON, *, open_all: bool = False, timeout: float = 5.0) -> OpenLootBoxResponse
Open a loot box, or every box of the kind, with a mystery box key.
The common key never runs out; a rarer one must be held (currencies) and opens one box
only. The box type's key progress in loot_boxes is set to the reply's; the box count is
not lowered, as in the client, and get_loot_boxes reads the new one. Reward ids in the
reply are resolved through the game data.
Client: RewardHubDialogMysteryBoxItem.fillItem (bundle line 92191) enables the single open
with a held or common key and the open-all with the common key only; OLECommand (bundle line 124819)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loot_box
|
LootBox
|
The box to open, as |
required |
key
|
MysteryBoxKey
|
The key to open it with |
COMMON
|
open_all
|
bool
|
Open every box of the kind; the common key only |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
OpenLootBoxResponse
|
What the boxes gave, and the keys won |
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
select_titles
¶
select_titles(prefix: TitleSystem, suffix: TitleSystem | None = None, *, timeout: float = 5.0) -> SelectTitleResponse
Choose the title systems shown before and after your name.
The dialog offers a system once you hold one of its titles (held_titles). The reply's
systems replace those of title_ranks.
Client: CastleTitleSelectDialog.confirmSelection (bundle line 45050)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
TitleSystem
|
The system shown before your name |
required |
suffix
|
TitleSystem | None
|
The system shown after it; None for none |
None
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
SelectTitleResponse
|
The systems the server set |
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused: |
EmpireTimeoutError / ConnectionClosedError
|
see |
player.models.account¶
Account sections of the login data, and the pushes and replies that bring them again.
Commands:
- gpi: who you are
- vip: VIP status, and asking for it
- drt: seconds until the daily reset
- gatp: the officers' school training program running now
- bie: the global effects a booster event boosts
- pgl: your gift packages and how many you may still send
- gpg: send another player a gift package
- DTS: whether your food production is frozen
- blv: buy the next level with rubies
- gbp: buy the premium flag with rubies
- gpf: whether you own the premium flag
The timed models count from received_at, as the client counts from its timer.
Classes:
| Name | Description |
|---|---|
DailyResetResponse |
When the daily reset comes. |
OfficerBonus |
The bonus a training program gives: an effect and its values, |
OfficerTraining |
The officers' school training program running now. |
ActivateGlobalEffectBoostRequest |
Purchase the running event's ruby boost for a global effect (agb). |
ActivateGlobalEffectBoostResponse |
The status-only acknowledgement of agb; boosted effects arrive separately in bie. |
BuyLevelRequest |
Buy the next level with rubies. |
BuyLevelResponse |
The acknowledgement of a |
BuyPremiumFlagRequest |
Buy the premium flag your castles fly on the map, with rubies. |
BuyPremiumFlagResponse |
The acknowledgement of a |
PremiumFlagResponse |
Whether you own the premium flag your castles fly on the map. |
BoostedGlobalEffectsResponse |
The global effects the running global effect booster event makes stronger. |
PlayerGift |
One gift package you hold: |
PlayerGiftsResponse |
Your gift packages, to send to other players, and how many you may still send. |
SendGiftPackagesRequest |
Send another player gift packages you hold ( |
SendGiftPackagesResponse |
The reply to |
FoodProductionStatus |
Whether your food production is frozen: the client then shows food, mead and beef production and |
VipStatusRequest |
Ask for your VIP status; the server answers with a |
Attributes:
| Name | Type | Description |
|---|---|---|
BUY_LEVEL_RANGE |
The levels the client offers to buy the next level from. |
|
PREMIUM_FLAG_RUBIES |
What the premium flag costs before ruby discounts. |
BUY_LEVEL_RANGE
module-attribute
¶
BUY_LEVEL_RANGE = range(10, 70)
The levels the client offers to buy the next level from.
Client: SplitRunConst.MIN_LEVEL_TO_BUY_LEVEL and MAX_LEVEL_TO_BUY_LEVEL (dll), read by
ButtonBuyLevelComponent.updateButtonVisibility (bundle line 548864)
PREMIUM_FLAG_RUBIES
module-attribute
¶
What the premium flag costs before ruby discounts.
Client: PlayerConst.PREMIUM_FLAG_COST_C2 (dll), priced by getFinalCostsC2 in
CastleBuyPremiumFlagDialog.showLoaded (bundle line 396588)
DailyResetResponse
pydantic-model
¶
Bases: TimedResponse
When the daily reset comes.
Command: drt, as a login section of gbd only.
Client: CastleTimerData.parse_DRT and timeTillDailyResetInSec (bundle lines 112810-112811)
Fields:
seconds
pydantic-field
¶
seconds: ClientNumber = 0
Wire key STR
Seconds until the daily reset when the values were read
OfficerBonus
pydantic-model
¶
Bases: BasePayload
The bonus a training program gives: an effect and its values, [effect_id, [value, ...]].
Client: OfficersSchoolEffectVO.setBonusVOByValueArray (bundle line 144678), which looks the
effect up by id and reads the values with BonusVO.parseFromValueArray
Fields:
Validators:
-
_from_row
OfficerTraining
pydantic-model
¶
Bases: TimedPayload
The officers' school training program running now.
Not a response model: its E is the program's bonus, not an error code.
Command: gatp, as a login section of gbd and a reply; a gtp updates it.
Client: GATPCommand (bundle line 126126), OfficersSchoolData.parse_GATP (bundle line 144606),
OfficersSchoolEffectVO.setBonusVOByValueArray and setActiveTime (bundle lines 144678, 144681),
OfficersSchoolData.getBonusByEffectType (bundle line 144634)
Fields:
-
received_at(float) -
slot_id(ClientInt) -
bonus(OfficerBonus | None) -
seconds(ClientNumber)
Validators:
-
_bonus→bonus
bonus
pydantic-field
¶
bonus: OfficerBonus | None = None
Wire key E
The program's bonus; None for none
seconds
pydantic-field
¶
seconds: ClientNumber = -1
Wire key RS
Seconds the program runs when the values were read, -1 for none
ActivateGlobalEffectBoostRequest
pydantic-model
¶
Bases: BaseRequest
Purchase the running event's ruby boost for a global effect (agb).
Payload: {"GEID": effect_id}
Client: C2SActivateGlobalEffectBuffVO (Game.bundle.e2ca3c4ee155ea53c7c7.js)
Fields:
ActivateGlobalEffectBoostResponse
pydantic-model
¶
Bases: BaseResponse
The status-only acknowledgement of agb; boosted effects arrive separately in bie.
Client: AGBCommand.executeCommand (Game.bundle.e2ca3c4ee155ea53c7c7.js)
Fields:
BuyLevelRequest
pydantic-model
¶
Bases: BaseRequest
Buy the next level with rubies.
Command: blv Payload: {"NL": level}
Client: C2SBuyLevelVO (bundle line 548892), sent by ButtonBuyLevelComponent.onConfirm
(bundle line 548859) with CastleUserData.level + 1 (userLevel + userLegendLevel, bundle line 55080)
Fields:
BuyLevelResponse
pydantic-model
¶
Bases: BaseResponse
The acknowledgement of a blv; it carries nothing.
Command: blv
Client: BLVCommand.executeCommand (bundle line 650885)
Fields:
BuyPremiumFlagRequest
pydantic-model
¶
Bases: BaseRequest
Buy the premium flag your castles fly on the map, with rubies.
Command: gbp Payload: {}
Client: C2SBuyPremiumFlagVO (bundle line 396664), sent by CastleBuyPremiumFlagDialog.onClick
(bundle line 396605); the premium shop offers it while CastleUserData.hasPremiumFlag is false
(CastleFlagPremiumShopVO.canBeBought, bundle line 396457)
BuyPremiumFlagResponse
pydantic-model
¶
Bases: BaseResponse
The acknowledgement of a gbp; it carries nothing.
Command: gbp
Client: GBPCommand.executeCommand (bundle line 651488)
Fields:
PremiumFlagResponse
pydantic-model
¶
Bases: BaseResponse
Whether you own the premium flag your castles fly on the map.
Command: gpf, as a login section of gbd and a push.
Client: GPFCommand.executeCommand (bundle line 652108), registered for S2C_PREMIUM_FLAG_INFO
(gpf, bundle line 618029) and run by CastleExtensionResponseCommand.execute (bundle line 571757)
for that id, only on success; CastleUserData.parse_GPF (bundle line 54052), which skips a falsy
block and reads 1 == PF; GBDCommand.exec (bundle line 651244)
Fields:
Validators:
-
_flag→has_premium_flag
BoostedGlobalEffectsResponse
pydantic-model
¶
Bases: BaseResponse
The global effects the running global effect booster event makes stronger.
The running global effects themselves come with the global effects event, not here.
Command: bie, as a login section of gbd and a push.
Client: BIECommand (bundle line 122579), GlobalEffectData.parse_GIE (bundle line 143676), which
skips a block without GE, and isEffectBoosted (bundle line 143643)
Fields:
-
error_code(int) -
global_effect_ids(tuple[EnumOrInt['GlobalEffect'], ...])
Validators:
-
_listed→global_effect_ids
PlayerGift
pydantic-model
¶
Bases: BasePayload
One gift package you hold: [package_id, amount].
Client: PlayerGiftVO.parseFromArray (bundle line 52178)
Fields:
Validators:
-
_from_row
package_id
pydantic-field
¶
The package, a packages row of the game data
PlayerGiftsResponse
pydantic-model
¶
Bases: BaseResponse
Your gift packages, to send to other players, and how many you may still send.
Command: pgl, as a login section of gbd and a reply.
Client: PGLCommand (bundle line 127961), PlayerGiftData.parse_PGL (bundle line 113571), which skips a
block without G; sendablePackageAmount (bundle line 113613), read at bundle line 44174
Fields:
-
error_code(int) -
gifts(tuple[PlayerGift, ...]) -
sendable_amount(ClientNumber)
Validators:
-
_gifts→gifts
sendable_amount
pydantic-field
¶
sendable_amount: ClientNumber = 0
Wire key RA
Gift packages you may still send; none at 0 or less
SendGiftPackagesRequest
pydantic-model
¶
Bases: BaseRequest
Send another player gift packages you hold (gpg).
Client: GPGCommandVO (bundle line 68352), built as (RID, PID, A) by
CastlePlayerGiftSliderGiveDialog.onBtnOkClick (bundle line 68336)
Fields:
-
receiver_id(int) -
package_id(PackageId) -
amount(int)
SendGiftPackagesResponse
pydantic-model
¶
Bases: BaseResponse
The reply to gpg, which carries nothing the client reads; TOO_MANY_PACKAGES_SENT_TODAY refuses
past the day's limit.
Client: GPGCommand.executeCommand (bundle line 127957)
Fields:
FoodProductionStatus
pydantic-model
¶
Bases: BaseResponse
Whether your food production is frozen: the client then shows food, mead and beef production and consumption as frozen.
Command: DTS, as a login section of gbd and a push.
Client: DTSCommand.executeCommand (bundle line 129363), CastleUserData.parse_DTS (bundle line 9925),
GBDCommand.exec (bundle line 129430)
Fields:
-
error_code(int) -
frozen(bool)
Validators:
-
_flag→frozen
PlayerIdentityResponse
pydantic-model
¶
Bases: BaseResponse
Who you are: the gpi login section, pushed again when it changes.
Command: gpi, as a login section of gbd and a push.
E is your email here, not an error code, so error_code stays 0.
Client: GPICommand.executeCommand (bundle line 129683), CastleUserData.parse_GPI (bundle
line 9873), reading CommKeys.USER_ID (UID), TARGET_PLAYER_ID (PID), PLAYER_NAME
(PN), EMAIL_2 (E), HAS_CONFIRMED_EMAIL (V), ADMIN_SECURITY_LEVEL (CL)
and CTAC
Fields:
-
error_code(int) -
user_id(ClientInt) -
player_id(ClientInt) -
name(str) -
email(str) -
email_confirmed(bool) -
is_cheater(bool) -
accepted_terms(bool)
Validators:
-
_text→name -
_email→email -
_one_flag→email_confirmed -
_above_zero→is_cheater,accepted_terms
VipStatusResponse
pydantic-model
¶
Bases: BaseResponse
Your VIP status: the vip login section, pushed as it changes.
Command: vip, as a login section of gbd, a push, the reply to a VipStatusRequest, and inside
an sbp reply.
Client: VIPCommand.exec (bundle line 653087), CastleVIPData.parse_VIP (bundle line 245599),
which reads each key through int() and keeps no VIP time for a VRS of 0 or less
Fields:
-
error_code(int) -
vip_points(ClientInt) -
vip_level(ClientInt) -
vip_seconds_left(ClientInt) -
used_premium_commanders(ClientInt)
Validators:
-
_no_vip_time→vip_seconds_left
VipStatusRequest
pydantic-model
¶
Bases: BaseRequest
Ask for your VIP status; the server answers with a vip.
Command: vip Payload: {}
Client: C2SVIPInfoEvent (bundle line 400604), sent by CastleVIPData.executeUpdate (bundle line
245782) once the VIP time it knows has run out
player.models.boosters¶
Hiring a booster with rubies.
Commands:
- bis: Hire the instructor
- bms: Hire the marauder
- ovs: Hire an overseer
- bcs: Hire the caravan overloader
- brs: Buy the return speed booster
Classes:
| Name | Description |
|---|---|
HireRequest |
What every booster hire sends: the booster sale it uses. |
HireInstructorRequest |
Hire the instructor. |
HireMarauderRequest |
Hire the marauder. |
HireOverseerRequest |
Hire the overseer of one resource. |
HireCaravanOverloaderRequest |
Hire the caravan overloader. |
BuyReturnSpeedBoosterRequest |
Buy the return speed booster. |
HireResponse |
Your coins and rubies and your boosters after a hire; the boosters also reach |
HireInstructorResponse |
The reply to hiring the instructor, with the joined castle's production area. |
HireMarauderResponse |
The reply to hiring the marauder. |
HireOverseerResponse |
The reply to hiring an overseer. |
HireCaravanOverloaderResponse |
The reply to hiring the caravan overloader. |
BuyReturnSpeedBoosterResponse |
The reply to buying the return speed booster. |
Attributes:
| Name | Type | Description |
|---|---|---|
NO_OFFER |
The |
|
OVERSEERS |
The boosters |
OVERSEERS
module-attribute
¶
OVERSEERS = frozenset({BoosterId.OVERSEER_WOOD, BoosterId.OVERSEER_STONE, BoosterId.OVERSEER_FOOD, BoosterId.OVERSEER_HONEY, BoosterId.OVERSEER_MEAD, BoosterId.OVERSEER_BEEF})
The boosters ovs hires.
HireRequest
pydantic-model
¶
HireInstructorRequest
pydantic-model
¶
Bases: HireRequest
Hire the instructor.
Command: bis Payload: {"PO": offer_id}
Client: C2SInstructorStartVO (bundle line 270788), sent by BuyBoosterCommand.execute
(bundle line 459673) and CastleBuyInstructorDialog.onClick (bundle line 461410) with
CastleBoosterSaleData.getOfferId (bundle line 52882)
Fields:
HireMarauderRequest
pydantic-model
¶
Bases: HireRequest
Hire the marauder.
Command: bms Payload: {"PO": offer_id}
Client: C2SMarauderStartVO (bundle line 270811), sent by BuyBoosterCommand.execute
(bundle line 459673) with CastleBoosterSaleData.getOfferId (bundle line 52882)
Fields:
HireOverseerRequest
pydantic-model
¶
Bases: HireRequest
Hire the overseer of one resource.
Command: ovs Payload: {"T": overseer, "PO": offer_id}
Client: C2SOverseerStartVO (bundle line 213906); BuyBoosterCommand.execute (bundle line
459673) sends CastlePremiumBoostData.BOOST_* (bundle line 81830) for each BoosterConst.OVERSEER_*,
the same numbers, and CastleBuyResourceBoostDialog.onClick (bundle line 82986) sends the booster id itself
Fields:
HireCaravanOverloaderRequest
pydantic-model
¶
Bases: HireRequest
Hire the caravan overloader.
Command: bcs Payload: {"PO": offer_id}
Client: C2SCaravanOverloaderStartVO (bundle line 229369), sent by BuyBoosterCommand.execute
(bundle line 459673) with CastleBoosterSaleData.getOfferId (bundle line 52882)
Fields:
BuyReturnSpeedBoosterRequest
pydantic-model
¶
Bases: HireRequest
Buy the return speed booster.
Command: brs Payload: {"PO": offer_id}
Client: C2SReturnSpeedBoosterStartVO (bundle line 463110), sent by
CastleBuyReturnSpeedBoosterDialog.onClick (bundle line 463069) with
CastleBoosterSaleData.getOfferId (bundle line 52882)
Fields:
HireResponse
pydantic-model
¶
Bases: BaseResponse
Your coins and rubies and your boosters after a hire; the boosters also reach client.player.boosts.
Client: BCSCommand, BMSCommand, BRSCommand, OVSCommand and BISCommand
executeCommand (bundle lines 627398, 627622, 627711, 627756, 627576) hand gcu to
parseGCU and boi to CastlePremiumBoostData.parse_BOI, which skips a falsy one
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
boosts(BoosterInfoResponse | None)
boosts
pydantic-field
¶
boosts: BoosterInfoResponse | None = None
Wire key boi
The boosters after; None when the reply has none
HireInstructorResponse
pydantic-model
¶
Bases: HireResponse
The reply to hiring the instructor, with the joined castle's production area.
Command: bis
Client: BISCommand.executeCommand (bundle line 627576) also hands gpa to the active
area's parseGPA
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
boosts(BoosterInfoResponse | None) -
production_area(CastleProductionArea | None)
production_area
pydantic-field
¶
production_area: CastleProductionArea | None = None
Wire key gpa
The joined castle's production area after; None when the reply has none
HireMarauderResponse
pydantic-model
¶
Bases: HireResponse
The reply to hiring the marauder.
Command: bms
Client: BMSCommand.executeCommand (bundle line 627622)
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
boosts(BoosterInfoResponse | None)
HireOverseerResponse
pydantic-model
¶
Bases: HireResponse
The reply to hiring an overseer.
Command: ovs
Client: OVSCommand.executeCommand (bundle line 627756)
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
boosts(BoosterInfoResponse | None)
HireCaravanOverloaderResponse
pydantic-model
¶
Bases: HireResponse
The reply to hiring the caravan overloader.
Command: bcs
Client: BCSCommand.executeCommand (bundle line 627398)
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
boosts(BoosterInfoResponse | None)
BuyReturnSpeedBoosterResponse
pydantic-model
¶
Bases: HireResponse
The reply to buying the return speed booster.
Command: brs
Client: BRSCommand.executeCommand (bundle line 627711)
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
boosts(BoosterInfoResponse | None)
player.models.economy¶
Your currencies and loot boxes, as the login data and their pushes send them, and opening loot boxes.
Commands:
- gcu: coins and rubies
- sce: special currencies
- gls: your loot boxes and key progress, a push before and a section of
gbd, and on request - ole: open a loot box
Classes:
| Name | Description |
|---|---|
LootBoxAmount |
One kind of loot box you hold: |
LootBoxKeys |
The keys collected towards one loot box type: |
LootBoxesResponse |
Your loot boxes, and the keys collected towards each loot box type. |
OpenLootBoxRequest |
Open a loot box with a mystery box key. |
OpenLootBoxResponse |
What opening a loot box gave. |
LootBoxAmount
pydantic-model
¶
Bases: BasePayload
One kind of loot box you hold: {"ID": loot box, "AMT": amount}.
Client: CastleLootboxData.parse_GLS (bundle line 112332) reads each as an ACollectableItemLootBoxVO
Fields:
-
loot_box_id(EnumOrInt['LootBox']) -
amount(ClientNumber)
LootBoxKeys
pydantic-model
¶
Bases: BasePayload
The keys collected towards one loot box type: {"ID": loot box type, "AMT": keys}.
Client: CastleLootboxData.parse_GLS and setKeyProgress (bundle lines 112332, 112343)
Fields:
-
loot_box_type_id(EnumOrInt['LootBoxType']) -
keys(ClientNumber)
GetLootBoxesRequest
pydantic-model
¶
Bases: BaseRequest
Request your loot boxes and key progress.
Command: gls Payload: {}
Client: C2SGetLootBoxesStatus (bundle line 92219, no fields), sent when
RewardHubMainDialogMysteryBoxes.show opens the mystery boxes (bundle line 92142)
LootBoxesResponse
pydantic-model
¶
Bases: BaseResponse
Your loot boxes, and the keys collected towards each loot box type.
A gls lists the loot boxes whole, but key progress only for some types; the client keeps the
others as they were, and client.state.get_loot_boxes() does the same.
Command: gls, sent before gbd and as the reply to GetLootBoxesRequest.
Client: GLSCommand (bundle line 124800), CastleLootboxData.parse_GLS (bundle line 112332)
Fields:
-
error_code(int) -
loot_boxes(tuple[LootBoxAmount, ...]) -
key_progress(tuple[LootBoxKeys, ...])
Validators:
-
_amounts→loot_boxes -
_keys→key_progress
loot_boxes
pydantic-field
¶
loot_boxes: tuple[LootBoxAmount, ...] = ()
Wire key ALL
The loot boxes you hold
key_progress
pydantic-field
¶
key_progress: tuple[LootBoxKeys, ...] = ()
Wire key KEY
Keys collected per loot box type this packet lists
keys
¶
keys(loot_box_type_id: LootBoxType | int) -> int | float
The keys collected towards a loot box type, 0 when none is known.
OpenLootBoxRequest
pydantic-model
¶
Bases: BaseRequest
Open a loot box with a mystery box key.
Command: ole Payload: {"LID": loot_box_id, "CID": key, "ALL": 1 or 0}
The reward hub opens one box with any key held, the common key always, and every box of the kind with the common key only.
Client: C2SOpenLootBoxVO (bundle line 112368), RewardHubDialogMysteryBoxItem.fillItem and
onClick (bundle lines 92191, 92198)
Fields:
-
loot_box_id(EnumOrInt['LootBox']) -
key(EnumOrInt[MysteryBoxKey]) -
open_all(bool)
key
pydantic-field
¶
key: EnumOrInt[MysteryBoxKey] = MysteryBoxKey.COMMON
Wire key CID
The key to open it with
OpenLootBoxResponse
pydantic-model
¶
Bases: BaseResponse
What opening a loot box gave.
Command: ole Payload: {"LID": .., "LTR": rewards, "LTRR": rewards?, "KBS": key progress, "TBF": key bar fills, "KTR": [{"ID": key, "AMT": amount}, ..], "UKI": key used}
LTR lists the reward id each box drew and LTRR each box's collectable rows, as a live
reply shows. The client reads the rows from LTRR when it is set, else from LTR, and hands
LTR to MysteryBoxOpeningDialogProperties (bundle line 635217) as reward ids, which
getHighestCategoryForRewards compares with the tombola's (bundle line 577800). Rows go into
rewards and ids into reward_ids.
The client sets the box type's key progress to KBS; it does not lower the box count, and the
server sends no gls after an open: a GetLootBoxesRequest reads the new count.
Client: OLECommand.executeCommand (bundle line 634563)
Fields:
-
error_code(int) -
loot_box_id(EnumOrInt['LootBox']) -
rewards(tuple[Collectable, ...]) -
reward_ids(tuple[RewardId, ...]) -
key_progress(ClientNumber) -
key_bar_fills(ClientNumber) -
keys_won(tuple[Collectable, ...]) -
key_used(EnumOrInt[MysteryBoxKey] | None)
Validators:
-
_read_rewards -
_keys→keys_won
rewards
pydantic-field
¶
rewards: tuple[Collectable, ...] = ()
What the boxes gave, the keys won aside
reward_ids
pydantic-field
¶
The reward each box drew, from LTR
key_progress
pydantic-field
¶
key_progress: ClientNumber = 0
Wire key KBS
The keys now collected towards the box's type
key_bar_fills
pydantic-field
¶
key_bar_fills: ClientNumber = 0
Wire key TBF
How often the key bar filled up
key_used
pydantic-field
¶
key_used: EnumOrInt[MysteryBoxKey] | None = None
Wire key UKI
The key the boxes were opened with
CurrencyResponse
pydantic-model
¶
Bases: BaseResponse, CurrencyTotals
Your coins and rubies: the gcu login section, pushed as they change.
Command: gcu, as a login section of gbd, a push, and inside many replies (see CurrencyBlock).
Client: GCUCommand.exec (bundle line 129491), CurrencyData.parseGCU (bundle line 141240)
Fields:
Validators:
SpecialCurrenciesResponse
pydantic-model
¶
Bases: BaseResponse
Your special currencies: the sce login section, pushed as they change.
The payload is a list of [currency_key, amount] pairs. A key the generated Currency
enum lacks stays a str (the client ignores keys its item data lacks).
Command: sce, as a login section of gbd and a push.
Client: SCECommand.exec (bundle line 129774), CurrencyData.parseSCE (bundle line
141231), which sets int(amount) on the currency with that key
Fields:
Validators:
-
_pairs
player.models.feasts¶
Holding a feast for faster recruitment in every castle.
Commands:
- bfs: Hold a feast, or extend the one you hold
Classes:
| Name | Description |
|---|---|
HoldFeastRequest |
Hold a feast paid from one of your castles, or extend the feast you hold. |
HoldFeastResponse |
The feast you hold after holding or extending one; it also reaches |
HoldFeastRequest
pydantic-model
¶
Bases: BaseRequest
Hold a feast paid from one of your castles, or extend the feast you hold.
Command: bfs Payload: {"T": feast, "CID": castle, "KID": kingdom, "PO": offer_id, "PWR": 0 or 1}
The feast dialogs send PO -1 and PWR 0; after a refusal for missing food, the resource dialog sends it again with PWR 1, paying the missing food with rubies, and as PO the resource merchant's private offer, -1 when none runs.
Client: C2SFestivalStartVO (split.js line 169260), sent by CastleFestivalDialog.onClick (split.js line
334522), CastleExtendFestivalDialog.onClick (split.js line 334119) and
CastleResourceWaitDialogProperties.getResourceSkipCommand (split.js line 183792), which
CastleHandleServerErrorCommand.handleGameSpecificServerError (split.js line 616535) opens on
NOT_ENOUGH_RESOURCES; CastlePrivateOfferData.getPrivateOfferMerchantID (split.js line 660957)
Fields:
-
feast_id(EnumOrInt['Feast']) -
castle_id(int) -
kingdom(Kingdom) -
private_offer_id(int) -
pay_with_rubies(bool)
HoldFeastResponse
pydantic-model
¶
Bases: BaseResponse, ActiveFeast
The feast you hold after holding or extending one; it also reaches client.player.boosts.
Command: bfs Payload: {"T": feast, "RT": seconds_left}
Client: BFSCommand.executeCommand (split.js line 627488) hands it to
CastlePremiumBoostData.parse_bfs (split.js line 81585)
Fields:
-
received_at(float) -
feast_id(EnumOrInt['Feast'] | None) -
seconds(ClientNumber) -
error_code(int)
player.models.info¶
Player protocol models.
Commands:
- gdi: Get detailed player info (including castle list with capture info)
- wsp: World search player (search by name)
Classes:
| Name | Description |
|---|---|
LocationCapture |
One of the player's locations that someone occupies, from the gdi castle list. |
PlayerOwnerInfo |
The gdi reply's |
GetPlayerInfoRequest |
Get detailed player information including castle list. |
GetPlayerInfoResponse |
Response containing detailed player information. |
SearchPlayerRequest |
Find a player by name. |
SearchPlayerResponse |
Response to a player search. |
LocationCapture
pydantic-model
¶
Bases: BasePayload
One of the player's locations that someone occupies, from the gdi castle list.
Built from a CastleInfo that is occupied: its occupier_id is above -1, as the
client's isOccupied checks.
Client: InteractiveMapobjectVO.parseAreaInfo (bundle line 3631) and
CapitalMapobjectVO.parseAreaInfo (bundle line 18729) read the occupier
as occupierID
Fields:
-
location_id(int) -
location_type(MapItemType) -
x(int) -
y(int) -
kingdom(Kingdom) -
capturer_id(int)
location_type
pydantic-field
¶
location_type: MapItemType = MapItemType.EMPTY
The location's area type
PlayerOwnerInfo
pydantic-model
¶
Bases: PlayerProfileBase
The gdi reply's O block: the player's owner record.
Client: GDICommand.executeCommand (bundle line 129458) reads it with
CastleOtherPlayerData.parseOwnerInfo (bundle line 138996)
Fields:
-
player_id(ParseInt) -
name(str) -
emblem(OwnerCrest | None) -
level(ParseInt) -
legendary_level(ParseInt) -
beginner_protection_seconds(ParseInt) -
honor(ParseInt) -
might(ParseInt) -
top_ranking(ParseInt) -
is_ruin(bool) -
alliance_id(int) -
alliance_rank(int | None) -
alliance_name(str) -
is_searching_alliance(bool) -
revenge_protection_seconds(ParseInt) -
castle_positions(OwnerPositions) -
village_positions(OwnerPositions) -
has_premium_flag(bool) -
has_vip_flag(bool) -
is_dummy(bool) -
achievement_points(ParseInt) -
relocation_remaining_seconds(int) -
faction(OwnerFaction | None) -
alliance_emblem(AllianceEmblem | None) -
title_suffix(EnumOrInt['Title'] | None) -
title_prefix(EnumOrInt['Title'] | None) -
via_refer_a_friend(bool) -
received_at(float) -
received_at_wall(float)
GetPlayerInfoRequest
pydantic-model
¶
Bases: BaseRequest
Get detailed player information including castle list.
Command: gdi Payload: {"PID": player_id}
Returns owner info (O) and castle list (gcl.C) with capture status.
Client: C2SGetDetailPlayerInfo (bundle line 27021)
Fields:
player_id
pydantic-field
¶
player_id: int
Wire key PID
A player's id, e.g. MapObject.owner_id from a map scan or client.player.search_player_by_name(), or AllianceMember.player_id
accepts_reply
¶
Whether a gdi reply is about this player: its owner record's OID is PID.
Client: GDICommand.executeCommand (bundle line 129458) reads the player from
O.OID; CastleSendGoodsDialog.handleCastlesList (line 27122) keeps only the reply
about the player it asked for.
GetPlayerInfoResponse
pydantic-model
¶
Bases: BaseResponse
Response containing detailed player information.
Command: gdi Response format: { "O": { ...player fields... }, "gcl": {"PID": ..., "C": [{"KID": ..., "AI": [{"AI": [...], ...}]}]} }
Client: GDICommand.executeCommand (bundle line 129458) reads O with
parseOwnerInfo and hands gcl to the same
CastleListVO.parseCastleList as the gcl command.
Fields:
-
error_code(int) -
owner(PlayerOwnerInfo | None) -
castle_list(GetCastlesResponse)
Validators:
-
_fold_landmark_lists_into_gcl -
_castle_list_needs_an_object→castle_list
model_config
class-attribute
¶
model_config: ConfigDict = ConfigDict(populate_by_name=True, extra='allow')
castle_list
pydantic-field
¶
castle_list: GetCastlesResponse
Wire key gcl
The player's castles, outposts and landmarks, shaped as a GetCastlesResponse
alliance_id
property
¶
alliance_id: int
The player's alliance id, -1 when the player is in none or the reply has no owner.
has_bird
property
¶
has_bird: bool
Whether the player has peace protection left now; False once it has run out or without owner.
has_beginner_protection
property
¶
has_beginner_protection: bool
Whether the player has beginner protection left now; False once it has run out or without owner.
revenge_protection_end
property
¶
revenge_protection_end: float | None
When peace protection ends, in time.monotonic() seconds; None without protection or owner.
get_castles
¶
get_castles() -> list[CastleInfo]
All castles, outposts and landmarks across all kingdoms.
get_location_captures
¶
get_location_captures() -> list[LocationCapture]
Extract locations that are being captured.
Returns:
| Type | Description |
|---|---|
list[LocationCapture]
|
List of LocationCapture objects for locations with active captures. |
SearchPlayerRequest
pydantic-model
¶
Bases: BaseRequest
Find a player by name.
Command: wsp Payload: {"PN": player_name}, the name encoded as chat text
Client: C2SSearchPlayerVO (bundle line 66000), sent by
CastleWorldmapData.searchPlayerByName (bundle line 19009)
Fields:
SearchPlayerResponse
pydantic-model
¶
Bases: BaseResponse
Response to a player search.
Command: wsp
Client: WSPCommand.executeCommand (bundle line 131619) reads gaa.OI
with parseOwnerInfoArray and gaa.AI with parseAreaInfos, as the
fnm reply does, then CastleWorldmapData.parseSearchInfos (bundle line
19010) opens the area at X/Y, the found player's castle.
Fields:
Validators:
-
_area_needs_an_object→area
model_config
class-attribute
¶
model_config: ConfigDict = ConfigDict(populate_by_name=True, extra='allow')
player.models.profile¶
The owner record both the alliance member list and the gdi player info send.
AllianceMember (ain, alliance.models.info) and PlayerOwnerInfo (gdi, player.models.info) subclass PlayerProfileBase.
Classes:
| Name | Description |
|---|---|
PlayerProfileBase |
A player's owner record. |
PlayerProfileBase
pydantic-model
¶
Bases: BasePayload
A player's owner record.
Client: WorldMapOwnerInfoVO.fillFromParamObject (bundle line 10794),
which both the ain member list and the gdi owner go through
(CastleOtherPlayerData.parseOwnerInfo, bundle line 138996);
WorldMapOwnerInfoVO.parsePosList (bundle line 10795) for AP and VP.
The protection times count from received_at, as the client counts them from the CachedTimer
reading parseOwnerInfo takes (bundle line 138997).
received_at_wall is stamped with it, for the *_utc ends: the wall clock at reading.
Fields:
-
player_id(ParseInt) -
name(str) -
emblem(OwnerCrest | None) -
level(ParseInt) -
legendary_level(ParseInt) -
beginner_protection_seconds(ParseInt) -
honor(ParseInt) -
might(ParseInt) -
top_ranking(ParseInt) -
is_ruin(bool) -
alliance_id(int) -
alliance_rank(int | None) -
alliance_name(str) -
is_searching_alliance(bool) -
revenge_protection_seconds(ParseInt) -
castle_positions(OwnerPositions) -
village_positions(OwnerPositions) -
has_premium_flag(bool) -
has_vip_flag(bool) -
is_dummy(bool) -
achievement_points(ParseInt) -
relocation_remaining_seconds(int) -
faction(OwnerFaction | None) -
alliance_emblem(AllianceEmblem | None) -
title_suffix(EnumOrInt['Title'] | None) -
title_prefix(EnumOrInt['Title'] | None) -
via_refer_a_friend(bool) -
received_at(float) -
received_at_wall(float)
beginner_protection_seconds
pydantic-field
¶
beginner_protection_seconds: ParseInt = 0
Wire key RNP
Seconds of beginner protection left
alliance_id
pydantic-field
¶
alliance_id: int = -1
Wire key AID
Alliance id; -1 when the player is in none
alliance_rank
pydantic-field
¶
alliance_rank: int | None = None
Wire key AR
Rank in the alliance, an AllianceRank value; None when unreadable
is_searching_alliance
pydantic-field
¶
is_searching_alliance: bool = False
Wire key SA
The player is looking for an alliance
revenge_protection_seconds
pydantic-field
¶
revenge_protection_seconds: ParseInt = 0
Wire key RPT
Seconds of peace protection left
has_premium_flag
pydantic-field
¶
has_premium_flag: bool = False
Wire key PF
The player has the premium flag
is_dummy
pydantic-field
¶
is_dummy: bool = False
Wire key DUM
A placeholder record, not a real player
achievement_points
pydantic-field
¶
achievement_points: ParseInt = 0
Wire key AVP
Achievement points
relocation_remaining_seconds
pydantic-field
¶
relocation_remaining_seconds: int = 0
Wire key RRD
Seconds until the player's castle relocation ends
alliance_emblem
pydantic-field
¶
alliance_emblem: AllianceEmblem | None = None
Wire key aee
The alliance's crest; None outside an alliance
title_suffix
pydantic-field
¶
title_suffix: EnumOrInt['Title'] | None = None
Wire key SUF
The title shown after the name; None when unsent or none
title_prefix
pydantic-field
¶
title_prefix: EnumOrInt['Title'] | None = None
Wire key PRE
The title shown before the name; None when unsent or none
via_refer_a_friend
pydantic-field
¶
via_refer_a_friend: bool = False
Wire key IRF
The player joined through a referral
received_at
pydantic-field
¶
received_at: float
When the values were read, in time.monotonic() seconds
received_at_wall
pydantic-field
¶
received_at_wall: float
When the values were read, in time.time() seconds
is_in_alliance
property
¶
is_in_alliance: bool
Whether the player is in an alliance.
Client: WorldMapOwnerInfoVO.isInAlliance (bundle line 10834)
alliance_rank_enum
property
¶
alliance_rank_enum: AllianceRank | None
alliance_rank as an AllianceRank, None for a value the client does not define.
is_leader
property
¶
is_leader: bool
Whether the player leads their alliance: rank 0.
Client: AllianceInfoVO.allianceLeader (bundle line 25986) is the member whose allianceRank is 0
has_bird
property
¶
has_bird: bool
Whether the player has peace protection left now; False once it has run out.
Client: WorldMapOwnerInfoVO.isPeaceProtected (bundle line 10808)
has_beginner_protection
property
¶
has_beginner_protection: bool
Whether the player has beginner protection left now; False once it has run out.
Client: WorldMapOwnerInfoVO.isNoobProtected (bundle line 10806)
revenge_protection_end
property
¶
revenge_protection_end: float | None
When peace protection ends, in time.monotonic() seconds; None without protection.
beginner_protection_end
property
¶
beginner_protection_end: float | None
When beginner protection ends, in time.monotonic() seconds; None without protection.
revenge_protection_end_utc
¶
revenge_protection_end_utc() -> datetime | None
When peace protection ends, as a UTC datetime; None without protection.
Counted from received_at_wall, not from now, so it stays the same
for the same record.
beginner_protection_end_utc
¶
beginner_protection_end_utc() -> datetime | None
When beginner protection ends, as a UTC datetime; None without protection.
Counted from received_at_wall, not from now, so it stays the same
for the same record.
remaining_revenge_protection_seconds
¶
Seconds of peace protection left, 0 when none.
Client: WorldMapOwnerInfoVO.remainingPeaceTime (bundle line 10804), counted from the
CachedTimer reading fillFromParamObject keeps (bundle line 10794)
remaining_beginner_protection_seconds
¶
Seconds of beginner protection left, 0 when none.
Client: WorldMapOwnerInfoVO.remainingNoobTime (bundle line 10802), counted from the
CachedTimer reading fillFromParamObject keeps (bundle line 10794)
player.models.progress¶
The player's progress, as the login data and its pushes send it.
Commands:
- gxp: level and XP
- glu: a level-up
- gho: honor and ranking points
- rei: research
- boi: boosters, the premium account and production slots (bfs: the feast), on request too
- gmu: might points
- ufa: glory points
- ufp: gallantry points
- uar: top-X title ranks, the Storm Islands title and the displayed title systems
- uht: when the glory top-X titles reset
- iot: titles info, which the client ignores
- apt: assigning a Storm Islands title
- ste: choosing the displayed title systems
- vli: achievements
- vfi: an achievement finished
- gri: relocation
Each model is read once and never changes; the times in it count from received_at.
Classes:
| Name | Description |
|---|---|
Booster |
One booster of a |
ActiveFeast |
The feast you hold, for faster recruitment in every castle: a |
GetBoostersRequest |
Request your boosters, premium account, production slots and feast. |
BoosterInfoResponse |
Your boosters, premium account, production slots and feast. |
MightPointsResponse |
Your might points. |
GloryPointsResponse |
Your glory points, which give the glory titles. |
GallantryPointsResponse |
Your gallantry points, which give the Berimond titles. |
TopTitleRanking |
One title system's top-X standing: a |
StormIslandsTitle |
A |
AllianceCityTitle |
A |
TitleRanksResponse |
Your top-X title ranks, Storm Islands title and the title systems your name shows. |
GetTitleRanksRequest |
Ask for your top-X title ranks, Storm Islands title and displayed title systems; answered with a |
GloryTitleResetResponse |
When the glory system's top-X titles reset; the server pushes it, the client has no request for it. |
TitleInfoResponse |
A titles info push. The client reads nothing from it, so its body is kept only as sent. |
AssignTitleRequest |
Give a Storm Islands title to a player, or take it back. |
AssignTitleResponse |
A Storm Islands title given or taken back, as the answer to an |
AchievementProgress |
One achievement's progress, an entry of a |
AchievementsResponse |
Your achievement points, finished achievements and progress. |
GetAchievementsRequest |
Ask for your achievements; answered with a |
AchievementFinishedResponse |
An achievement you finished, pushed by the server with the coins, rubies and castle resources after its rewards. |
RelocationInfoResponse |
Your castle relocations: how many, the one running and the cooldown. |
SelectTitleRequest |
Choose the title systems shown before and after your name. |
SelectTitleResponse |
The title systems your name shows now. |
Attributes:
| Name | Type | Description |
|---|---|---|
PERMANENT_BOOSTER_DURATION |
|
PERMANENT_BOOSTER_DURATION
module-attribute
¶
BoosterConst.PERMANENT_BOOSTER_DURATION (dll): a booster's RT when it never runs out
Booster
pydantic-model
¶
Bases: TimedPayload
One booster of a boi's BO list.
Client: CastleHeroDefaultBoosterShopVO.parseServerInfo (bundle line 8677), remainingTimeInSeconds
and isActive (bundle lines 8678-8682); the subclasses that read B (bundle lines 90338, 90365,
90670, 90864)
Fields:
-
received_at(float) -
booster_id(ClientInt) -
level(ClientInt) -
seconds(ClientInt) -
purchase_count(int | float | None) -
bonus_percent(ClientInt | None)
Validators:
-
_count→purchase_count
seconds
pydantic-field
¶
seconds: ClientInt = 0
Wire key RT
Seconds left when the values were read; PERMANENT_BOOSTER_DURATION for ever
purchase_count
pydantic-field
¶
Wire key PC
How many times in a row it was bought; None when not sent
bonus_percent
pydantic-field
¶
bonus_percent: ClientInt | None = None
Wire key B
Its bonus in percent, if it has one
remaining_seconds
¶
Seconds left, -1 at least; infinite for a permanent booster.
ActiveFeast
pydantic-model
¶
Bases: TimedPayload
The feast you hold, for faster recruitment in every castle: a boi's bfs, or a bfs reply.
Client: FestivalVO.fillFromParamObject, parseDuration and isActive (split.js lines 459800-459826);
getFestivalItemByID finds no feast for a T of -1
Fields:
-
received_at(float) -
feast_id(EnumOrInt['Feast'] | None) -
seconds(ClientNumber)
feast_id
pydantic-field
¶
feast_id: EnumOrInt['Feast'] | None = 0
Wire key T
The feast; None when the server sends -1 for no feast
seconds
pydantic-field
¶
seconds: ClientNumber = 0
Wire key RT
Seconds left when the values were read
GetBoostersRequest
pydantic-model
¶
Bases: BaseRequest
Request your boosters, premium account, production slots and feast.
Command: boi Payload: {}
Client: C2SBoosterInfoVO (bundle line 149206), sent by CastlePremiumBoostData.executeUpdate (bundle
line 81493) when a booster runs out, CastleRecruitDialogUnits.onBoostUpdate (bundle line 123352) and
CastleVIPData.executeUpdate (bundle line 245782) when VIP time ends
BoosterInfoResponse
pydantic-model
¶
Bases: TimedResponse
Your boosters, premium account, production slots and feast.
A boi lists only some boosters; the client keeps the others as they were, and
client.state.get_boosts() does the same.
Command: boi, as a login section of gbd, a push, and inside the replies to buying a booster
(bcs, bds, bis, bms, brs, ovs, ups, btx).
Client: CastlePremiumBoostData.parse_BOI (bundle line 15202), PremiumAccountVO.parseServerInfo,
isActive, remainingTimeInSeconds and premiumAccountType (bundle lines 90230-90235),
parse_bfs (bundle line 15218)
Fields:
-
received_at(float) -
error_code(int) -
boosters(tuple[Booster, ...]) -
premium_seconds(ClientNumber) -
premium_type(EnumOrInt[PremiumAccountType] | None) -
unit_slots(Numbers) -
tool_slots(Numbers) -
feast(ActiveFeast | None)
Validators:
-
_boosters→boosters -
_feast→feast -
_premium_type→premium_type
boosters
pydantic-field
¶
Wire key BO
The boosters this packet lists
premium_seconds
pydantic-field
¶
premium_seconds: ClientNumber = 0
Wire key PA
Seconds of premium account left when the values were read
premium_type
pydantic-field
¶
premium_type: EnumOrInt[PremiumAccountType] | None = None
Wire key PT
The premium account's type; None when the packet names none
unit_slots
pydantic-field
¶
unit_slots: Numbers = ()
Wire key SU
Unit production slots: above 0 bought, below 0 permanent
tool_slots
pydantic-field
¶
tool_slots: Numbers = ()
Wire key ST
Tool production slots: above 0 bought, below 0 permanent
feast
pydantic-field
¶
feast: ActiveFeast | None = None
Wire key bfs
The feast you hold; None when not sent
premium_remaining_seconds
¶
Seconds of premium account left, 0 when it is not active.
is_premium_active
¶
Whether the premium account runs.
premium_account_type
¶
premium_account_type(now: float | None = None) -> PremiumAccountType | int | None
The premium account's type while it runs, else None.
MightPointsResponse
pydantic-model
¶
Bases: TimedResponse
Your might points.
Command: gmu, as a login section of gbd and a push. The client reads one only
when it has both MP and HMP.
Client: MightData.parse_GMU (bundle line 113517)
Fields:
GloryPointsResponse
pydantic-model
¶
Bases: TimedResponse
Your glory points, which give the glory titles.
Command: ufa, as a login section of gbd and a push.
Client: CastleTitleData.parseUFA (bundle line 21038), which parseInt s a string and keeps a number
Fields:
-
received_at(float) -
error_code(int) -
glory_points(int | float | None) -
highest_glory_points(int | float | None)
Validators:
-
_points→glory_points,highest_glory_points
GallantryPointsResponse
pydantic-model
¶
Bases: TimedResponse
Your gallantry points, which give the Berimond titles.
Command: ufp, a push. The client ignores the copy in gbd.
Client: UFPCommand (bundle line 121010), CastleTitleData.parseUFP (bundle line 21039)
Fields:
TopTitleRanking
pydantic-model
¶
Bases: TimedPayload
One title system's top-X standing: a uar's FTM (glory) or BTM (Berimond).
Client: CastleTitleData.parseUAR (bundle line 21022)
Fields:
-
received_at(float) -
top_rank(ClientInt) -
reset_seconds(ClientNumber) -
thresholds(tuple[int, ...]) -
top_player_id(int | None)
Validators:
-
_thresholds→thresholds -
_player_id→top_player_id
top_rank
pydantic-field
¶
top_rank: ClientInt = 0
Wire key CTXT
Your rank for the system's top-X titles, -1 or 0 for none
reset_seconds
pydantic-field
¶
reset_seconds: ClientNumber = 0
Wire key RS
Seconds until the top-X titles reset
thresholds
pydantic-field
¶
Wire key NTFP
The points the top-X titles need, highest title first
StormIslandsTitle
pydantic-model
¶
Bases: BasePayload
A uar's ITM. Client: CastleTitleData.parseIslandDataFromServer (bundle lines 21023-21027)
Fields:
Validators:
-
_held→title_id
AllianceCityTitle
pydantic-model
¶
Bases: BasePayload
A uar's ATM. Client: CastleTitleData.parseAllianceCityDataFromServer (bundle lines 21028-21036)
Fields:
Validators:
TitleRanksResponse
pydantic-model
¶
Bases: TimedResponse
Your top-X title ranks, Storm Islands title and the title systems your name shows.
Command: uar, as a login section of gbd and a push.
Client: CastleTitleData.parseUAR (bundle line 21022)
Fields:
-
received_at(float) -
error_code(int) -
glory(TopTitleRanking) -
gallantry(TopTitleRanking) -
storm_islands_title(StormIslandsTitle) -
alliance_city_title(AllianceCityTitle | None) -
prefix_system(EnumOrStr[TitleSystem] | None) -
suffix_system(EnumOrStr[TitleSystem] | None)
Validators:
-
_block→glory,gallantry,storm_islands_title -
_city→alliance_city_title -
_system→prefix_system,suffix_system
storm_islands_title
pydantic-field
¶
storm_islands_title: StormIslandsTitle
Wire key ITM
Your Storm Islands title
alliance_city_title
pydantic-field
¶
alliance_city_title: AllianceCityTitle | None = None
Wire key ATM
The alliance city title; None when not sent
prefix_system
pydantic-field
¶
prefix_system: EnumOrStr[TitleSystem] | None = None
Wire key PFX
The title system shown before your name; None when not sent
suffix_system
pydantic-field
¶
suffix_system: EnumOrStr[TitleSystem] | None = None
Wire key SFX
The title system shown after your name; None when not sent
GetTitleRanksRequest
pydantic-model
¶
Bases: BaseRequest
Ask for your top-X title ranks, Storm Islands title and displayed title systems; answered with a uar.
Command: uar Payload: {}
Client: C2SUserAchievedRanksVO (bundle line 55542), sent as the Storm Islands title ranking opens
(CastleEilandRankingDialogTitle.show, bundle line 98292) and after every apt (bundle line 123625);
UARCommand.executeCommand (bundle line 121034) hands the reply to parseUAR
GloryTitleResetResponse
pydantic-model
¶
Bases: TimedResponse
When the glory system's top-X titles reset; the server pushes it, the client has no request for it.
Command: uht Payload: {"RS": seconds}
Client: UHTCommand.executeCommand (bundle line 129926), CastleTitleData.parseUHT (bundle line 21048),
which reads parseInt(RS) into the glory top-X reset time
Fields:
TitleInfoResponse
pydantic-model
¶
Bases: BaseResponse
A titles info push. The client reads nothing from it, so its body is kept only as sent.
Command: iot
Client: IOTCommand.executeCommand (bundle line 123682) hands it to CastleTitleData.parseIOT
(bundle line 21045), which is empty
Fields:
AssignTitleRequest
pydantic-model
¶
Bases: BaseRequest
Give a Storm Islands title to a player, or take it back.
Command: apt Payload: {"TI": title_id, "PN": player name, "" to take the title back}
Client: C2SAssignTitleVO (bundle line 98387), sent by
CastleEilandAssignTitleDialog.onConfirmAssignment (bundle line 98376)
Fields:
-
title_id(EnumOrInt['Title']) -
player_name(str)
AssignTitleResponse
pydantic-model
¶
Bases: BaseResponse
A Storm Islands title given or taken back, as the answer to an AssignTitleRequest.
The client reads one without a player name as your own title.
Command: apt Payload: {"TI": title_id, "PN": player name}, either left out, or no body
Client: APTCommand.executeCommand (split.js line 630637): without a truthy PN the title is
yours (CastleTitleData.parseAPT, split.js line 109607, which reads a truthy TI); either way it
asks for a uar
Fields:
-
error_code(int) -
title_id(EnumOrInt['Title'] | None) -
player_name(str | None)
Validators:
-
_title→title_id -
_name→player_name
AchievementProgress
pydantic-model
¶
Bases: BasePayload
One achievement's progress, an entry of a vli's RA.
Client: CastleAchievementData.parse_RA (bundle line 29838), AchievementVO.setProgress (bundle line 92889)
Fields:
-
achievement_id(Literal[0] | EnumOrInt['Achievement']) -
progress(Numbers)
AchievementsResponse
pydantic-model
¶
Bases: TimedResponse
Your achievement points, finished achievements and progress.
A vli adds to what the client knows: finished achievements stay finished, and an
achievement it does not list keeps its progress. client.state.get_achievements() does the same.
Command: vli, as a login section of gbd and a push.
Client: CastleAchievementData.parse_vli, parse_RA and parse_FA (bundle lines 29837-29842)
Fields:
-
received_at(float) -
error_code(int) -
achievement_points(ClientInt) -
finished_achievement_ids(tuple[EnumOrInt['Achievement'], ...]) -
progress(tuple[AchievementProgress, ...])
Validators:
-
_progress→progress
achievement_points
pydantic-field
¶
achievement_points: ClientInt = 0
Wire key AVP
Achievement points
finished_achievement_ids
pydantic-field
¶
Wire key FA
Finished achievements
progress
pydantic-field
¶
progress: tuple[AchievementProgress, ...] = ()
Wire key RA
Progress of the achievements this packet lists
GetAchievementsRequest
pydantic-model
¶
Bases: BaseRequest
Ask for your achievements; answered with a vli.
Command: vli Payload: {}
Client: C2SAchievementListVO (bundle line 106992), sent as the achievements dialog opens
(CastleAchievementDialog.showLoaded, bundle line 106960)
AchievementFinishedResponse
pydantic-model
¶
Bases: BaseResponse
An achievement you finished, pushed by the server with the coins, rubies and castle resources after its rewards.
The client only shows it: the achievement's state comes with the next vli.
Command: vfi Payload: {"AID": achievement_id, "gcu": {..}, "grc": {..}}
Client: VFICommand.exec (bundle line 121164), which parses gcu, the joined castle's grc
when sent, and opens the level-up dialog or the achievement popup for AID
Fields:
-
error_code(int) -
achievement_id(EnumOrInt['Achievement']) -
currencies(CurrencyBlock) -
resources(CastleResources | None)
Validators:
-
_achievement→achievement_id -
_resources→resources
achievement_id
pydantic-field
¶
achievement_id: EnumOrInt['Achievement']
Wire key AID
The achievement finished
resources
pydantic-field
¶
resources: CastleResources | None = None
Wire key grc
The castle's resources after; None when not sent
RelocationInfoResponse
pydantic-model
¶
Bases: TimedResponse
Your castle relocations: how many, the one running and the cooldown.
Command: gri, as a login section of gbd and a push.
Client: CastleUserData.parse_GRI (bundle line 9910), remainingRelocationDuration and
remainingRelocationCooldown
Fields:
-
received_at(float) -
error_code(int) -
relocation_count(ClientInt) -
relocation_seconds(ClientNumber) -
relocation_mode(int | None) -
cooldown_seconds(ClientNumber) -
destination_x(ClientInt) -
destination_y(ClientInt)
Validators:
-
_mode→relocation_mode
relocation_seconds
pydantic-field
¶
relocation_seconds: ClientNumber = 0
Wire key RD
Seconds left on the running relocation when the values were read
relocation_mode
pydantic-field
¶
relocation_mode: int | None = None
Wire key JM
The relocation's mode: its time counts only while this is 0, and the client redraws the map at OX/OY for 1; None when not sent
cooldown_seconds
pydantic-field
¶
cooldown_seconds: ClientNumber = 0
Wire key RMC
Seconds until you may relocate again, when the values were read
destination_x
pydantic-field
¶
destination_x: ClientInt = 0
Wire key DX
The relocation's destination X
destination_y
pydantic-field
¶
destination_y: ClientInt = 0
Wire key DY
The relocation's destination Y
remaining_relocation_seconds
¶
Seconds left on the running relocation, 0 when none runs.
SelectTitleRequest
pydantic-model
¶
Bases: BaseRequest
Choose the title systems shown before and after your name.
Command: ste Payload: {"PRE": prefix system, "SUF": suffix system, "" for none}
The dialog offers the systems whose titles you hold.
Client: C2SSelectTitleVO (bundle line 45062), CastleTitleSelectDialog.confirmSelection
(bundle line 45050)
Fields:
-
prefix(TitleSystem) -
suffix(TitleSystem | Literal[''])
suffix
pydantic-field
¶
suffix: TitleSystem | Literal[''] = ''
Wire key SUF
The system shown after your name; "" for none
SelectTitleResponse
pydantic-model
¶
Bases: BaseResponse
The title systems your name shows now.
Command: ste Payload: {"PFX": prefix system, "SFX": suffix system}, either left out, or no body
Client: STECommand.executeCommand (bundle line 128925), CastleTitleData.parseSTE
(bundle line 21041), which sets each only when it is truthy
Fields:
-
error_code(int) -
prefix_system(EnumOrStr[TitleSystem] | None) -
suffix_system(EnumOrStr[TitleSystem] | None)
Validators:
-
_system→prefix_system,suffix_system
prefix_system
pydantic-field
¶
prefix_system: EnumOrStr[TitleSystem] | None = None
Wire key PFX
The system shown before your name; None when not sent
suffix_system
pydantic-field
¶
suffix_system: EnumOrStr[TitleSystem] | None = None
Wire key SFX
The system shown after your name; None when not sent
ExperienceResponse
pydantic-model
¶
Bases: BaseResponse
Your level and XP: the gxp login section, pushed as they change.
The client ignores the LL, XPFCL and XPTNL the server sends alongside and computes
the Legendary level and the level's XP range from these two; so does client.state.
Command: gxp, as a login section of gbd, a push, and inside a glu.
Client: GXPCommand.executeCommand (bundle line 129719), CastleUserData.parse_GXP (bundle
line 9878), which reads int(e.XP) and LVL as sent
Fields:
Validators:
-
_level→level
HonorResponse
pydantic-model
¶
Bases: BaseResponse
Your honor and ranking points: the gho login section, pushed as they change.
Command: gho, as a login section of gbd and a push.
Client: GHOCommand.executeCommand (bundle line 129559), CastleUserData.parse_GHO (bundle
line 9875), which reads both through int()
Fields:
LevelUpResponse
pydantic-model
¶
Bases: BaseResponse
A level-up: your new currencies and XP, and the level the client's dialog shows.
Command: glu, a push.
Client: GLUCommand.executeCommand (bundle line 129619), which hands gcu to
CurrencyData.parseGCU and then gxp to CastleUserData.parse_GXP; int(L) and
1 == LL only drive the level-up dialog and tracking
Fields:
-
error_code(int) -
currencies(CurrencyBlock) -
experience(ExperienceResponse | None) -
level(ClientInt) -
is_legendary_level_up(bool)
Validators:
-
_experience→experience -
_legendary_flag→is_legendary_level_up
currencies
pydantic-field
¶
currencies: CurrencyBlock = None
Wire key gcu
Coins and rubies after the level-up
experience
pydantic-field
¶
experience: ExperienceResponse | None = None
Wire key gxp
Level and XP after the level-up
player.titles¶
The titles you hold, worked out from your points and ranks as the client does.
Client: CastleTitleData (bundle lines 21000-21130)
Functions:
| Name | Description |
|---|---|
titles_in_order |
A title system's title ids, from its first title along each title's next one. |
held_titles |
The glory or Berimond titles you hold, lowest first. |
storm_islands_title_chain |
The Storm Islands titles you hold with one: it and every title below it, lowest first. |
player_title_ids |
Every title you hold, as the client lists them: glory, then Berimond, then Storm Islands. |
titles_in_order
¶
titles_in_order(system: TitleSystem, *, game_data: GameData | None = None) -> list[Title | int]
A title system's title ids, from its first title along each title's next one.
Client: CastleTitleData.setupNextTitles (bundle line 21016) and orderTitlesInSystem
(bundle line 21058)
held_titles
¶
held_titles(system: TitleSystem, points: float | None, top_rank: int | None, *, game_data: GameData | None = None) -> list[Title | int]
The glory or Berimond titles you hold, lowest first.
Each title in order is held while its points threshold is reached, or for a top-X title while your rank is above 0 and within its top X; the first one missed ends the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_data
|
GameData | None
|
Optional tables override; uses the process game data by default. |
None
|
system
|
TitleSystem
|
|
required |
points
|
float | None
|
Your glory points ( |
required |
top_rank
|
int | None
|
The system's |
required |
Client: CastleTitleData.setupThisUsersTitlesinSystem (bundle line 21048), with TitleVO.isTopXTitle
storm_islands_title_chain
¶
storm_islands_title_chain(storm_islands_title_id: int, *, game_data: GameData | None = None) -> list[Title | int]
The Storm Islands titles you hold with one: it and every title below it, lowest first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_data
|
GameData | None
|
Optional tables override; uses the process game data by default. |
None
|
storm_islands_title_id
|
int
|
Your current Storm Islands title, -1 or an unknown id for none |
required |
Client: CastleTitleData.getUsersTitleVectorFromSystem for ISLAND_TITLE (bundle line 21119)
player_title_ids
¶
player_title_ids(glory: GloryPointsResponse | None, gallantry: GallantryPointsResponse | None, ranks: TitleRanksResponse | None, *, game_data: GameData | None = None) -> list[Title | int]
Every title you hold, as the client lists them: glory, then Berimond, then Storm Islands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_data
|
GameData | None
|
Optional tables override; uses the process game data by default. |
None
|
glory
|
GloryPointsResponse | None
|
|
required |
gallantry
|
GallantryPointsResponse | None
|
|
required |
ranks
|
TitleRanksResponse | None
|
|
required |
Client: CastleTitleData.thisUsersTitles (bundle line 21073)