Skip to content

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.get_player_details_bulk got for each player.

PlayerService

Other players' details, finding a player by name, and your own player: currencies, skills,

logger module-attribute

logger = logging.getLogger(__name__)

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

timed_out: list[int] = field(default_factory=list)

Players whose reply did not come in time.

complete property

complete: bool

Whether every player was found.

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 vfi push.

on_food_production

Register a callback for each food production status the server sends: the login data's DTS

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 slot_id.

prolong_training_program

Prolong the training program running, for rubies.

reroll_training_programs

Replace the training programs on offer, except those in kept_slot_ids.

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 amount.

change_coat_of_arms

Change your coat of arms to coat_of_arms; the reply's is also kept in coat_of_arms.

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 name, the name other players see. This cannot be undone but by another

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 old_password to new_password; on success this client logs

set_migration_password

Give your account a password while its social login is migrated, as the client asks after an slms

change_email

Change your account's email address to email. The change stays in progress until its verification link

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 kingdom as last sent (login data, uap pushes and replies); nothing is sent.

get_protection

Ask for your protection in kingdom; the reply also updates protection, and in Berimond the event.

start_peace_mode

Buy peace mode: nobody can attack you, and you attack nobody, for duration.

cancel_peace_mode

End your peace mode; the new stage arrives as a uap push.

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_info (both use the 'gdi' command).

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 gap; None until one arrived (get_cargo_points asks).

storm_islands StormIslandsInfo | None

Your and your alliance's Storm Islands standing, from the last sii; None until one arrived.

skills SkillList | None

Your Legendary and sceat skills as the last skl listed them; None until one arrived.

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 gmu.

glory_points GloryPointsResponse

Your glory points, from the last ufa.

food_production FoodProductionStatus | None

Whether your food production is frozen, from the login data's DTS and each push since; None until

gallantry_points GallantryPointsResponse | None

Your Berimond points, from the last ufp push; None until one arrived (the login data has none).

title_ranks TitleRanksResponse

Your top-X ranks, Storm Islands title and displayed title systems, from the last uar.

achievements AchievementsResponse

Your achievement points, finished achievements and progress.

relocation RelocationInfoResponse | None

Your castle relocations, from the last gri; None until one arrived.

officer_training OfficerTraining | None

The officers' school training program running, from the last gatp and the gtp since.

training_programs TrainingProgramsResponse | None

The officers' school's training programs, from the last gtp; None until one arrived.

hero Hero | int | None

Your hero, from the last hdc; None until one arrived or while you have yet to pick one.

boosted_global_effects BoostedGlobalEffectsResponse | None

The global effects the running booster event boosts, from the last bie; None until one arrived.

loot_boxes LootBoxesResponse | None

Your loot boxes and key progress; None until a gls arrived.

daily_reset DailyResetResponse | None

When the daily reset comes, from the login data's drt; None until it arrived.

gifts PlayerGiftsResponse | None

Your gift packages and how many you may still send, from the last pgl; None until one arrived.

coat_of_arms CoatOfArmsResponse | None

Your coat of arms, from the login data and the gem and change_coat_of_arms since; None before.

coat_of_arms_symbols CoatOfArmsSymbolsResponse | None

The premium symbols you have earned and unlocked, from the last gus; None until one arrived.

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 PlayerNameChangeInfoResponse | None

Your player name changes and cooldown, from the last get_player_name_change_info; None before.

credentials_status CredentialsStatus | None

Which of your player name, password and email address are temporary, from the last scd; None before.

account_deletion AccountDeletion | None

When your account is deleted, from the last psd push; None until one arrived.

local_player Player

A snapshot of the local player.

currencies dict[Currency | str, int]

A snapshot of the special currencies (Currency -> amount).

cargo_points property

cargo_points: int | float | None

Your cargo points, from the last gap; None until one arrived (get_cargo_points asks).

storm_islands property

storm_islands: StormIslandsInfo | None

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

title_ids: list[Title | int]

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

Your boosters, premium account, production slots and feast.

Raises:

Type Description
StateNotLoadedError

No login has brought it

might property

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

training_programs: TrainingProgramsResponse | None

The officers' school's training programs, from the last gtp; None until one arrived.

hero property

hero: Hero | int | None

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

coat_of_arms: CoatOfArmsResponse | None

Your coat of arms, from the login data and the gem and change_coat_of_arms since; None before.

coat_of_arms_symbols property

coat_of_arms_symbols: CoatOfArmsSymbolsResponse | None

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

player_name_change_info: PlayerNameChangeInfoResponse | None

Your player name changes and cooldown, from the last get_player_name_change_info; None before.

credentials_status property

credentials_status: CredentialsStatus | None

Which of your player name, password and email address are temporary, from the last scd; None before.

account_deletion property

account_deletion: AccountDeletion | None

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

currencies: dict[Currency | str, int]

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_level(*, spend_rubies: bool = False, timeout: float = 5.0) -> None

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

spend_rubies is False, or your level is outside BUY_LEVEL_RANGE

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 EmpireClient.send

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 EmpireClient.send

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

player_name is empty, which takes the title back (revoke_title)

CommandError

The server refused: IS_NOT_KING, LEVEL_TOO_HIGH_OR_LOW, NOT_IN_SAME_ALLIANCE, PLAYER_NOT_FOUND, CANNOT_ASSIGN_TO_SELF or ALREADY_HAS_TITLE

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

revoke_title

revoke_title(title: Title | int, *, timeout: float = 5.0) -> None

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. IS_NOT_KING

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 EmpireClient.send

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 boosts

Raises:

Type Description
ValueError

spend_rubies is False, or no such hire

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 Feast member

required
castle_id int

The castle that pays the food, a Castle.id from client.state.get_castles()

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 boosts

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 spend_rubies is False

UnknownCastleError

castle_id is not in your castle list

StateNotLoadedError

No login has brought the player or the boosters

GameDataNotLoadedError

The game data cannot be loaded

CommandError

The server refused, NOT_ENOUGH_RESOURCES when the castle lacks the food

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 spend_rubies

CommandError

The server refused

Client: OfficersSchoolEffectItem.onConfirmBuy (bundle line 85774), OfficersSchoolEffectVO.getCost (bundle line 144773), ATPCommand.executeCommand (bundle line 126155)

prolong_training_program

prolong_training_program(*, spend_rubies: bool = False, timeout: float = 5.0) -> None

Prolong the training program running, for rubies.

Raises:

Type Description
ValueError

Without spend_rubies

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

premium without spend_rubies

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

choose_hero(hero: Hero, *, timeout: float = 5.0) -> HeroDecisionResponse

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 spend_rubies, or the effect is not offered

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 EmpireClient.send

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 PlayerGift.package_id of gifts

required
amount int

How many to send, 1 at least

1
timeout float

Timeout in seconds

5.0

Raises:

Type Description
ValueError

amount is below 1

CommandError

The server refused, TOO_MANY_PACKAGES_SENT_TODAY past the day's limit

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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. coat_of_arms with fields changed

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 EmpireClient.send

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 coat_of_arms_symbols row

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 spend_rubies is False

GameDataNotLoadedError

The game data cannot be loaded

CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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_premium_flag(*, spend_rubies: bool = False, timeout: float = 5.0) -> None

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, PREMIUM_FLAG_RUBIES before discounts; without it nothing is sent

False
timeout float

Timeout in seconds

5.0

Raises:

Type Description
ValueError

You own the premium flag, or spend_rubies is False

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 EmpireClient.send

Client: C2SChangePlayerNameInfo (bundle line 46362), GNCICommand.executeCommand (bundle line 120604)

change_player_name

change_player_name(name: str, *, spend_rubies: bool = False, timeout: float = 5.0) -> None

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 spend_rubies is False

GameDataNotLoadedError

The game data cannot be loaded

CommandError

The server refused: USAGE_OF_BADWORDS, NAME_ALREADY_IN_USE, INVALID_NAME, NAME_HAS_ONLY_NUMBERS or COOLING_DOWN

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 credentials_status

Raises:

Type Description
ValueError

A password shorter than 4 characters or with a character the client refuses

CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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, INVALID_PASSWORD for a wrong old password

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

Client: OptionsDialogChangePasswordItem.changePassword (bundle line 72828), SCPCommand.executeCommand (bundle line 120938)

set_migration_password

set_migration_password(password: str | SecretStr, *, timeout: float = 5.0) -> None

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 EmpireClient.send

Client: CastleChangePasswordForSocialMigrationDialog.changePassword (bundle line 56679), SPSLMSCommand.executeCommand (bundle line 121001)

change_email

change_email(email: str | SecretStr, *, timeout: float = 5.0) -> None

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: EMAIL_ALREADY_IN_USE, INVALID_EMAIL or MAILDOMAIN_BLOCKED

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 EmpireClient.send

Client: CastleChangePlayerEmailCancelDialog.onClick (bundle line 72770), CMCCommand.executeCommand (bundle line 120496)

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 EmpireClient.send

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

get_protection(kingdom: Kingdom = GREEN, *, timeout: float = 5.0) -> ProtectionResponse

Ask for your protection in kingdom; the reply also updates protection, and in Berimond the event.

Raises:

Type Description
CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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; duration.rubies is its price before ruby discounts

required
spend_rubies bool

Allow the rubies it costs

False
timeout float

Timeout in seconds

5.0

Raises:

Type Description
ValueError

spend_rubies is False

CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 EmpireClient.send

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, BERIMOND_PROTECTION_RUBIES before discounts

False
timeout float

Timeout in seconds

5.0

Raises:

Type Description
ValueError

spend_rubies is False

CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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: search_player_by_name(name).get_player().owner_id, an owner record's MapObject.owner_id from a map scan, or an AllianceMember.player_id from client.alliance.get_members()

required
timeout float

Timeout in seconds

5.0

Raises:

Type Description
CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 get_player_info; repeats are fetched once

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 skl response

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. LegendarySkill.GATE_REDUCTION_T0_G1_L2 when holding level 1

required
timeout float

Timeout in seconds

5.0

Returns:

Type Description
AddSkillPointResponse

The levels bought

Raises:

Type Description
CommandError

The server refused: ADD_LEGEND_SKILL_FAILED, ADD_LEGEND_SKILL_REQUIRED_SKILL_MISSING, ADD_LEGEND_SKILL_NOT_ENOUGH_SKILL_POINTS or ADD_LEGEND_SKILL_TIER_LOCKED

GameDataNotLoadedError

The game data cannot be loaded

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 SceatSkill member

required
timeout float

Timeout in seconds

5.0

Raises:

Type Description
CommandError

The server refused

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 skills lists it in activating

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

spend_rubies is False, the game data has no tab for the skill, or the skill is not being activated

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 skills

Raises:

Type Description
ValueError

The cooldown is running and spend_rubies is False

CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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 loot_boxes lists it

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

open_all with a key other than the common one, or a rarer key not held

CommandError / EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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: TITLE_NOT_AVAILABLE, TITLE_SYSTEM_NOT_AVAILABLE or TITLE_ON_COOLDOWN

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

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, [effect_id, [value, ...]].

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 blv; it carries nothing.

BuyPremiumFlagRequest

Buy the premium flag your castles fly on the map, with rubies.

BuyPremiumFlagResponse

The acknowledgement of a gbp; it carries nothing.

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: [package_id, amount].

PlayerGiftsResponse

Your gift packages, to send to other players, and how many you may still send.

SendGiftPackagesRequest

Send another player gift packages you hold (gpg).

SendGiftPackagesResponse

The reply to gpg, which carries nothing the client reads; TOO_MANY_PACKAGES_SENT_TODAY refuses

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 vip.

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

PREMIUM_FLAG_RUBIES = 4900

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

remaining_seconds

remaining_seconds(now: float | None = None) -> float

Seconds until the daily reset, 0 at least.

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

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

effect pydantic-field

effect: EnumOrInt['Effect']

The effect

values pydantic-field

values: tuple[int | float, ...] = ()

The effect's values, in the effect's order

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:

Validators:

slot_id pydantic-field

slot_id: ClientInt = -1

Wire key S

The program's slot, -1 for none

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

is_set property

is_set: bool

Whether the client takes this as a running program: a slot with time left, or a bonus.

remaining_seconds

remaining_seconds(now: float | None = None) -> float

Seconds the program still runs, 0 at least; its bonus counts only while this is above 0.

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:

effect_id pydantic-field

effect_id: EnumOrInt['GlobalEffect']

Wire key GEID

The global effect to boost

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:

new_level pydantic-field

new_level: int

Wire key NL

The level bought, one above yours

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

has_premium_flag pydantic-field

has_premium_flag: bool = False

Wire key PF

Whether you own the 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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

global_effect_ids pydantic-field

global_effect_ids: tuple[EnumOrInt['GlobalEffect'], ...] = ()

Wire key GE

The boosted global effects

PlayerGift pydantic-model

Bases: BasePayload

One gift package you hold: [package_id, amount].

Client: PlayerGiftVO.parseFromArray (bundle line 52178)

Fields:

Validators:

  • _from_row

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

package_id pydantic-field

package_id: PackageId = PackageId(0)

The package, a packages row of the game data

amount pydantic-field

amount: ClientInt = 0

How many you hold

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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

gifts pydantic-field

gifts: tuple[PlayerGift, ...] = ()

Wire key G

The gift packages you hold

sendable_amount pydantic-field

sendable_amount: ClientNumber = 0

Wire key RA

Gift packages you may still send; none at 0 or less

can_send property

can_send: bool

Whether you may send another gift package.

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 pydantic-field

receiver_id: int

Wire key RID

The player who gets the gift

package_id pydantic-field

package_id: PackageId

Wire key PID

The package, a PlayerGift.package_id you hold

amount pydantic-field

amount: int

Wire key A

How many of the package to send

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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

frozen pydantic-field

frozen: bool = False

Wire key DTS

Whether food production is 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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

error_code pydantic-field

error_code: int = 0

Always 0; the E of a gpi is the email

user_id pydantic-field

user_id: ClientInt = 0

Wire key UID

Your account id

player_id pydantic-field

player_id: ClientInt = 0

Wire key PID

Your player id

name pydantic-field

name: str = ''

Wire key PN

Your player name

email pydantic-field

email: str = ''

Wire key E

Your email; empty when the server sends "-1"

email_confirmed pydantic-field

email_confirmed: bool = False

Wire key V

Your email is confirmed (1 == V); an unconfirmed one counts as temporary

is_cheater pydantic-field

is_cheater: bool = False

Wire key CL

Your admin security level is above 0

accepted_terms pydantic-field

accepted_terms: bool = False

Wire key CTAC

You accepted the terms and conditions (CTAC > 0)

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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

vip_points pydantic-field

vip_points: ClientInt = 0

Wire key VP

Your VIP points

vip_level pydantic-field

vip_level: ClientInt = 0

Wire key VRL

The highest VIP level you reached

vip_seconds_left pydantic-field

vip_seconds_left: ClientInt = 0

Wire key VRS

Seconds of VIP time left when sent; 0 without VIP time

used_premium_commanders pydantic-field

used_premium_commanders: ClientInt = 0

Wire key UPG

Premium commanders used today from the VIP level's free ones

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 client.player.boosts.

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 PO of a hire that uses no booster sale.

OVERSEERS

The boosters ovs hires.

NO_OFFER module-attribute

NO_OFFER = -1

The PO of a hire that uses no booster sale.

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

Bases: BaseRequest

What every booster hire sends: the booster sale it uses.

Fields:

private_offer_id pydantic-field

private_offer_id: int = NO_OFFER

Wire key PO

The booster sale the hire uses, -1 for none

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:

overseer pydantic-field

overseer: BoosterId

Wire key T

The overseer, one of OVERSEERS

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:

currencies pydantic-field

currencies: CurrencyBlock = None

Wire key gcu

Coins and rubies after

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:

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:

HireOverseerResponse pydantic-model

Bases: HireResponse

The reply to hiring an overseer.

Command: ovs Client: OVSCommand.executeCommand (bundle line 627756)

Fields:

HireCaravanOverloaderResponse pydantic-model

Bases: HireResponse

The reply to hiring the caravan overloader.

Command: bcs Client: BCSCommand.executeCommand (bundle line 627398)

Fields:

BuyReturnSpeedBoosterResponse pydantic-model

Bases: HireResponse

The reply to buying the return speed booster.

Command: brs Client: BRSCommand.executeCommand (bundle line 627711)

Fields:

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: {"ID": loot box, "AMT": amount}.

LootBoxKeys

The keys collected towards one loot box type: {"ID": loot box type, "AMT": keys}.

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

loot_box_id pydantic-field

loot_box_id: EnumOrInt['LootBox'] = 0

Wire key ID

The loot box

amount pydantic-field

amount: ClientNumber = 0

Wire key AMT

How many you hold

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

loot_box_type_id pydantic-field

loot_box_type_id: EnumOrInt['LootBoxType'] = 0

Wire key ID

The loot box type

keys pydantic-field

keys: ClientNumber = 0

Wire key AMT

The keys collected

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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

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

amount

amount(loot_box_id: LootBox | int) -> int | float

How many of a loot box you hold.

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 pydantic-field

loot_box_id: EnumOrInt['LootBox']

Wire key LID

The loot box to open

key pydantic-field

Wire key CID

The key to open it with

open_all pydantic-field

open_all: bool = False

Wire key ALL

Open every box of the kind; sent as 1 or 0

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:

Validators:

loot_box_id pydantic-field

loot_box_id: EnumOrInt['LootBox'] = 0

Wire key LID

The loot box opened

rewards pydantic-field

rewards: tuple[Collectable, ...] = ()

What the boxes gave, the keys won aside

reward_ids pydantic-field

reward_ids: tuple[RewardId, ...] = ()

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

keys_won pydantic-field

keys_won: tuple[Collectable, ...] = ()

Wire key KTR

The keys won

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

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

amounts pydantic-field

amounts: dict[EnumOrStr['Currency'], int]

Amount per currency

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 client.player.boosts.

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 pydantic-field

feast_id: EnumOrInt['Feast']

Wire key T

The feast

castle_id pydantic-field

castle_id: int

Wire key CID

The castle's object id

kingdom pydantic-field

kingdom: Kingdom

Wire key KID

The castle's kingdom

private_offer_id pydantic-field

private_offer_id: int = -1

Wire key PO

The resource merchant's private offer, -1 for none

pay_with_rubies pydantic-field

pay_with_rubies: bool = False

Wire key PWR

Pay the missing food with rubies

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:

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 O block: the player's owner record.

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.

logger module-attribute

logger = logging.getLogger(__name__)

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 pydantic-field

location_id: int = 0

The location's object id

location_type pydantic-field

location_type: MapItemType = MapItemType.EMPTY

The location's area type

x pydantic-field

x: int = 0

Map x

y pydantic-field

y: int = 0

Map y

kingdom pydantic-field

kingdom: Kingdom = Kingdom.GREEN

The location's kingdom

capturer_id pydantic-field

capturer_id: int = -1

Player id of the occupier, -1 when there is none

is_being_captured property

is_being_captured: bool

Whether someone occupies this location: an occupier id above -1.

PlayerOwnerInfo pydantic-model

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

accepts_reply(payload: Any) -> bool

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:

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')

owner pydantic-field

owner: PlayerOwnerInfo | None = None

Wire key O

castle_list pydantic-field

castle_list: GetCastlesResponse

Wire key gcl

The player's castles, outposts and landmarks, shaped as a GetCastlesResponse

player_id property

player_id: int

Get player ID from owner info.

player_name property

player_name: str

Get player name from owner info.

alliance_id property

alliance_id: int

The player's alliance id, -1 when the player is in none or the reply has no owner.

alliance_name property

alliance_name: str

Get alliance name from owner info.

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.

get_all_captures_by_location

get_all_captures_by_location() -> dict[int, int]

Get a mapping of location_id -> capturer_id for all captures.

Returns:

Type Description
dict[int, int]

Dict mapping location_id to the player_id who is capturing it.

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:

player_name pydantic-field

player_name: str

Wire key PN

The player's name, as typed

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')

area pydantic-field

area: MapArea

Wire key gaa

The found player's map rows and owner records

x pydantic-field

x: int | None = None

Wire key X

Map x of the found player's castle

y pydantic-field

y: int | None = None

Wire key Y

Map y of the found player's castle

get_player

get_player() -> MapObject | None

The found player's owner record: the owner of the area at X/Y.

Falls back to the first owner record when no row sits at X/Y or its owner has no record, and None when there are no records.

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 pydantic-field

player_id: ParseInt = 0

Wire key OID

Player id

name pydantic-field

name: str = ''

Wire key N

Player name

emblem pydantic-field

emblem: OwnerCrest | None = None

Wire key E

The player's crest

level pydantic-field

level: ParseInt = 0

Wire key L

Level

legendary_level pydantic-field

legendary_level: ParseInt = 0

Wire key LL

Legendary level

beginner_protection_seconds pydantic-field

beginner_protection_seconds: ParseInt = 0

Wire key RNP

Seconds of beginner protection left

honor pydantic-field

honor: ParseInt = 0

Wire key H

Honor points

might pydantic-field

might: ParseInt = 0

Wire key MP

Might points

top_ranking pydantic-field

top_ranking: ParseInt = -1

Wire key TOPX

Top ranking place

is_ruin pydantic-field

is_ruin: bool = False

Wire key R

The player's castle is a ruin

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

alliance_name pydantic-field

alliance_name: str = ''

Wire key AN

Alliance name

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

castle_positions pydantic-field

castle_positions: OwnerPositions

Wire key AP

Castles

village_positions pydantic-field

village_positions: OwnerPositions

Wire key VP

Villages

has_premium_flag pydantic-field

has_premium_flag: bool = False

Wire key PF

The player has the premium flag

has_vip_flag pydantic-field

has_vip_flag: bool = False

Wire key VF

The player has the VIP 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

faction pydantic-field

faction: OwnerFaction | None = None

Wire key FN

Berimond standing

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

is_officer property

is_officer: bool

Whether the player holds a rank between leader and member.

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

remaining_revenge_protection_seconds(now: float | None = None) -> float

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

remaining_beginner_protection_seconds(now: float | None = None) -> float

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 boi's BO list.

ActiveFeast

The feast you hold, for faster recruitment in every castle: a boi's bfs, or a bfs reply.

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 uar's FTM (glory) or BTM (Berimond).

StormIslandsTitle

A uar's ITM. Client: CastleTitleData.parseIslandDataFromServer (bundle lines 21023-21027)

AllianceCityTitle

A uar's ATM. Client: CastleTitleData.parseAllianceCityDataFromServer (bundle lines 21028-21036)

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 uar.

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 AssignTitleRequest.

AchievementProgress

One achievement's progress, an entry of a vli's RA.

AchievementsResponse

Your achievement points, finished achievements and progress.

GetAchievementsRequest

Ask for your achievements; answered with a vli.

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

BoosterConst.PERMANENT_BOOSTER_DURATION (dll): a booster's RT when it never runs out

PERMANENT_BOOSTER_DURATION module-attribute

PERMANENT_BOOSTER_DURATION = 2147483647

BoosterConst.PERMANENT_BOOSTER_DURATION (dll): a booster's RT when it never runs out

Numbers module-attribute

Numbers = Annotated[tuple[int | float, ...], BeforeValidator(_numbers)]

Ints module-attribute

Ints = Annotated[tuple[int, ...], BeforeValidator(_ints)]

ParsedInt module-attribute

ParsedInt = Annotated[int | None, BeforeValidator(js_parse_int)]

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:

Validators:

booster_id pydantic-field

booster_id: ClientInt = 0

Wire key ID

The booster's id

level pydantic-field

level: ClientInt = 0

Wire key L

The booster's level

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

purchase_count: int | float | None = None

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

is_permanent property

is_permanent: bool

Whether the booster never runs out.

remaining_seconds

remaining_seconds(now: float | None = None) -> float

Seconds left, -1 at least; infinite for a permanent booster.

is_active

is_active(now: float | None = None) -> bool

A permanent booster with a level, or one whose time has not run out.

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:

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

remaining_seconds

remaining_seconds(now: float | None = None) -> float

Seconds left, 0 at least.

is_active

is_active(now: float | None = None) -> bool

Whether the feast still runs.

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:

Validators:

boosters pydantic-field

boosters: tuple[Booster, ...] = ()

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

bought_unit_slots property

bought_unit_slots: int

Unit production slots bought.

permanent_unit_slots property

permanent_unit_slots: int

Permanent unit production slots.

bought_tool_slots property

bought_tool_slots: int

Tool production slots bought.

permanent_tool_slots property

permanent_tool_slots: int

Permanent tool production slots.

premium_remaining_seconds

premium_remaining_seconds(now: float | None = None) -> float

Seconds of premium account left, 0 when it is not active.

is_premium_active

is_premium_active(now: float | None = None) -> bool

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.

booster

booster(booster_id: int) -> Booster | None

One booster, None when it is not listed.

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:

might_points pydantic-field

might_points: ParsedInt = None

Wire key MP

Might points; None when unreadable

building_might pydantic-field

building_might: ParsedInt = None

Wire key TSBM

Might points from buildings; None when unreadable

highest_might_points pydantic-field

highest_might_points: ParsedInt = None

Wire key HMP

The most might points ever reached; None when unreadable

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:

Validators:

glory_points pydantic-field

glory_points: int | float | None = None

Wire key CF

Glory points

highest_glory_points pydantic-field

highest_glory_points: int | float | None = None

Wire key HF

The most glory points ever

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:

gallantry_points pydantic-field

gallantry_points: ParsedInt = None

Wire key CFP

Berimond points; None when unreadable

highest_gallantry_points pydantic-field

highest_gallantry_points: ParsedInt = None

Wire key HFP

The most Berimond points ever; None when unreadable

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:

Validators:

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

thresholds: tuple[int, ...] = ()

Wire key NTFP

The points the top-X titles need, highest title first

top_player_id pydantic-field

top_player_id: int | None = None

Wire key TOID

The player holding the system's top title; None when not sent

StormIslandsTitle pydantic-model

Bases: BasePayload

A uar's ITM. Client: CastleTitleData.parseIslandDataFromServer (bundle lines 21023-21027)

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

title_id pydantic-field

title_id: EnumOrInt['Title'] | None = None

Wire key TID

Your Storm Islands title; None for none

held_title_id property

held_title_id: int

The title id, -1 for none.

AllianceCityTitle pydantic-model

Bases: BasePayload

A uar's ATM. Client: CastleTitleData.parseAllianceCityDataFromServer (bundle lines 21028-21036)

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

title_id pydantic-field

title_id: EnumOrInt['Title'] | None = None

Wire key TID

The alliance city title; None for none

player_id pydantic-field

player_id: int | None = None

Wire key PID

The player holding it; None when not sent

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:

Validators:

glory pydantic-field

Wire key FTM

The glory system

gallantry pydantic-field

gallantry: TopTitleRanking

Wire key BTM

The gallantry 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:

reset_seconds pydantic-field

reset_seconds: ParsedInt = None

Wire key RS

Seconds until the glory top-X titles reset, when the values were read; None when unreadable

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 pydantic-field

title_id: EnumOrInt['Title']

Wire key TI

The title

player_name pydantic-field

player_name: str = ''

Wire key PN

The player to give it to; "" takes the title back

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:

Validators:

title_id pydantic-field

title_id: EnumOrInt['Title'] | None = None

Wire key TI

The title; None when not sent

player_name pydantic-field

player_name: str | None = None

Wire key PN

The player given it; None in the push to that player

is_own_title property

is_own_title: bool

Whether the client takes the title as now yours: a title without a 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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

achievement_id pydantic-field

achievement_id: Literal[0] | EnumOrInt['Achievement']

progress pydantic-field

progress: Numbers = ()

Wire key P

Progress per condition, in condition order; -1 for a condition done

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:

Validators:

achievement_points pydantic-field

achievement_points: ClientInt = 0

Wire key AVP

Achievement points

finished_achievement_ids pydantic-field

finished_achievement_ids: tuple[EnumOrInt['Achievement'], ...] = ()

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:

Validators:

achievement_id pydantic-field

achievement_id: EnumOrInt['Achievement']

Wire key AID

The achievement finished

currencies pydantic-field

currencies: CurrencyBlock = None

Wire key gcu

Coins and rubies after

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:

Validators:

relocation_count pydantic-field

relocation_count: ClientInt = 0

Wire key RLC

Relocations made

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

remaining_relocation_seconds(now: float | None = None) -> float

Seconds left on the running relocation, 0 when none runs.

remaining_cooldown_seconds

remaining_cooldown_seconds(now: float | None = None) -> float

Seconds until you may relocate again, 0 at least.

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 pydantic-field

prefix: TitleSystem

Wire key PRE

The system shown before your name

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:

Validators:

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

xp pydantic-field

xp: ClientInt = 0

Wire key XP

Your total XP

level pydantic-field

level: int | None = None

Wire key LVL

Your level; 70 is the cap before Legendary levels. None when the server sent nothing parseInt reads as a number, which the client stores as it came

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

honor pydantic-field

honor: ClientInt = 0

Wire key H

Your honor

ranking_points pydantic-field

ranking_points: ClientInt = 0

Wire key RP

Your ranking points

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:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

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

level pydantic-field

level: ClientInt = 0

Wire key L

The level reached, as the dialog shows it

is_legendary_level_up pydantic-field

is_legendary_level_up: bool = False

Wire key LL

The level-up is a Legendary level (1 == LL)

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

TitleSystem.GLORY or TitleSystem.GALLANTRY

required
points float | None

Your glory points (ufa CF) or Berimond points (ufp CFP); None before they arrived

required
top_rank int | None

The system's uar top rank (CTXT); None before it arrived

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

client.state.get_glory_points()

required
gallantry GallantryPointsResponse | None

client.state.get_gallantry_points()

required
ranks TitleRanksResponse | None

client.state.get_title_ranks()

required

Client: CastleTitleData.thisUsersTitles (bundle line 21073)