Alliance¶
Alliance info, members, chat and help behind client.alliance.
alliance.service¶
Your alliance and others: members, chat, help, diplomacy and the treasury.
It covers:
- Alliance members (get members, online status, last seen)
- Member management (kick, rank, invite, applications, leave)
- Diplomacy, auto war, the newsletter and treasury donations
- Alliance chat (send messages, get history)
- Alliance help (the help list and its pushes, helping, asking for help)
- Your alliance's chronicle and subscriber count
- Map bookmarks, your own and your alliance's (list, add, change, delete)
- Joining automatically, members' cargo points and the alliance forge
- Beyond the Horizon: entry, performance, influence, centers of power, alliance towers and the Jade Desert
Modules:
| Name | Description |
|---|---|
bookmarks |
Alliance map bookmarks. |
communication |
The alliance forum, chat and help requests. |
diplomacy |
Alliance diplomacy, the newsletter and donations. |
horizon |
Beyond the Horizon. |
management |
Joining, leaving and managing an alliance's members. |
own |
Your own alliance, any alliance's members and the alliance search. |
settings |
Your alliance's upgrades, settings and gifts. |
Classes:
| Name | Description |
|---|---|
AllianceService |
Alliance chat, help, members, applications, diplomacy and the treasury. |
Attributes:
| Name | Type | Description |
|---|---|---|
AllianceHelpUpdate |
|
AllianceHelpUpdate
module-attribute
¶
AllianceHelpUpdate = AllianceHelpListResponse | AllianceHelpRequestChanged | AllianceHelpRequestRemoved | AllianceHelpReceived
AllianceService
¶
AllianceService(client: EmpireClient)
Bases: AllianceSettingsMixin, MemberManagementMixin, DiplomacyMixin, HorizonMixin, CommunicationMixin, BookmarksMixin, OwnAllianceMixin, BaseService
Alliance chat, help, members, applications, diplomacy and the treasury.
Reached as client.alliance.
Usage
client = EmpireClient(...)
client.login()
# Send chat message
client.alliance.send_chat("Hello alliance!")
# Help every request on the alliance help list
client.alliance.help_all()
# Subscribe to incoming messages
def on_message(response: AllianceChatMessageResponse):
print(f"{response.player_name}: {response.decoded_text}")
client.alliance.on_chat_message(on_message)
Methods:
| Name | Description |
|---|---|
upgrade |
Upgrade a permanent alliance buff or buy/prolong a temporary boost. |
set_description |
Change the alliance description, returning echoed alliance details. |
set_announcement |
Change the alliance announcement, returning echoed alliance details. |
rename |
Rename the alliance; a fresh free rename avoids the 10,000-ruby charge. |
set_language |
Set the alliance language code, returning echoed alliance details. |
set_emblem |
Save an available alliance crest, returning the acknowledged selection. |
collect_gift |
Collect a gift and return the unpacked rewards. |
kick_member |
Remove a member from your alliance. |
set_rank |
Give a member another rank; |
found |
Found an alliance and return its created details. |
apply |
Send an application to an alliance, waiting for acceptance by the server. |
join_open |
Join an alliance that permits open joining and return its details. |
auto_join |
Ask the server to put you in an alliance; it either does, or lists alliances to join. |
get_invitation |
Read the inviting alliance using the invitation's message id. |
accept_invitation |
Accept an invitation, or refuse with |
find_recruits |
Find players looking for an alliance, nearest first, with their owner records. |
set_looking_for_members |
Set recruitment and open joining independently; refresh alliance info to read them. |
set_looking_for_alliance |
Set your player's looking-for-alliance flag. |
invite |
Invite a player to your alliance. |
get_applications |
Get your alliance's applications, nearest first, with the applicants' owner records. |
answer_application |
Accept or refuse an application. |
leave |
Leave your alliance. Once the server accepts, |
change_diplomacy |
Change or propose your alliance's relation with another alliance. |
refuse_diplomacy |
Refuse another alliance's diplomacy request or peace offer. |
set_auto_war |
Turn auto war on or off. |
send_newsletter |
Send the alliance newsletter to every member. |
donate |
Donate resources from one of your castles to the alliance treasury. |
get_donation_resources |
What one of your castles has to donate: its resources, and your special currencies. |
get_member_cargo_points |
Your alliance members' cargo points, in the order the server lists them. |
forge |
Craft in the alliance forge: an equipment item, a gem or a relic gem. |
get_horizon_entry |
Your alliance as Beyond the Horizon will take it: its name, member count and your rank. |
get_horizon_performance |
Your alliance members' Beyond the Horizon performance, kept as |
get_horizon_alliance_influence |
An alliance's Beyond the Horizon influence. |
get_horizon_player_influence |
A player's Beyond the Horizon influence. |
get_centers_of_power |
How many capitals, metropolises and royal towers your alliance holds, against their limits. |
get_centers_of_power_detail |
Your alliance's centers of power one by one, with the member holding each. |
get_towers |
An alliance's towers on Beyond the Horizon, as map rows. |
get_tower_castles |
The castles linked to the alliance tower at |
get_tower_buffs |
The buffs of the alliance tower at |
activate_tower_buffs |
Activate the buffs of the alliance tower at |
increase_tower_buffs |
Raise buffs of the alliance tower at |
get_horizon_entry_conditions |
The conditions for entering Beyond the Horizon that you do not meet yet; none when you may enter. |
get_citadels |
Your alliance's Citadel and the enemy citadels in the Jade Desert. |
upgrade_citadel |
Upgrade your alliance's Citadel to its next level, for that level's Ancient Jade Statuettes. |
convert_jade_statuettes |
Convert Ancient Jade Statuettes into |
get_oasis_settlement |
The Oasis Settlement at |
send_oasis_trade |
Send troops and trading materials from your castle to the Oasis Settlement at |
create_topic |
Create a forum topic with explicit visibility groups and an opening post. |
reply |
Post a reply to a forum topic; permission refusals raise CommandError. |
delete_topic |
Delete a forum topic; permission refusals raise CommandError. |
delete_reply |
Delete a forum post; permission refusals raise CommandError. |
set_topic_visibility |
Change the rank groups that can see a topic, returning its details when echoed. |
get_forum_topics |
Get visible forum topics, newest post first, and the total including hidden topics. |
get_topic |
Open a forum topic and its posts. Opening it may mark it read on the server. |
get_unread_topic_count |
Request the number of unread forum topics. |
send_chat |
Send a message to alliance chat. |
get_chat_log |
Get alliance chat history. |
on_chat_message |
Register a callback for incoming alliance chat messages. |
on_help_update |
Call |
help_member |
Help one request on the help list. |
help_all |
Help every request on the help list. |
request_build_help |
Ask the alliance to help build a building. |
request_repair_help |
Ask the alliance to help repair a building. |
request_recruit_help |
Ask the alliance to help with a recruitment. |
request_heal_help |
Ask the alliance to help heal wounded units. |
get_bookmarks |
Get your own and your alliance's map bookmarks. |
add_bookmark |
Bookmark a map position: for yourself as a friend or an enemy, or for your alliance. |
change_bookmark |
Rename one of your own bookmarks, or switch it between friend and enemy. |
delete_bookmark |
Delete a bookmark: one of your own by its position, an alliance one by its id. |
get_alliance_info |
Get info about an alliance. |
get_members |
Get the list of alliance members from the server. |
get_online_members |
Get alliance members who are currently online. |
get_member |
Get one member of an alliance, from a fresh member list. |
search_alliances |
Search for alliances by name. |
get_local_members |
Get members of the local player's alliance. |
get_local_online_members |
Get online members of the local player's alliance. |
get_chronicle |
Get your alliance's chronicle, newest first. |
get_subscriber_count |
Get how many of your alliance's members have a subscription. |
Attributes:
| Name | Type | Description |
|---|---|---|
own_alliance |
AllianceInfo | None
|
Your alliance's details and members, from the last |
chat |
list[ChatMessageData]
|
The alliance chat history, oldest first; a copy of the list, of read-only messages. |
gifts |
list[AllianceGift]
|
Your unexpired alliance gifts, soonest expiration first; received through pushes. |
horizon_performance |
list[HorizonMemberPerformance] | None
|
Your alliance members' Beyond the Horizon performance, from the last |
jade_phase |
JadePhase | None
|
The Jade Desert's scoring phase, from the |
help_requests |
list[AllianceHelpRequest]
|
The alliance help list as the login data and the pushes since left it; nothing is sent. |
local_alliance_id |
int | None
|
Get the local player's alliance ID. |
own_alliance
property
¶
own_alliance: AllianceInfo | None
Your alliance's details and members, from the last ain about it; None in no alliance or before one.
chat
property
¶
chat: list[ChatMessageData]
The alliance chat history, oldest first; a copy of the list, of read-only messages.
gifts
property
¶
gifts: list[AllianceGift]
Your unexpired alliance gifts, soonest expiration first; received through pushes.
horizon_performance
property
¶
horizon_performance: list[HorizonMemberPerformance] | None
Your alliance members' Beyond the Horizon performance, from the last gae; None until one arrived.
jade_phase
property
¶
The Jade Desert's scoring phase, from the abgi pushes so far; None until one arrived.
help_requests
property
¶
help_requests: list[AllianceHelpRequest]
The alliance help list as the login data and the pushes since left it; nothing is sent.
The login data's ahl section fills it, and so does an ahl push; ahh replaces or adds a
request by LID, ahd removes one, and leaving your alliance empties it. It is kept when
the session drops, as the client keeps it.
local_alliance_id
property
¶
local_alliance_id: int | None
Get the local player's alliance ID.
Returns:
| Type | Description |
|---|---|
int | None
|
Alliance ID if in an alliance, None otherwise: the player data sends |
int | None
|
a negative |
Raises:
| Type | Description |
|---|---|
StateNotLoadedError
|
No login has brought the player data |
Client: CastleUserData.isInAlliance (bundle line 9986) is allianceID >= 0
upgrade
¶
upgrade(building_type: AllianceBuffType | int, level: int = 1, *, spend_rubies: bool = False, timeout: float = 5.0) -> AllianceUpgradeResponse
Upgrade a permanent alliance buff or buy/prolong a temporary boost.
Fresh alliance details determine the actual treasury cost. Consent covers alliance treasury rubies, not personal rubies. The server enforces rank permissions and available funds through typed CommandError refusals.
Client: C2SAllianceUpgradeVO (27432–27435), OpenAllianceBuyBoosterCommand (91124–91173), AllianceInfoVO.getUpgradeCosts (26031), customizable dialog (91199/91219), forge dialog (69522/69528), AUGCommand (121660).
set_description
¶
set_description(text: str, *, timeout: float = 5.0) -> AllianceInfo
Change the alliance description, returning echoed alliance details.
Text follows the client's trim, double encoding and 1000-character wire limit. Client: CastleChangeDescriptionDialog.sendDescription (bundle 69775–69778).
set_announcement
¶
set_announcement(text: str, *, timeout: float = 5.0) -> AllianceInfo
Change the alliance announcement, returning echoed alliance details.
Client: CastleChangeAnouncementDialog.sendDescription (bundle 70504).
rename
¶
rename(name: str, *, spend_rubies: bool = False, timeout: float = 5.0) -> AllianceInfo
Rename the alliance; a fresh free rename avoids the 10,000-ruby charge.
Without consent this first requests alliance details to check free renames. Client: CastleNameAllianceDialog.showLoaded (bundle 69791–69792), AllianceConst.RENAME_COST_C2 (dll line 18805).
set_language
¶
set_language(language: str, *, timeout: float = 5.0) -> AllianceInfo
Set the alliance language code, returning echoed alliance details.
Client: CastleAllianceDialogManagement.onLanguageSelect (bundle 69621).
set_emblem
¶
set_emblem(layout_id: AllianceCrestLayout | int, color_ids: list[AllianceCrestColor | int], *, timeout: float = 5.0) -> AllianceCrest
Save an available alliance crest, returning the acknowledged selection.
Temporary layouts must still be held. The server pushes authoritative crest state separately; this acknowledgment does not fabricate a crest update. Client: AllianceCrestCreationDialog.update/doSave (bundle 45205–45211), C2SSetAllianceEmblemVO (69672–69674), SAECommand (122004).
collect_gift
¶
collect_gift(gift_id: int, *, timeout: float = 5.0) -> CollectAllianceGiftResponse
Collect a gift and return the unpacked rewards.
Client: AllianceGiftScrollItem.onMouseClick (bundle 105236), AGCCommand (121823) and CastleAllianceGiftData.parse_AGC (131937–131939).
kick_member
¶
kick_member(player_id: int, *, timeout: float = 5.0) -> AllianceInfo
Remove a member from your alliance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
int
|
The member's |
required |
Returns:
| Type | Description |
|---|---|
AllianceInfo
|
The alliance after the kick |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
PacketError
|
The reply carries no alliance |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: AKMCommand.executeCommand (bundle line 121513) reads the reply's ain
set_rank
¶
set_rank(player_id: int, rank: AllianceRank, *, timeout: float = 5.0) -> AllianceInfo | None
Give a member another rank; AllianceRank.LEADER hands over the leadership.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
int
|
The member's |
required |
rank
|
AllianceRank
|
The new rank |
required |
Returns:
| Type | Description |
|---|---|
AllianceInfo | None
|
The alliance after the change, or None when the server answers |
AllianceInfo | None
|
which the client takes as nothing to do |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
PacketError
|
The reply carries no alliance |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: ARMCommand.executeCommand (bundle line 121589) reads the reply's ain
and passes over NO_CHANGE
found
¶
found(name: str, description: str, language: str, *, open_join: bool = True, spend_rubies: bool = False, timeout: float = 5.0) -> AllianceInfo
Found an alliance and return its created details.
Base costs are 50 coins, 100 wood, 50 stone and 375 rubies, before cost modifiers. An active premium account waives the ruby cost. Without ruby consent its remaining time must cover the request timeout. Missing resources are never bought with rubies. Server refusals preserve local membership.
Client: CastleNewAllianceDialog.showLoaded/onCreateNewAlliance (bundle 44123–44125, 44138–44141), C2SFoundAllianceVO (44153–44156), AFOCommand (121465–121466), AllianceConst (dll line 18805).
apply
¶
Send an application to an alliance, waiting for acceptance by the server.
join_open
¶
join_open(alliance_id: int, *, timeout: float = 5.0) -> AllianceInfo
Join an alliance that permits open joining and return its details.
A refused join raises CommandError. Its membership and details are applied to state only after a successful, consistent reply. A newer membership update or session reset raises ReplyMismatchError and keeps that newer state.
auto_join
¶
auto_join(name: str, *, description: str = '', language: str = '', timeout: float = 5.0) -> AutoAllianceSearchResponse
Ask the server to put you in an alliance; it either does, or lists alliances to join.
Its membership is your new one when you were put in an alliance, and is applied
to state with the movements beside it; else alliances lists alliances to join.
name and description are what the game sends: its translated default alliance
name and an empty text. language limits the list to one language code.
Raises:
| Type | Description |
|---|---|
ValueError
|
You already belong to an alliance; the client offers this only outside one |
CommandError
|
The server refused |
Client: CastleAllianceTeaserDialog.onJoinAlliance (bundle line 14670) and
CastleSearchAllianceDialog.setAllianceLanguage (bundle line 34593), AASCommand
(bundle lines 121270-121279)
get_invitation
¶
get_invitation(message_id: int, *, timeout: float = 5.0) -> AllianceInfo
Read the inviting alliance using the invitation's message id.
accept_invitation
¶
accept_invitation(message_id: int, *, accept: bool = True, timeout: float = 5.0) -> AllianceInfo | None
Accept an invitation, or refuse with accept=False; return echoed alliance details.
message_id is the invitation message id, not the sender's player id.
Refusing normally returns no alliance. A refused command still raises CommandError.
A newer membership update or session reset raises ReplyMismatchError;
it keeps the newer state even if the invitation was accepted remotely.
find_recruits
¶
find_recruits(*, timeout: float = 5.0) -> FindAllianceRecruitsResponse
Find players looking for an alliance, nearest first, with their owner records.
set_looking_for_members
¶
Set recruitment and open joining independently; refresh alliance info to read them.
set_looking_for_alliance
¶
Set your player's looking-for-alliance flag.
invite
¶
Invite a player to your alliance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
int
|
The player's id, e.g. |
required |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
CommandError
|
The server refused it, with |
Client: CastlePlayerInfoDialog shows its invite button for
CastleUserData.canInviteToAlliance (bundle line 9994), which needs isInAlliance
get_applications
¶
get_applications(*, timeout: float = 5.0) -> AllianceApplicationListResponse
Get your alliance's applications, nearest first, with the applicants' owner records.
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
answer_application
¶
Accept or refuse an application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
int
|
The applicant's |
required |
accept
|
bool
|
True to accept, False to refuse |
required |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
leave
¶
leave(*, timeout: float = 5.0) -> None
Leave your alliance. Once the server accepts, help_requests is emptied.
Client: AQICommand.executeCommand (bundle line 121556) calls
CastleAllianceData.resetMyAlliance (bundle line 11620), which cleans the help list
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
change_diplomacy
¶
change_diplomacy(alliance_id: int, new_status: DiplomacyStatus, tribute: int = 0, *, timeout: float = 5.0) -> ChangeDiplomacyResponse
Change or propose your alliance's relation with another alliance.
The reply's own alliance (AS) updates your alliance's details; the other one is not kept.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alliance_id
|
int
|
The other alliance, e.g. |
required |
new_status
|
DiplomacyStatus
|
The relation to change to |
required |
tribute
|
int
|
Only to accept a peace offer: |
0
|
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
ReplyMismatchError
|
Your alliance membership changed while the request was out |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleAllianceInfoDialogDiplomacy.updateButtons (bundle line 72349) offers
each change from the other alliance's status to your own; ADPCommand.executeCommand
(split.js line 623011) reads AS and AO with parseAllianceInfo (split.js line 61810)
refuse_diplomacy
¶
refuse_diplomacy(alliance_id: int, *, timeout: float = 5.0) -> AllianceInfo | None
Refuse another alliance's diplomacy request or peace offer.
Returns:
| Type | Description |
|---|---|
AllianceInfo | None
|
The other alliance after the refusal |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
PacketError
|
The reply carries no alliance |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: ARDCommand.executeCommand (bundle line 121574) reads the reply's A;
CastleAllianceDialogDiplomacy opens the dialogs that refuse (bundle lines 69323, 69352)
set_auto_war
¶
Turn auto war on or off.
Returns:
| Type | Description |
|---|---|
bool
|
Whether auto war is on afterwards |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
ReplyMismatchError
|
Your alliance membership changed while the request was out |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: SAWCommand.executeCommand (split.js line 625171) sets your alliance's auto war from AW
send_newsletter
¶
Send the alliance newsletter to every member.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subject
|
str
|
The subject (the client's field takes 20 characters) |
required |
text
|
str
|
The text; the client does not send an empty one |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
donate
¶
donate(castle_id: int, donation: AllianceDonation, *, spend_rubies: bool = False, timeout: float = 5.0) -> DonateResponse
Donate resources from one of your castles to the alliance treasury.
Donating AllianceDonation.rubies spends them; see "Spending rubies" in the guides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
castle_id
|
int
|
The donating castle, a |
required |
donation
|
AllianceDonation
|
The amounts; the client sends nothing when every amount is 0 |
required |
spend_rubies
|
bool
|
Allow a donation of rubies |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
UnknownCastleError
|
|
ValueError
|
every amount is 0, or rubies are donated and |
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleAllianceDonateDialog.onDonateForAlliance (bundle line 45576) sends
the picked castle's objectId and kingdomID
get_donation_resources
¶
get_donation_resources(castle_id: int, *, timeout: float = 5.0) -> DonationResourcesResponse
What one of your castles has to donate: its resources, and your special currencies.
Both are applied to state as the client applies them.
Raises:
| Type | Description |
|---|---|
UnknownCastleError
|
|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
Client: CastleAllianceDonateDialog.selectCastle (bundle line 45573) sends the picked castle's
objectId and kingdomID
get_member_cargo_points
¶
Your alliance members' cargo points, in the order the server lists them.
Client: CastleEilandRankingDialogPlayer.requestHighscoreData (bundle line 98145) asks with
your alliance's id
forge
¶
forge(*, pay_with_rubies: bool = False, spend_rubies: bool = False, timeout: float = 5.0) -> ForgeCraftResponse
Craft in the alliance forge: an equipment item, a gem or a relic gem.
Below Legendary level 1 the alliance forge crafts when your alliance's is_able_to_forge allows it.
From Legendary level 1 the relic forge crafts instead, paid in coins, or in rubies with
pay_with_rubies; its price rises with each craft of the day (relic_forge_coin_cost,
relic_forge_ruby_cost). Your alliance and a crafted gem are applied to state.
Raises:
| Type | Description |
|---|---|
ValueError
|
The forge cannot craft now, rubies are asked below Legendary level 1, or rubies
are spent without |
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
CommandError
|
The server refused |
Client: CastleAllianceDialog picks the forge by Legendary level (bundle line 4911);
CastleAllianceDialogForge.isAllowedToCraft (bundle line 45123), and
CastleAllianceDialogForgeHigh (bundle lines 69578-69599), which allows every craft and prices it
by the alliance's uses of the day
get_horizon_entry
¶
get_horizon_entry(*, timeout: float = 5.0) -> HorizonEntryResponse
Your alliance as Beyond the Horizon will take it: its name, member count and your rank.
Sent on your main server, as the client does before you buy your way onto Beyond the Horizon.
Client: CastleAllianceBattleGroundBuyInfoDialog.getAlliInfo (bundle line 45639)
get_horizon_performance
¶
Your alliance members' Beyond the Horizon performance, kept as horizon_performance.
Only on the Beyond the Horizon server.
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance; nothing is sent |
CommandError
|
The server refused |
Client: the performance tabs' sendPerformanceCommand (bundle lines 71664, 71702)
get_horizon_alliance_influence
¶
An alliance's Beyond the Horizon influence.
Only on the Beyond the Horizon server, in alliance collector scoring.
Client: CastleCollectorEventData.getABGAllianceCollectorAmount (bundle line 134003)
get_horizon_player_influence
¶
A player's Beyond the Horizon influence.
Only on the Beyond the Horizon server, in alliance collector scoring.
Client: CastleCollectorEventData.getABGCollectorAmount (bundle line 134002)
get_centers_of_power
¶
get_centers_of_power(*, timeout: float = 5.0) -> CentersOfPowerResponse
How many capitals, metropolises and royal towers your alliance holds, against their limits.
Only on the Beyond the Horizon server, in alliance collector scoring.
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance; nothing is sent |
CommandError
|
The server refused |
Client: CastleAllianceDialogABG.show (bundle line 69043)
get_centers_of_power_detail
¶
Your alliance's centers of power one by one, with the member holding each.
Only on the Beyond the Horizon server, in alliance collector scoring.
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance; nothing is sent |
CommandError
|
The server refused |
Client: CastleAllianceCentersOfPowerDialog.showLoaded (bundle line 69069)
get_towers
¶
get_towers(alliance_id: int, *, timeout: float = 5.0) -> list[MapAreaItem]
An alliance's towers on Beyond the Horizon, as map rows.
Only on the Beyond the Horizon server, in tower scoring.
Client: CastleAllianceInfoDialogABGTower.show (bundle line 66587)
get_tower_castles
¶
The castles linked to the alliance tower at (x, y), with their owners.
Only on the Beyond the Horizon server, in tower scoring.
Client: CastleABGTowerDetailDialog.showLoaded (bundle line 46066)
get_tower_buffs
¶
The buffs of the alliance tower at (x, y), held by alliance_id.
Only on the Beyond the Horizon server, in tower scoring. The buffs are as the server lists them; the client also shows the event's other tower effects, at level 0.
Client: CastleABGTowerEffectsDialog.showLoaded (bundle line 71024)
activate_tower_buffs
¶
activate_tower_buffs(x: int, y: int, *, spend_rubies: bool = False, timeout: float = 5.0) -> AllianceTowerBuffs
Activate the buffs of the alliance tower at (x, y), for rubies; returns its buffs now.
Only on the Beyond the Horizon server, in tower scoring. The price comes from the event's activation table, cheaper the nearer the tower's revival; the server charges it.
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError
|
The server refused |
Client: CastleABGTowerEffectsActivateDialog.onClick (bundle line 70999)
increase_tower_buffs
¶
increase_tower_buffs(x: int, y: int, increases: list[AllianceTowerBuffIncrease], *, spend_rubies: bool = False, timeout: float = 5.0) -> AllianceTowerBuffs
Raise buffs of the alliance tower at (x, y), for rubies; returns its buffs now.
Only on the Beyond the Horizon server, in tower scoring. Each increase names the buff's
effect, its current level (a get_tower_buffs level) and the level to reach; each level's
price comes from the event's tower effect table, and the server charges it.
Raises:
| Type | Description |
|---|---|
ValueError
|
No increase, one that does not raise its level, or |
CommandError
|
The server refused |
Client: CastleABGTowerEffectsDialog.onClick (bundle line 71048) sends the buffs
ABGAllianceTowerBuffInfoVO.createServerEffectsArray (bundle line 144958) lists, and nothing
when none is raised
get_horizon_entry_conditions
¶
get_horizon_entry_conditions(*, timeout: float = 5.0) -> HorizonEntryConditionsResponse
The conditions for entering Beyond the Horizon that you do not meet yet; none when you may enter.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
Client: CastleAllianceBattleGroundData.requestEntryConditions (split.js line 716008), sent whenever the
Jade Desert event dialog's overview opens
(CastleAllianceBattlegroundEventJadeDialogOverview.requestJoinRequirements, split.js line 474622)
get_citadels
¶
get_citadels(*, timeout: float = 5.0) -> CitadelsResponse
Your alliance's Citadel and the enemy citadels in the Jade Desert.
Only on the Beyond the Horizon server, in the Jade Desert, where the client alone sends it.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
Client: CastleAllianceBattleGroundData.requestJadeCitadelInfo (split.js line 716001)
upgrade_citadel
¶
upgrade_citadel(*, timeout: float = 5.0) -> None
Upgrade your alliance's Citadel to its next level, for that level's Ancient Jade Statuettes.
Only on the Beyond the Horizon server, in the Jade Desert. The price is the next
GameData.citadel_levels row's costs. An upgrade can end the citadel's attack protection; the client
asks before sending one that does.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
Client: CastleAllianceBattleGroundEventJadeDialogCitadelManagement.onUpgradeClicked (split.js line 473840)
convert_jade_statuettes
¶
Convert Ancient Jade Statuettes into restored_amount Restored Jade Statuettes before the event ends.
Only on the Beyond the Horizon server, in the Jade Desert. Each Restored Jade Statuette takes your
citadel level's early_conversion_ratio Ancient ones (GameData.citadel_levels); the conversion
cannot be undone.
Raises:
| Type | Description |
|---|---|
ValueError
|
|
CommandError
|
The server refused |
Client: ABGJadeStatuetteConversionComponent.sendConversion (split.js line 474233)
get_oasis_settlement
¶
get_oasis_settlement(x: int, y: int, kingdom: Kingdom = GREEN, *, timeout: float = 5.0) -> OasisSettlementResponse
The Oasis Settlement at (x, y): its level, the troops it has left to trade and its cooldown.
Only on the Beyond the Horizon server, in the Jade Desert.
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused |
Client: AllianceBattleGroundJadeTradeDialog (split.js line 564457) asks when it opens
send_oasis_trade
¶
send_oasis_trade(source_x: int, source_y: int, target_x: int, target_y: int, units: WodAmountMapping | Sequence[WodAmount], trades: Mapping[OasisTradeId, int], commander_id: int, *, kingdom: Kingdom = GREEN, horse_booster_id: Horse | None = None, feathers: bool = False, spend_rubies: bool = False, timeout: float = 5.0) -> SendOasisTradeResponse
Send troops and trading materials from your castle to the Oasis Settlement at (target_x, target_y).
Only on the Beyond the Horizon server, in the Jade Desert. The client sends from your main castle there.
trades names how often to make each of the settlement's trades (GameData.oasis_trades); the
materials they cost travel with the troops.
Rubies as for client.movements.send_troops: the premium commander and a horse that costs rubies unless
paid with feathers need spend_rubies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_x
|
int
|
Map x of the castle the troops leave from |
required |
source_y
|
int
|
Map y of the castle the troops leave from |
required |
target_x
|
int
|
The settlement's map x |
required |
target_y
|
int
|
The settlement's map y |
required |
units
|
WodAmountMapping | Sequence[WodAmount]
|
The units: |
required |
trades
|
Mapping[OasisTradeId, int]
|
How often to make each trade, |
required |
commander_id
|
int
|
The commander to lead them, a |
required |
kingdom
|
Kingdom
|
The settlement's kingdom |
GREEN
|
horse_booster_id
|
Horse | None
|
The horse, None for none; sent as none whenever feathers are used, as the client does |
None
|
feathers
|
bool
|
Pay for the horse with feathers |
False
|
spend_rubies
|
bool
|
Send even when the premium commander or the horse costs rubies |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
No trade is above 0, which the client cannot send; or the horse costs rubies and
|
PremiumCommanderCostError
|
The premium commander leads, may cost rubies, and |
CommandError
|
The server refused the trade |
Client: CastlePostTradeHorseDialog.sendTradeMovement (split.js line 566640); the trade button is
enabled only with a trade selected (AllianceBattleGroundJadeTradeDialog.updateTradeButton,
split.js line 564758)
create_topic
¶
create_topic(name: str, text: str, visible_ranks: list[ForumRankGroup], *, timeout: float = 5.0) -> None
Create a forum topic with explicit visibility groups and an opening post.
Titles must encode to 2–38 characters and posts to 2–2000. Server permission refusals raise CommandError. No created id is returned by the client handler.
reply
¶
Post a reply to a forum topic; permission refusals raise CommandError.
delete_topic
¶
Delete a forum topic; permission refusals raise CommandError.
delete_reply
¶
Delete a forum post; permission refusals raise CommandError.
set_topic_visibility
¶
set_topic_visibility(topic_id: int, visible_ranks: list[ForumRankGroup], *, timeout: float = 5.0) -> GetForumTopicResponse | None
Change the rank groups that can see a topic, returning its details when echoed.
get_forum_topics
¶
get_forum_topics(*, timeout: float = 5.0) -> GetForumTopicsResponse
Get visible forum topics, newest post first, and the total including hidden topics.
get_topic
¶
get_topic(topic_id: int, *, timeout: float = 5.0) -> GetForumTopicResponse
Open a forum topic and its posts. Opening it may mark it read on the server.
Client: CastleForumViewTopic.requestTopicData sends gtr (bundle line 33651);
GTRCommand.executeCommand (bundle line 121768) reads the topic, with
unread counts delivered separately by UTCCommand (bundle line 121785).
get_unread_topic_count
¶
Request the number of unread forum topics.
send_chat
¶
send_chat(message: str) -> None
Send a message to alliance chat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
The message text to send (will be auto-encoded) |
required |
get_chat_log
¶
get_chat_log(*, timeout: float = 5.0) -> list[ChatMessageData]
Get alliance chat history.
The game client never asks for acl; it only reads the acl the server
sends, which a live server pushes once at login. A live server also
answers this request, with the same CM list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Timeout in seconds to wait for response |
5.0
|
Returns:
| Type | Description |
|---|---|
list[ChatMessageData]
|
The messages of the acl reply's |
on_chat_message
¶
on_chat_message(callback: Callable[[AllianceChatMessageResponse], object]) -> None
Register a callback for incoming alliance chat messages.
The callback will be called whenever a chat message is received, including messages from other players and confirmations of your own.
Callbacks run on the receive thread: they must not block, and a call
that waits for a reply raises ReceiveThreadError.
Args: callback: Function that receives AllianceChatMessageResponse
Example:
def on_message(msg: AllianceChatMessageResponse):
print(f"[{msg.player_name}] {msg.decoded_text}")
client.alliance.on_chat_message(on_message)
on_chat_message.remove(callback) detaches it, a no-op if it is not
registered, so reconnect re-wiring can detach unconditionally.
Unregister a callback with on_chat_message.remove(callback).
on_help_update
¶
on_help_update(callback: Callable[[AllianceHelpUpdate], object]) -> None
Call callback with the login data's ahl section and each ahl, ahh, ahd and ahf push,
after help_requests is updated.
Detach it again with on_help_update.remove(callback), a no-op if it is not registered.
Unregister a callback with on_help_update.remove(callback).
help_member
¶
help_member(request: AllianceHelpRequest | int) -> None
Help one request on the help list.
The client has no handler for an ahc answer, so none is waited for.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
AllianceHelpRequest | int
|
An |
required |
help_all
¶
Help every request on the help list.
The client has no handler for an aha answer, so none is waited for.
request_build_help
¶
Ask the alliance to help build a building.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
building_id
|
int
|
The building's object id, e.g. |
required |
request_repair_help
¶
Ask the alliance to help repair a building.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
building_id
|
int
|
The damaged building's object id |
required |
request_recruit_help
¶
request_heal_help
¶
get_bookmarks
¶
get_bookmarks(*, timeout: float = 5.0) -> GetBookmarksResponse
Get your own and your alliance's map bookmarks.
Returns:
| Type | Description |
|---|---|
GetBookmarksResponse
|
The gbl reply: |
Raises:
| Type | Description |
|---|---|
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
add_bookmark
¶
add_bookmark(x: int, y: int, name: str, bookmark_type: BookmarkType = PLAYER_FRIEND, kingdom: Kingdom = GREEN, *, attack_in_seconds: int | None = None, attacker_ids: list[int] | None = None, message_attackers: bool = True, timeout: float = 5.0) -> Bookmark
Bookmark a map position: for yourself as a friend or an enemy, or for your alliance.
An own list holds MAX_PLAYER_BOOKMARKS, an alliance's MAX_ALLIANCE_BOOKMARKS;
the server refuses a bookmark past them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int
|
Map x |
required |
y
|
int
|
Map y |
required |
name
|
str
|
1 to |
required |
bookmark_type
|
BookmarkType
|
What it marks; the alliance types need the right to manage bookmarks |
PLAYER_FRIEND
|
kingdom
|
Kingdom
|
The kingdom |
GREEN
|
attack_in_seconds
|
int | None
|
An alliance attack order's attack, |
None
|
attacker_ids
|
list[int] | None
|
The members an attack order sends, at least one; only for |
None
|
message_attackers
|
bool
|
Whether an attack order's attackers get a message (the client's default) |
True
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
Bookmark
|
The bookmark added, with its |
Raises:
| Type | Description |
|---|---|
ValueError
|
The client's bookmark dialog would not send it |
NotInAllianceError
|
An alliance type while you are in no alliance; nothing is sent |
CommandError
|
The server refused it: |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: C2SAddBookmark (bundle line 68517), sent by
CastleWorldmapBookmarkSetDialog.onSubmitButtonClicked (bundle line 19584) once
isNameValid holds and, for an attack order, checkButtonSubmitState (bundle line
19547) sees an attacker; the time range is TeamAttackConfiguration's (bundle line
68564); the alliance tab is enabled only by playerCanCreateAllianceBookmark (bundle
line 19563), which needs isInAlliance; BADCommand (bundle line 131653)
change_bookmark
¶
change_bookmark(x: int, y: int, name: str, bookmark_type: BookmarkType = PLAYER_FRIEND, kingdom: Kingdom = GREEN, *, timeout: float = 5.0) -> Bookmark
Rename one of your own bookmarks, or switch it between friend and enemy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int
|
The bookmark's map x |
required |
y
|
int
|
The bookmark's map y |
required |
name
|
str
|
The new name, 1 to |
required |
bookmark_type
|
BookmarkType
|
|
PLAYER_FRIEND
|
kingdom
|
Kingdom
|
The bookmark's kingdom |
GREEN
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Returns:
| Type | Description |
|---|---|
Bookmark
|
The bookmark changed |
Raises:
| Type | Description |
|---|---|
ValueError
|
An alliance type, or a name the dialog would refuse; the client changes only own bookmarks |
CommandError
|
The server refused it |
EmpireTimeoutError / ConnectionClosedError
|
see |
Client: C2SChangeBookmark (bundle line 68532), sent by
CastleWorldmapBookmarkSetDialog.onSubmitButtonClicked (bundle line 19584) for an own
bookmark it edits; BCHCommand (bundle line 131672)
delete_bookmark
¶
delete_bookmark(bookmark: Bookmark, *, notify_attackers: bool = False, timeout: float = 5.0) -> None
Delete a bookmark: one of your own by its position, an alliance one by its id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bookmark
|
Bookmark
|
A |
required |
notify_attackers
|
bool
|
For an alliance bookmark, tell an attack order's attackers, as the delete dialog's notify button does |
False
|
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
The bookmark has no type the client knows, so it sends nothing |
NotInAllianceError
|
An alliance bookmark while you are in no alliance; nothing is sent |
Client: CastleBookmarkData.deleteBookmark (bundle line 33474) sends C2SDeleteBookmark
(bundle line 68457) for an own bookmark and C2SDeleteAllianceBookmark (bundle line 68446)
for an alliance one. deleteBookmark checks no alliance itself; nothing is sent outside
one, as the client creates alliance bookmarks only with isInAlliance
(playerCanCreateAllianceBookmark, bundle line 19563)
get_alliance_info
¶
get_alliance_info(alliance_id: int, *, timeout: float = 5.0) -> AllianceInfo
Get info about an alliance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alliance_id
|
int
|
Your own is |
required |
timeout
|
float
|
Timeout in seconds |
5.0
|
Raises:
| Type | Description |
|---|---|
PacketError
|
The reply names no alliance (no |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
get_members
¶
get_members(alliance_id: int, *, timeout: float = 5.0) -> list[AllianceMember]
Get the list of alliance members from the server.
This fetches alliance info and returns all members with their online status (via AMI array), level, rank, etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alliance_id
|
int
|
Your own is |
required |
timeout
|
float
|
Timeout in seconds to wait for response |
5.0
|
Returns:
| Type | Description |
|---|---|
list[AllianceMember]
|
List of AllianceMember objects |
get_online_members
¶
get_online_members(alliance_id: int, *, timeout: float = 5.0) -> list[AllianceMember]
Get alliance members who are currently online.
Fetches the member list and filters to only online members (members with online status from AMI array).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alliance_id
|
int
|
Your own is |
required |
timeout
|
float
|
Timeout in seconds to wait for response |
5.0
|
Returns:
| Type | Description |
|---|---|
list[AllianceMember]
|
List of online AllianceMember objects |
get_member
¶
get_member(alliance_id: int, player_id: int, *, timeout: float = 5.0) -> AllianceMember | None
Get one member of an alliance, from a fresh member list.
Your own alliance's members are also in client.state.get_own_alliance(), without a request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alliance_id
|
int
|
The alliance, as for |
required |
player_id
|
int
|
The member's |
required |
Returns:
| Type | Description |
|---|---|
AllianceMember | None
|
The member, or None when the alliance has no such member |
search_alliances
¶
search_alliances(search_term: str, *, timeout: float = 5.0) -> list[AllianceSearchResult]
Search for alliances by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_term
|
str
|
The alliance name to search for (partial match) |
required |
timeout
|
float
|
Timeout in seconds to wait for response |
5.0
|
Returns:
| Type | Description |
|---|---|
list[AllianceSearchResult]
|
List of AllianceSearchResult objects matching the search; empty when |
list[AllianceSearchResult]
|
the server finds none ( |
list[AllianceSearchResult]
|
shows as "alliance not found" ( |
Raises:
| Type | Description |
|---|---|
CommandError
|
The server refused for another reason |
PacketError
|
The reply's payload is not an object |
Example
Note: 'hgh' is shared with the highscore command. Requests for it run
one at a time, but after one times out its late reply can be taken by
the next, a get_highscore() call included. Replies carry LT and
LID, but the client takes the list and league a reply names rather
than the ones it asked for, so no reply is refused on them (see
GetHighscoreRequest).
get_local_members
¶
get_local_members(*, timeout: float = 5.0) -> list[AllianceMember]
Get members of the local player's alliance.
Convenience method that automatically uses the logged-in player's alliance ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Timeout in seconds to wait for response |
5.0
|
Returns:
| Type | Description |
|---|---|
list[AllianceMember]
|
List of AllianceMember objects |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance; nothing is sent |
get_local_online_members
¶
get_local_online_members(*, timeout: float = 5.0) -> list[AllianceMember]
Get online members of the local player's alliance.
Convenience method that automatically uses the logged-in player's alliance ID and filters to online members only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Timeout in seconds to wait for response |
5.0
|
Returns:
| Type | Description |
|---|---|
list[AllianceMember]
|
List of online AllianceMember objects |
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance; nothing is sent |
get_chronicle
¶
get_chronicle(*, timeout: float = 5.0) -> list[AllianceChronicleEntry]
Get your alliance's chronicle, newest first.
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
You are in no alliance (nothing is sent), or the server answered |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: CastleAllianceDialogOverview (bundle line 70407) asks for it
get_subscriber_count
¶
Get how many of your alliance's members have a subscription.
Sent outside an alliance too, as the client sends it at login and right after leaving one.
Raises:
| Type | Description |
|---|---|
NotInAllianceError
|
The server answered |
CommandError / EmpireTimeoutError / ConnectionClosedError
|
see |
Client: SubscriptionData.onGbdArrived (bundle line 120092) and
AQICommand.executeCommand (bundle line 121557) call requestASC
alliance.models.chronicle¶
Alliance chronicle and subscriber count.
Commands:
- all: Your alliance's chronicle, the log on the alliance overview
- asc: How many of your alliance's members have a subscription
Classes:
| Name | Description |
|---|---|
ChronicleDiplomacy |
A diplomacy entry: |
ChronicleBuff |
An alliance upgrade ( |
ChronicleAmount |
An amount, |
ChronicleLevel |
The alliance's level after |
ChroniclePlace |
The place the alliance came in, |
ChronicleTournamentPrize |
The alliance tournament's prize, |
ChronicleText |
|
ChronicleMember |
The member thrown out, demoted or promoted ( |
ChronicleDaimyoContract |
A daimyo alliance contract completed: |
AllianceChronicleRequest |
Ask for your alliance's chronicle. |
AllianceChronicleEntry |
One entry of your alliance's chronicle. |
AllianceChronicleResponse |
Your alliance's chronicle. |
AllianceSubscriberCountRequest |
Ask how many of your alliance's members have a subscription. |
AllianceSubscriberCountResponse |
How many of your alliance's members have a subscription. |
Attributes:
| Name | Type | Description |
|---|---|---|
ChronicleDetails |
What a chronicle entry's |
ChronicleDetails
module-attribute
¶
ChronicleDetails = ChronicleDiplomacy | ChronicleBuff | ChronicleAmount | ChronicleLevel | ChroniclePlace | ChronicleTournamentPrize | ChronicleText | ChronicleMember | ChronicleDaimyoContract
What a chronicle entry's AV holds, by action: AllianceChronicleEntry.details.
ChronicleDiplomacy
dataclass
¶
ChronicleDiplomacy(alliance_name: str | None, status: DiplomacyStatus | int | None)
A diplomacy entry: CHANGE_DIPLOMACY, GET_REQUEST_DIPLOMACY, SEND_REQUEST_DIPLOMACY or
REFUSE_DIPLOMACY.
Client: AllianceActionListItemVO.getActionText (bundle line 66342) reads AV[1] and AV[2]
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
alliance_name |
str | None
|
The other alliance's name, |
status |
DiplomacyStatus | int | None
|
The status changed to or asked for, |
ACTIONS
class-attribute
¶
ACTIONS: tuple[AllianceChronicleAction, ...] = (Action.CHANGE_DIPLOMACY, Action.GET_REQUEST_DIPLOMACY, Action.SEND_REQUEST_DIPLOMACY, Action.REFUSE_DIPLOMACY)
status
instance-attribute
¶
status: DiplomacyStatus | int | None
The status changed to or asked for, AV[2].
ChronicleBuff
dataclass
¶
ChronicleBuff(buff: AllianceBuffType | int | None, level: int | float | None = None)
An alliance upgrade (UPGRADE), or a boost bought or extended (ACTIVATE_TEMP_BUFF, EXTEND_TEMP_BUFF).
Client: AllianceActionListItemVO.getActionText (bundle lines 66344-66348) reads the buff
from AV[0], and for an UPGRADE of MEMBERS or FORGE_UPGRADE fills the text with the rest
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
buff |
AllianceBuffType | int | None
|
What was upgraded or boosted, |
level |
int | float | None
|
The smithy's new level, |
ChronicleAmount
dataclass
¶
An amount, AV[0]: coins, rubies, resources or glory donated, paid, won or received.
For the donations and MEMBER_EARN_FAME the client reads AV[0] as the amount, taking the
singular text for 1 (AllianceActionListItemVO.getActionText, bundle line 66350); for the
others only their text's {0} (dialog_alliance_chronic<action>) says so.
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
amount |
int | float | None
|
The amount, |
ACTIONS
class-attribute
¶
ACTIONS: tuple[AllianceChronicleAction, ...] = (Action.MEMBER_DONATE_COINS, Action.MEMBER_DONATE_RUBIES, Action.MEMBER_DONATE_RESOURCES, Action.MEMBER_EARN_FAME, Action.DONATE_COINS_BY_LEVEL_UP, Action.DONATE_RUBIES_BY_LEVEL_UP, Action.DONATE_RESOURCES_BY_LEVEL_UP, Action.PRIZE_COINS_OF_LAST_ROUND, Action.PRIZE_RUBIES_OF_LAST_ROUND, Action.TRIBUTE_PAY_COINS, Action.TRIBUTE_PAY_RUBIES, Action.TRIBUTE_PAY_RESOURCES, Action.TRIBUTE_GET_COINS, Action.TRIBUTE_GET_RUBIES, Action.TRIBUTE_GET_RESOURCES, Action.REWARD_COINS, Action.REWARD_RUBIES)
ChronicleLevel
dataclass
¶
The alliance's level after LEVEL_UP or LEVEL_DOWN, AV[0]: their text's {0}.
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
level |
int | float | None
|
The level reached, |
ChroniclePlace
dataclass
¶
The place the alliance came in, AV[0], of TOURNAMENT_RANK and ALLIANCE_RANK_OF_LAST_ROUND:
their text's {0}.
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
place |
int | float | None
|
The place, |
ChronicleTournamentPrize
dataclass
¶
The alliance tournament's prize, TOURNAMENT_REWARD: its text's {0} coins and {1} rubies.
AV[2] is the name the overview shows, AllianceChronicleEntry.named_alliance_name.
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
coins |
int | float | None
|
Coins won, |
rubies |
int | float | None
|
Rubies won, |
ACTIONS
class-attribute
¶
ACTIONS: tuple[AllianceChronicleAction, ...] = (Action.TOURNAMENT_REWARD,)
ChronicleText
dataclass
¶
ChronicleText(text: str | None)
AV[0], which the client puts in the text as it is: the new name of CHANGE_NAME, and
on Beyond the Horizon the tower defeated, the penalty increase in percent or the statuettes gained.
Client: AllianceActionListItemVO.getActionText (bundle line 66352)
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
text |
str | None
|
|
ChronicleMember
dataclass
¶
ChronicleMember(member_name: str | None)
The member thrown out, demoted or promoted (MEMBER_KICKED, MEMBER_DEMOTE, MEMBER_PROMOTE):
their text's {1}. Nothing in the client reads AV[0] of these entries.
Methods:
| Name | Description |
|---|---|
from_values |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
member_name |
str | None
|
The member's name, |
ChronicleDaimyoContract
dataclass
¶
ChronicleDaimyoContract(contract_id: DaimyoContractId | None)
A daimyo alliance contract completed: DAIMYO_ALLIANCE_CASTLE_CONTRACT_COMPLETED or
DAIMYO_ALLIANCE_TOWNSHIP_CONTRACT_COMPLETED.
Client: AllianceActionListItemVO.getActionText (bundle lines 66354-66357) reads the
contract from AV[0]
Methods:
| Name | Description |
|---|---|
from_values |
|
series_position |
The contract, its level within its rank (from 1) and how many levels the rank has. |
Attributes:
| Name | Type | Description |
|---|---|---|
ACTIONS |
tuple[AllianceChronicleAction, ...]
|
|
contract_id |
DaimyoContractId | None
|
The contract, |
ACTIONS
class-attribute
¶
ACTIONS: tuple[AllianceChronicleAction, ...] = (Action.DAIMYO_ALLIANCE_CASTLE_CONTRACT_COMPLETED, Action.DAIMYO_ALLIANCE_TOWNSHIP_CONTRACT_COMPLETED)
series_position
¶
series_position(*, game_data: GameData | None = None) -> tuple[DaimyoContractDef, int, int]
The contract, its level within its rank (from 1) and how many levels the rank has.
Both actions look the contract up among the daimyo castle contracts, a township's too, as the client does.
Raises:
| Type | Description |
|---|---|
KeyError
|
The castle contracts have no such contract |
Client: SamuraiDaimyoDataXml.getContractSeriesIndex and getNumberOfContractsForSeries
(bundle lines 13915-13925), with CONTRACT_TYPE_CASTLE (bundle lines 66354-66357)
AllianceChronicleRequest
pydantic-model
¶
Bases: BaseRequest
Ask for your alliance's chronicle.
Command: all Payload: {}
Client: C2SAllianceActionListVO (bundle line 70469)
AllianceChronicleEntry
pydantic-model
¶
Bases: BasePayload
One entry of your alliance's chronicle.
details types what action_values holds for the action; describe() writes the
entry's line as the overview shows it.
Client: AllianceActionListItemVO.parseActionListItem (bundle line 66338)
Fields:
-
player_id(ClientInt) -
player_name(str | None) -
seconds_ago(ClientInt) -
action(EnumOrInt[AllianceChronicleAction]) -
action_values(list[Any])
Validators:
-
_name→player_name -
_values→action_values
action
pydantic-field
¶
action: EnumOrInt[AllianceChronicleAction] = AllianceChronicleAction.MEMBER_JOIN
Wire key A
What happened
action_values
pydantic-field
¶
Wire key AV
The action's text arguments, which the client keeps as sent (AllianceActionListItemVO.parseActionListItem); typed by details
action_type
property
¶
action_type: AllianceChronicleAction | None
action as an AllianceChronicleAction, None for an action the client does not define.
details
property
¶
details: ChronicleDetails | None
What action_values holds for this action, typed; None for an action whose values nothing reads.
An entry about a player (a capital or metropolis taken or lost, a member removed for
inactivity, a new Storm Lord, an owner who joined) names them in player_name instead.
is_deleted_player
property
¶
is_deleted_player: bool
The entry's player has deleted their account since; the overview shows "Deleted player".
Client: CastleAllianceDialogOverview.fillActionList (bundle line 70410), PN starting !!!_
named_alliance_id
property
¶
named_alliance_id: int | None
The alliance the overview links for an entry no player made (player_id -1), AV[0].
None for an entry a player made, and for TOURNAMENT_REWARD and TOURNAMENT_RANK, which link none.
Client: CastleAllianceDialogOverview.fillActionList (bundle lines 70410-70420)
named_alliance_name
property
¶
named_alliance_name: str | None
The name the overview shows for an entry no player made (player_id -1): AV[1], or
AV[2] for TOURNAMENT_REWARD; None for TOURNAMENT_RANK and an entry a player made.
Client: CastleAllianceDialogOverview.fillActionList (bundle lines 70410-70420)
describe
¶
The entry's line in the chronicle, as the alliance overview writes it.
Fetches the language file on first use, as empire_core.texts.text does, and a daimyo contract
entry loads the game data on first use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_data
|
GameData | None
|
The game data a daimyo contract entry reads; |
None
|
lang
|
str
|
Language code (default: "en") |
'en'
|
skin
|
str
|
The skin of the special server played on, such as |
''
|
Raises:
| Type | Description |
|---|---|
GameDataNotLoadedError
|
A daimyo contract entry without |
KeyError
|
A daimyo contract the game data lacks, where the client fails too |
Client: AllianceActionListItemVO.getActionText (bundle lines 66341-66358), its text id
through SpecialServerHelper.checkTextIDForSkinText (bundle line 1679)
AllianceChronicleResponse
pydantic-model
¶
Bases: BaseResponse
Your alliance's chronicle.
Command: all
Client: ALLCommand.executeCommand (bundle line 121528) into
CastleAllianceData.parse_ALL (bundle line 11565), which reads AL
with AllianceInfoVO.parseActionList (bundle line 25962) and reverses it
Fields:
Validators:
-
_entries→entries
entries
pydantic-field
¶
entries: list[AllianceChronicleEntry]
Wire key AL
The entries, newest first
AllianceSubscriberCountRequest
pydantic-model
¶
Bases: BaseRequest
Ask how many of your alliance's members have a subscription.
Command: asc Payload: {}
Client: C2SGetAllianceSubscriberCountEventVO (bundle line 120106)
AllianceSubscriberCountResponse
pydantic-model
¶
Bases: BaseResponse
How many of your alliance's members have a subscription.
Command: asc
Client: ASCCommand.executeCommand (bundle line 128655) into
SubscriptionData.parseASC (bundle line 120005); the treasury's
subscriptions tab shows it against the member limit
(CastleAllianceDialogTreasurySubscriptions.updateSubscriberCount, bundle line 70697)
Fields:
alliance.models.chat¶
Alliance chat protocol models.
Commands:
- acm: Send/receive alliance chat messages
- acl: Get alliance chat log/history
Classes:
| Name | Description |
|---|---|
AllianceChatMessageRequest |
Request to send an alliance chat message. |
ChatMessageData |
One alliance chat message: an acm push's |
AllianceChatMessageResponse |
Response containing an alliance chat message. |
AllianceChatLogRequest |
Request to get alliance chat history. |
AllianceChatLogResponse |
Response containing alliance chat history. |
AllianceChatMessageRequest
pydantic-model
¶
Bases: BaseRequest
Request to send an alliance chat message.
Command: acm Payload: {"M": "encoded_message_text"}
The message text must be encoded; create does it.
Client: C2SAllianceChatVO (bundle line 66771)
Fields:
ChatMessageData
pydantic-model
¶
Bases: BasePayload
One alliance chat message: an acm push's CM block, or one entry of an acl reply's CM list.
sent_at is taken when the message is read, as the client dates it. Read-only.
Client: ChatMessageVO.parseObj (bundle line 111316), reached through
CastleChatData.getParsedMessage (bundle line 111301).
Fields:
-
player_id(ClientInt) -
player_name(str) -
message_text(str) -
age_seconds(int | float | None) -
sent_at(float | None)
Validators:
-
_missing_text_is_empty→player_name,message_text -
_age_as_number→age_seconds -
_date
message_text
pydantic-field
¶
message_text: str = ''
Wire key MT
The message text as sent, still encoded
age_seconds
pydantic-field
¶
Wire key MA
Seconds since the message was sent; None when the reply has no number for it
AllianceChatMessageResponse
pydantic-model
¶
Bases: BaseResponse
Response containing an alliance chat message.
Command: acm Payload: {"CM": {"PID": player_id, "PN": "player_name", "MT": "message_text", "MA": age_seconds}}
This is received when:
- Another player sends a message to alliance chat
- Confirmation of our own sent message
Client: ACMCommand.executeCommand (bundle line 121316) passes CM to
CastleChatData.parseSingleMessage (bundle line 111288).
Fields:
-
error_code(int) -
chat_message(ChatMessageData | None)
AllianceChatLogRequest
pydantic-model
¶
Bases: BaseRequest
Request to get alliance chat history.
Command: acl Payload: {} (empty)
The client never sends acl: it has no C2S VO for it, and the only
C2S_ALLIANCE_CHAT_LOG is an unused constant in ggs.dll (line 18958).
It only reads the acl the server sends, so this payload is not taken
from the client. A live server answers it with the CM list, and
also pushes one acl at login.
AllianceChatLogResponse
pydantic-model
¶
Bases: BaseResponse
Response containing alliance chat history.
Command: acl Payload: {"CM": [{"PID": player_id, "PN": "player_name", "MT": "message_text", "MA": age_seconds}, ...]}
Client: ACLCommand.executeCommand (bundle line 121301) passes the reply to
CastleChatData.parseHistory (bundle line 111294), which reads each
entry of CM as a ChatMessageVO.
Fields:
Validators:
-
_messages→chat_log
chat_log
pydantic-field
¶
chat_log: list[ChatMessageData]
Wire key CM
The messages, in the order the reply lists them
alliance.models.diplomacy¶
Alliance diplomacy, auto war, the newsletter and treasury donations.
Commands:
- adp: Change or propose a relation with another alliance
- ard: Refuse another alliance's request
- saw: Turn auto war on or off
- anl: Send the alliance newsletter
- ado: Donate to the alliance treasury
- gdr: What one of your castles has to donate
Classes:
| Name | Description |
|---|---|
ChangeDiplomacyRequest |
Change or propose your alliance's relation with another alliance. |
ChangeDiplomacyResponse |
The relation after a change, with both alliances. |
RefuseDiplomacyRequest |
Refuse another alliance's diplomacy request or peace offer. |
RefuseDiplomacyResponse |
The other alliance after a refusal. |
SetAutoWarRequest |
Turn auto war on or off. |
SetAutoWarResponse |
Auto war after the change. |
SendNewsletterRequest |
Send the alliance newsletter to every member. |
SendNewsletterResponse |
The answer to a newsletter; the client reads nothing from it. |
AllianceDonation |
What to donate to the alliance treasury. |
DonateRequest |
Donate resources from one of your castles to the alliance treasury. |
DonateResponse |
Your currencies and the alliance after a donation; the castle's |
GetDonationResourcesRequest |
Ask what one of your castles has to donate. |
DonationResourcesResponse |
The castle's resources and your special currencies, to donate from. |
ChangeDiplomacyRequest
pydantic-model
¶
Bases: BaseRequest
Change or propose your alliance's relation with another alliance.
Command: adp Payload: {"AID": alliance_id, "NDR": new_status, "T": tribute}
T is always sent; the client sets it only when accepting a peace offer,
to the offer's percentage, negative when it was demanded.
Client: C2SAllianceChangeDiplomacyVO (bundle line 22149), sent by
CastleAllianceRequestDiplomacyDialog.onAccept (bundle line 44785),
CastleReceivedPeaceOfferDialog.onAcceptConfirmed (bundle line 44856) and
CastleAllianceInfoDialogDiplomacy.sendNewRank (bundle line 72379)
Fields:
ChangeDiplomacyResponse
pydantic-model
¶
Bases: BaseResponse
The relation after a change, with both alliances.
Command: adp
Client: ADPCommand.executeCommand (bundle line 121361)
Fields:
-
error_code(int) -
old_status(ClientInt) -
new_status(ClientInt) -
request_status(ClientInt) -
own_alliance(AllianceInfo | None) -
other_alliance(AllianceInfo | None)
Validators:
-
_alliance→own_alliance,other_alliance
old_status
pydantic-field
¶
old_status: ClientInt = 0
Wire key ODR
The relation before, a DiplomacyStatus value
new_status
pydantic-field
¶
new_status: ClientInt = 0
Wire key NDR
The relation now, a DiplomacyStatus value
other_alliance
pydantic-field
¶
other_alliance: AllianceInfo | None = None
Wire key AO
The other alliance
RefuseDiplomacyRequest
pydantic-model
¶
Bases: BaseRequest
Refuse another alliance's diplomacy request or peace offer.
Command: ard Payload: {"AID": alliance_id}
Client: C2SAllianceRefuseDiplomacyVO (bundle line 44795), sent by
CastleAllianceRequestDiplomacyDialog.onRefuse (bundle line 44784) and
CastleReceivedPeaceOfferDialog (bundle line 44851)
Fields:
RefuseDiplomacyResponse
pydantic-model
¶
Bases: BaseResponse
The other alliance after a refusal.
Command: ard
Client: ARDCommand.executeCommand (bundle line 121574)
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
Validators:
-
_alliance→alliance
SetAutoWarRequest
pydantic-model
¶
Bases: BaseRequest
Turn auto war on or off.
Command: saw Payload: {"AW": 1 or 0}
Client: C2SSetAutoWar (bundle line 69369), sent by
CastleAllianceDialogDiplomacy.sendAutoWarUpdate (bundle line 69284)
Fields:
SetAutoWarResponse
pydantic-model
¶
Bases: BaseResponse
Auto war after the change.
Command: saw
Client: SAWCommand.executeCommand (bundle line 122010)
Fields:
-
error_code(int) -
auto_war(bool)
Validators:
-
_one_flag→auto_war
SendNewsletterRequest
pydantic-model
¶
Bases: BaseRequest
Send the alliance newsletter to every member.
Command: anl Payload: {"SJ": subject, "TXT": text}, both encoded as chat text
Client: C2SAllianceNewsletterVO (bundle line 69739), sent by
CastleAllianceMessageToAllDialog.onClick (bundle line 69715)
Fields:
SendNewsletterResponse
pydantic-model
¶
Bases: BaseResponse
The answer to a newsletter; the client reads nothing from it.
Command: anl
Client: ANLCommand.executeCommand (bundle line 121543)
Fields:
AllianceDonation
pydantic-model
¶
Bases: EmpireModel
What to donate to the alliance treasury.
These are the donatables the client offers a player: the
allianceFundsDonatables rows of items v786.03 with directlyByPlayer,
each sent under its CollectableHelper.getServerKeyByCollectable key,
the keys AllianceStorage reads.
Client: CastleAllianceDonateDialog.showLoaded (bundle line 45511)
Fields:
-
wood(int) -
stone(int) -
coins(int) -
rubies(int) -
iron(int) -
oil(int) -
glass(int) -
coal(int) -
alliance_coins(int) -
rift_coins(int) -
legendary_rift_coins(int)
DonateRequest
pydantic-model
¶
Bases: BaseRequest
Donate resources from one of your castles to the alliance treasury.
Command: ado Payload: {"AID": castle_id, "KID": kingdom, "RV": {key: amount, ...}}
AID is the donating castle, not the alliance.
Client: C2SAllianceDonateVO (bundle line 70645), sent by
CastleAllianceDonateDialog.onDonateForAlliance (bundle line 45571)
Fields:
castle_id
pydantic-field
¶
castle_id: int
Wire key AID
The donating castle, e.g. CastleInfo.castle_id
resources
pydantic-field
¶
Wire key RV
The amounts, keyed as AllianceDonation keys them
create
classmethod
¶
create(castle_id: int, kingdom: Kingdom, donation: AllianceDonation) -> DonateRequest
A donation of donation from castle_id.
DonateResponse
pydantic-model
¶
Bases: BaseResponse
Your currencies and the alliance after a donation; the castle's grc stays in the extra fields.
Command: ado
Client: ADOCommand.executeCommand (bundle line 121346)
Fields:
-
error_code(int) -
currency(CurrencyBlock) -
alliance(AllianceInfo | None)
Validators:
-
_alliance→alliance
currency
pydantic-field
¶
currency: CurrencyBlock = None
Wire key gcu
Coins and rubies after the donation
alliance
pydantic-field
¶
alliance: AllianceInfo | None = None
Wire key ain
The alliance after the donation
GetDonationResourcesRequest
pydantic-model
¶
Bases: BaseRequest
Ask what one of your castles has to donate.
Command: gdr Payload: {"AID": castle_id, "KID": kingdom}
AID is the castle, not the alliance.
Client: C2SGetDonationResourcesVO (bundle line 70681), sent with the picked castle's
objectId and kingdomID by CastleAllianceDonateDialog.selectCastle (bundle line 45573)
Fields:
DonationResourcesResponse
pydantic-model
¶
Bases: BaseResponse
The castle's resources and your special currencies, to donate from.
Command: gdr Payload: {"grc": {...}, "sce": [[currency_key, amount], ...]}
Client: GDRCommand.exec (bundle line 123053): CurrencyData.parseSCE (bundle line 141182)
sets each int(amount) on the currency with that key, and parseGRC applies the castle's resources
Fields:
-
error_code(int) -
resources(CastleResources) -
currencies(dict[Currency | str, int])
Validators:
-
_currencies→currencies
alliance.models.help¶
Alliance help: the help list, its pushes, and helping or asking for help.
Commands:
- ahl: The alliance help list
- ahh: One help request added or changed (push)
- ahd: One help request removed (push)
- ahf: Someone helped one of your requests (push)
- ahc: Help one request
- aha: Help every request
- ahr: Ask the alliance for help
Classes:
| Name | Description |
|---|---|
RecruitHelpParams |
The recruitment a recruit help request is for: its |
HealHelpParams |
The wounded units a heal help request is for: its |
BuildingHelpParams |
The building a repair or build help request is for: its |
AllianceHelpRequest |
One request on the alliance help list. |
AllianceHelpListResponse |
The alliance help list. |
AllianceHelpRequestChanged |
One help request added to the list or changed on it, pushed by the server. |
AllianceHelpRequestRemoved |
One help request taken off the list, pushed by the server. |
AllianceHelpReceived |
Someone helped one of your requests, pushed by the server. |
HelpMemberRequest |
Help one request on the alliance help list. |
HelpAllRequest |
Help every request on the alliance help list. |
AskHelpRequest |
Ask the alliance for help. |
AskHelpResponse |
The answer to asking for help; it carries nothing the client reads. |
Attributes:
| Name | Type | Description |
|---|---|---|
REPAIR_HELP_COOLDOWN_SECONDS |
Seconds between two repair help requests. Client: |
|
HelpParams |
|
REPAIR_HELP_COOLDOWN_SECONDS
module-attribute
¶
Seconds between two repair help requests. Client: AllianceConst.ALLIANCE_HELP_REPAIR_COOLDOWN (dll line 18772)
RecruitHelpParams
pydantic-model
¶
Bases: BasePayload
The recruitment a recruit help request is for: its OP.
Client: AllianceHelpRequestRecruitParamsVO.parseParams (bundle line 51138)
Fields:
HealHelpParams
pydantic-model
¶
Bases: BasePayload
The wounded units a heal help request is for: its OP.
Client: AllianceHelpRequestHealParamsVO.parseParams (bundle line 50800)
Fields:
BuildingHelpParams
pydantic-model
¶
Bases: BasePayload
The building a repair or build help request is for: its OP.
Client: AllianceHelpRequestRepairParamsVO.parseParams (bundle line 50054),
AllianceHelpRequestConstructionParamsVO.parseParams (bundle line 31702)
Fields:
AllianceHelpRequest
pydantic-model
¶
Bases: BasePayload
One request on the alliance help list.
Deliberately more lenient than the client: AllianceHelpRequestParamsFactory.parseParams
(bundle line 133451) switches on the raw TID and throws for any other type
or a missing OP, losing the whole list; here such an entry is skipped
alone, and TID is read with int(), so "3" counts as 3.
Client: AllianceHelpRequestData.parseHelpRequestEntry (bundle line 133416)
Fields:
-
already_confirmed(bool) -
list_id(ClientInt) -
player_name(str | None) -
progress(ClientInt) -
player_id(ClientInt) -
help_type(ClientInt) -
params(HelpParams) -
remaining_seconds(int | float)
Validators:
-
_params_by_type -
_name→player_name -
_truthy→already_confirmed -
_expiry→remaining_seconds
already_confirmed
pydantic-field
¶
already_confirmed: bool = False
Wire key AC
You already helped this request
help_type
pydantic-field
¶
help_type: ClientInt = 0
Wire key TID
What help is asked for, a HelpType value
params
pydantic-field
¶
params: HelpParams
Wire key OP
What the request is for; its shape follows help_type
remaining_seconds
pydantic-field
¶
Wire key RT
Seconds until the request expires; -1 when it does not
AllianceHelpListResponse
pydantic-model
¶
Bases: BaseResponse
The alliance help list.
Command: ahl, as a login section of gbd and as a push. The client
never asks for it: C2S_ALLIANCE_HELP_LIST (bundle line 71) has no VO
and no call site.
Client: AHLCommand.executeCommand (bundle line 121904),
AllianceHelpRequestData.parse_AHL (bundle line 133386), read from
gbd (bundle line 129381)
Fields:
Validators:
-
_requests→requests
AllianceHelpRequestChanged
pydantic-model
¶
Bases: BaseResponse
One help request added to the list or changed on it, pushed by the server.
Command: ahh
Payload: the request's own keys, plus TSL
Client: AHHCommand.executeCommand (bundle line 121889),
AllianceHelpRequestData.parse_AHH (bundle line 133394) replaces the
entry with the same LID or adds it
Fields:
-
error_code(int) -
request(AllianceHelpRequest | None) -
seconds_since_repair_help(ClientInt | None)
Validators:
-
_request_is_the_payload
request
pydantic-field
¶
request: AllianceHelpRequest | None = None
The request; None when unreadable
AllianceHelpRequestRemoved
pydantic-model
¶
Bases: BaseResponse
One help request taken off the list, pushed by the server.
Command: ahd
Client: AHDCommand.executeCommand (bundle line 121859),
AllianceHelpRequestData.parse_AHD (bundle line 133396)
Fields:
AllianceHelpReceived
pydantic-model
¶
Bases: BaseResponse
Someone helped one of your requests, pushed by the server.
Command: ahf
Client: AHFCommand.executeCommand (bundle line 121874),
AllianceHelpRequestData.parse_AHF (bundle line 133384); the feedback
component reads WID as a building's wod id (CastleAllianceHelpFeedbackComponent.createRepairTextContent,
bundle line 133550)
Fields:
-
error_code(int) -
helper_names(tuple[str, ...]) -
list_id(ClientInt) -
building_wod_id(Literal[0] | EnumOrInt['Building'])
Validators:
-
_names→helper_names
helper_names
pydantic-field
¶
Wire key PN
The helping players' names: one, or every member who helped the request together
HelpMemberRequest
pydantic-model
¶
Bases: BaseRequest
Help one request on the alliance help list.
Command: ahc Payload: {"LID": list_id, "KID": 1}
The client always sends KID 1, WorldDessert.KINGDOM_ID (dll line 20019).
Client: C2SAllianceHelpConfirmedVO (bundle line 105302), sent by
AllianceHelpRequestScrollItem.onMouseClick (bundle line 105288)
Fields:
-
list_id(int) -
kingdom_id(int)
for_request
classmethod
¶
for_request(request: AllianceHelpRequest) -> HelpMemberRequest
Help request.
HelpAllRequest
pydantic-model
¶
Bases: BaseRequest
Help every request on the alliance help list.
Command: aha Payload: {"KID": 15}
Client: C2SAllianceHelpAllRequestVO (bundle line 105268) defaults KID
to 15 and CastleAllianceActionOverviewDialogHelpRequest.onClick (bundle
line 105247) sends it with that default
Fields:
AskHelpRequest
pydantic-model
¶
Bases: BaseRequest
Ask the alliance for help.
Command: ahr Payload: {"ID": target_id, "T": type}
For heal help the client puts the hospital list id in T, not a help type.
Client: C2SAllianceHelpRequestVO (bundle line 36196), sent by
RingMenuButtonConstructionHelpRequest.onClick (bundle line 49994),
RingMenuButtonRepairHelpRequest.onClick (bundle line 81402) and
CastleAllianceHelpRequestButtonComponent.onClick (bundle line 50836)
Fields:
target_id
pydantic-field
¶
target_id: int
Wire key ID
The building, recruitment or hospital entry to help
type_id
pydantic-field
¶
type_id: int
Wire key T
The HelpType, or for heal help the hospital list id
build
classmethod
¶
build(building_id: int) -> AskHelpRequest
Ask for help building building_id, the building's object id.
repair
classmethod
¶
repair(building_id: int) -> AskHelpRequest
Ask for help repairing building_id, the building's object id.
recruit
classmethod
¶
recruit(recruit_id: int, help_type: HelpType) -> AskHelpRequest
Ask for help with the recruitment recruit_id; help_type is one of the three recruit types.
heal
classmethod
¶
heal(hospital_entry_id: int, hospital_list_id: int) -> AskHelpRequest
Ask for help healing the hospital entry hospital_entry_id on list hospital_list_id.
AskHelpResponse
pydantic-model
¶
Bases: BaseResponse
The answer to asking for help; it carries nothing the client reads.
Command: ahr
Client: AHRCommand.executeCommand (bundle line 121919)
Fields:
alliance.models.info¶
Alliance info models.
Commands:
- ain: Get alliance info (includes member list)
Classes:
| Name | Description |
|---|---|
AllianceMember |
One member of an ain reply's |
AllianceBuilding |
One alliance buff; Client: AllianceInfoVO.parseBuffList (bundle 25962–25966). |
AllianceStorage |
The alliance treasury, the |
AllianceMemberInfo |
A member's extra alliance info: one |
AllianceDiplomacyStatus |
The alliance's standing with one other alliance: an |
PeaceOffer |
An open peace offer between this alliance and yours: the ain block's |
CrestLayout |
One crest layout the alliance holds: an entry of the ain block's |
AllianceCrests |
The alliance's crest and its fallback: the ain block's |
AllianceInfo |
Full alliance information from ain response. |
GetAllianceInfoRequest |
Request alliance information including member list. |
GetAllianceInfoResponse |
Response containing alliance information. |
AllianceMember
pydantic-model
¶
Bases: PlayerProfileBase
One member of an ain reply's M list: an owner record.
The member's login activity comes from the alliance's AMI row for it
(AllianceMemberInfo.login_activity), an OnlineState value.
Client: AllianceInfoVO.parseMemberList (bundle line 25968) reads each
entry with CastleOtherPlayerData.parseOwnerInfo (bundle line 138996)
Fields:
-
player_id(ParseInt) -
name(str) -
emblem(OwnerCrest | None) -
level(ParseInt) -
legendary_level(ParseInt) -
beginner_protection_seconds(ParseInt) -
honor(ParseInt) -
might(ParseInt) -
top_ranking(ParseInt) -
is_ruin(bool) -
alliance_id(int) -
alliance_rank(int | None) -
alliance_name(str) -
is_searching_alliance(bool) -
revenge_protection_seconds(ParseInt) -
castle_positions(OwnerPositions) -
village_positions(OwnerPositions) -
has_premium_flag(bool) -
has_vip_flag(bool) -
is_dummy(bool) -
achievement_points(ParseInt) -
relocation_remaining_seconds(int) -
faction(OwnerFaction | None) -
alliance_emblem(AllianceEmblem | None) -
title_suffix(EnumOrInt['Title'] | None) -
title_prefix(EnumOrInt['Title'] | None) -
via_refer_a_friend(bool) -
received_at(float) -
received_at_wall(float)
member_info
property
¶
member_info: AllianceMemberInfo | None
The member's AMI row: donations, login activity and landmark counts; None when the reply has none.
Client: AllianceInfoVO.getAdditionalMemberInfos (bundle line 25979)
AllianceBuilding
pydantic-model
¶
Bases: BasePayload
One alliance buff; Client: AllianceInfoVO.parseBuffList (bundle 25962–25966).
Fields:
AllianceStorage
pydantic-model
¶
Bases: BasePayload
The alliance treasury, the STO block.
The client reads one key per allianceFundsDonatables row of the item
data, so a later items version can add keys; these are the rows of v786.03.
On a Beyond the Horizon server it reads the event's alliance currency
instead of AIN; that key stays in the model's extra fields.
Client: AllianceInfoVO.parseStorageFromServer (bundle line 25940), each key from
CollectableHelper.getServerKeyByCollectable (bundle line 1646) over
AllianceFundsDonatableVO (bundle line 66532); amounts floored by
ACollectableItemVO.amount (bundle line 3575)
Fields:
-
wood(StorageAmount) -
stone(StorageAmount) -
coins(StorageAmount) -
rubies(StorageAmount) -
iron(StorageAmount) -
oil(StorageAmount) -
glass(StorageAmount) -
coal(StorageAmount) -
fury_doubloons(StorageAmount) -
time_doubloons(StorageAmount) -
spirit_doubloons(StorageAmount) -
vigor_doubloons(StorageAmount) -
bastion_doubloons(StorageAmount) -
rampart_doubloons(StorageAmount) -
alliance_coins(StorageAmount) -
rift_coins(StorageAmount) -
legendary_rift_coins(StorageAmount) -
alliance_influence(StorageAmount)
bastion_doubloons
pydantic-field
¶
bastion_doubloons: StorageAmount = 0
Wire key BD
Bastion doubloons
rampart_doubloons
pydantic-field
¶
rampart_doubloons: StorageAmount = 0
Wire key RD
Rampart doubloons
legendary_rift_coins
pydantic-field
¶
legendary_rift_coins: StorageAmount = 0
Wire key LRC
Legendary rift coins
alliance_influence
pydantic-field
¶
alliance_influence: StorageAmount = 0
Wire key AIN
Alliance influence; only on Beyond the Horizon servers
AllianceMemberInfo
pydantic-model
¶
Bases: BasePayload
A member's extra alliance info: one AMI row.
Client: AdditionalMemberInfoVO.parseAMI (bundle line 66296) shifts the
fields off in this order and reads each with int, so a missing field is 0.
Fields:
-
player_id(ClientInt) -
given_coins(ClientInt) -
given_rubies(ClientInt) -
given_resources(ClientInt) -
login_activity(ClientInt) -
capital_count(ClientInt) -
metropolis_count(ClientInt) -
royal_tower_count(ClientInt) -
monument_count(ClientInt) -
laboratory_count(ClientInt) -
daily_glory(ClientInt)
Validators:
-
_from_row
login_activity
pydantic-field
¶
login_activity: ClientInt = 0
0 online, 1 last 12 hours, 2 last 48 hours, 3 last week, 4 longer ago
login_activity_enum
property
¶
login_activity_enum: OnlineState | None
login_activity as an OnlineState, None for a value the client does not define.
AllianceDiplomacyStatus
pydantic-model
¶
Bases: BasePayload
The alliance's standing with one other alliance: an ADL entry.
Client: AllianceInfoVO.parseStatusList (bundle line 25973) into an
OtherAllianceStatusListItemVO (bundle line 66330).
Fields:
-
alliance_id(ClientInt) -
alliance_name(str | None) -
status(ClientInt) -
status_confirmed(ClientInt)
alliance_name
pydantic-field
¶
alliance_name: str | None = None
Wire key AN
The other alliance's name
status
pydantic-field
¶
status: ClientInt = 0
Wire key AS
0 at war, 1 neutral, 2 soft allied, 3 real allied
status_confirmed
pydantic-field
¶
status_confirmed: ClientInt = 0
Wire key AC
1 once agreed, 0 while only requested
status_enum
property
¶
status_enum: DiplomacyStatus | None
status as a DiplomacyStatus, None for a value the client does not define.
PeaceOffer
pydantic-model
¶
Bases: BasePayload
An open peace offer between this alliance and yours: the ain block's PO.
Client: AllianceInfoVO.fillFromParamObject (bundle line 25928) reads T
and TS into a PeaceOfferVO (bundle line 42688)
Fields:
Validators:
-
_seconds→remaining_seconds
CrestLayout
pydantic-model
¶
Bases: BasePayload
One crest layout the alliance holds: an entry of the ain block's ACLS.
The client stores the colours from ACLCS and never reads them; live replies have been
seen carrying ACCS there instead, which stays in the extra fields.
Client: AllianceInfoVO.fillFromParamObject (bundle line 25932)
Fields:
-
layout_id(EnumOrInt['AllianceCrestLayout'] | None) -
seconds_left(int | float) -
is_active(bool) -
color_ids(tuple[Annotated[EnumOrInt['AllianceCrestColor'], BeforeValidator(js_int)], ...] | None)
Validators:
-
_layout→layout_id -
_seconds→seconds_left -
_colors→color_ids -
_one_flag→is_active
AllianceCrests
pydantic-model
¶
Bases: BasePayload
The alliance's crest and its fallback: the ain block's aee.
Client: CastleAllianceData.parseAllianceCrestForAlliance (bundle line 11589);
AllianceInfoVO.parseFallbackCrest (bundle line 26146) keeps ACFB only
when it has both ACLI and ACCS
Fields:
-
crest(AllianceCrest | None) -
fallback_crest(AllianceCrest | None)
Validators:
-
_crest→crest -
_fallback→fallback_crest
crest
pydantic-field
¶
crest: AllianceCrest | None = None
Wire key ACCA
The current crest; None when unsent, where the client draws a random one
fallback_crest
pydantic-field
¶
fallback_crest: AllianceCrest | None = None
Wire key ACFB
The fallback crest
AllianceInfo
pydantic-model
¶
Bases: BasePayload
Full alliance information from ain response.
Contains alliance details, member list, buildings, storage, etc.
Client: AllianceInfoVO.fillFromParamObject (bundle line 25928), parseMemberList (bundle line 25968),
parseStorageFromServer (bundle line 25940), parseBuffList (bundle line 25955);
CastleAllianceData.parseAllianceInfo (bundle line 11609) for RT
Fields:
-
alliance_id(ParseInt) -
name(str) -
members(list[AllianceMember]) -
glory_points(ClientInt) -
highest_glory_points(ParseInt) -
might(ParseInt) -
highest_alliance_might(ParseInt) -
description(str) -
announcement(str) -
language(str) -
external_member_level(ParseInt) -
status_to_own_alliance(ParseInt) -
is_searching_members(bool) -
is_accepting_members(bool) -
application_count(ParseInt) -
auto_war(bool) -
cargo_points(int | float) -
free_renames(ClientInt) -
can_be_invited_to_hard_pact(bool) -
can_be_invited_to_soft_pact(bool) -
is_able_to_forge(bool) -
is_forge_inventory_full(bool) -
soft_relic_forge_uses(ClientInt) -
hard_relic_forge_uses(ClientInt) -
is_king_alliance(bool) -
refresh_seconds(ClientInt) -
peace_offer(PeaceOffer | None) -
crest_layouts(list[CrestLayout]) -
crests(AllianceCrests | None) -
storage(AllianceStorage | None) -
buildings(list[AllianceBuilding]) -
member_info(list[AllianceMemberInfo]) -
alliance_diplomacy(list[AllianceDiplomacyStatus]) -
capitals(list[MapAreaItem]) -
metropolises(list[MapAreaItem]) -
royal_towers(list[MapAreaItem]) -
monuments(list[MapAreaItem]) -
laboratories(list[MapAreaItem])
Validators:
-
_member_records→members -
_applications→application_count -
_truthy_flag→is_searching_members,is_accepting_members -
_one_flag→auto_war,can_be_invited_to_hard_pact,can_be_invited_to_soft_pact,is_able_to_forge,is_forge_inventory_full,is_king_alliance -
_unread_keys -
_chat_text→description,announcement -
_empty_announcement→announcement -
_object_block→peace_offer,crests -
_crest_layouts→crest_layouts -
_member_info_rows→member_info -
_diplomacy_entries→alliance_diplomacy -
_landmark_rows→capitals,metropolises,royal_towers,monuments,laboratories
highest_glory_points
pydantic-field
¶
highest_glory_points: ParseInt = 0
Wire key HF
Highest glory points reached
highest_alliance_might
pydantic-field
¶
highest_alliance_might: ParseInt = 0
Wire key HAMP
Highest might points reached
description
pydantic-field
¶
description: str = ''
Wire key D
The alliance's description, decoded as chat text
announcement
pydantic-field
¶
announcement: str = ' '
Wire key A
The alliance's announcement; " " when it has none
external_member_level
pydantic-field
¶
external_member_level: ParseInt = 0
Wire key ML
External member level
status_to_own_alliance
pydantic-field
¶
status_to_own_alliance: ParseInt = 0
Wire key DOA
Diplomacy status towards the player's own alliance, a DiplomacyStatus value
is_searching_members
pydantic-field
¶
is_searching_members: bool = False
Wire key IS
The alliance is looking for players
is_accepting_members
pydantic-field
¶
is_accepting_members: bool = False
Wire key IA
Players may join without an invitation
application_count
pydantic-field
¶
application_count: ParseInt = 12
Wire key AA
Pending applications
can_be_invited_to_hard_pact
pydantic-field
¶
can_be_invited_to_hard_pact: bool = False
Wire key HP
Open to hard pact invitations
can_be_invited_to_soft_pact
pydantic-field
¶
can_be_invited_to_soft_pact: bool = False
Wire key SP
Open to soft pact invitations
is_able_to_forge
pydantic-field
¶
is_able_to_forge: bool = False
Wire key MF
The alliance forge can be used
is_forge_inventory_full
pydantic-field
¶
is_forge_inventory_full: bool = False
Wire key IF
The alliance forge inventory is full
soft_relic_forge_uses
pydantic-field
¶
soft_relic_forge_uses: ClientInt = 0
Wire key SRFU
Soft relic forge uses
hard_relic_forge_uses
pydantic-field
¶
hard_relic_forge_uses: ClientInt = 0
Wire key HRFU
Hard relic forge uses
is_king_alliance
pydantic-field
¶
is_king_alliance: bool = False
Wire key KA
The alliance holds the king title
refresh_seconds
pydantic-field
¶
refresh_seconds: ClientInt = 0
Wire key RT
Seconds until the alliance should be requested again; 0 when none is set
peace_offer
pydantic-field
¶
peace_offer: PeaceOffer | None = None
Wire key PO
The open peace offer with your alliance; None when there is none
crest_layouts
pydantic-field
¶
crest_layouts: list[CrestLayout]
Wire key ACLS
The crest layouts the alliance holds
member_info
pydantic-field
¶
member_info: list[AllianceMemberInfo]
Wire key AMI
Donations, activity and landmark counts per member
alliance_diplomacy
pydantic-field
¶
alliance_diplomacy: list[AllianceDiplomacyStatus]
Wire key ADL
The alliance's standing with other alliances
capitals
pydantic-field
¶
capitals: list[MapAreaItem]
Wire key ACA
Map rows of the alliance's capitals
metropolises
pydantic-field
¶
metropolises: list[MapAreaItem]
Wire key ATC
Map rows of the alliance's metropolises
royal_towers
pydantic-field
¶
royal_towers: list[MapAreaItem]
Wire key AKT
Map rows of the alliance's royal towers
monuments
pydantic-field
¶
monuments: list[MapAreaItem]
Wire key AMO
Map rows of the alliance's monuments
laboratories
pydantic-field
¶
laboratories: list[MapAreaItem]
Wire key ALA
Map rows of the alliance's laboratories
read_fields
property
¶
The fields the reply set: the sent ones, and every forge field when MF and IF are sent.
status_to_own_alliance_enum
property
¶
status_to_own_alliance_enum: DiplomacyStatus | None
status_to_own_alliance as a DiplomacyStatus, None for a value the client does not define.
online_members
property
¶
online_members: list[AllianceMember]
Get list of currently online members.
leader
property
¶
leader: AllianceMember | None
The member with rank 0, None when there is none.
Client: AllianceInfoVO.allianceLeader (bundle line 25986)
filled_over
¶
filled_over(previous: AllianceInfo) -> AllianceInfo
These details read over previous ones of the same alliance, as the client fills the alliance it holds.
What a reply leaves out keeps previous's value: the application count, auto war and cargo
points when unsent or null; the storage, crest layouts and crest when falsy; the forge fields
unless both MF and IF are sent.
Client: CastleAllianceData.parseAllianceInfo (split.js line 61810) fills the alliance it already
holds with AllianceInfoVO.fillFromParamObject (split.js line 137516) and reads aee only when truthy
GetAllianceInfoRequest
pydantic-model
¶
Bases: BaseRequest
Request alliance information including member list.
Command: ain Payload: {"AID": alliance_id}
Returns full alliance info with all members, their online status (via AMI array), level, rank, castle count, and might.
Client: C2SGetAllianceInfoVO (bundle line 9760)
Fields:
GetAllianceInfoResponse
pydantic-model
¶
Bases: BaseResponse
Response containing alliance information.
Command: ain Payload: {"A": {"AID": ..., "N": ..., "M": [...], ...}}
Client: AINCommand.executeCommand (bundle line 121461)
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
alliance
pydantic-field
¶
alliance: AllianceInfo | None = None
Wire key A
The alliance; None without an AID
online_members
property
¶
online_members: list[AllianceMember]
Get list of currently online members.
AllianceGloryResponse
pydantic-model
¶
Bases: BaseResponse
Your alliance's glory points, pushed as they change.
Command: afa, a push.
Client: AFACommand.executeCommand (bundle line 121465), which does nothing without an alliance;
AllianceInfoVO.parseAFA (bundle line 26001), which reads both through int()
Fields:
AllianceBuffsResponse
pydantic-model
¶
Bases: BaseResponse
Your alliance's buffs, replacing the ones held: the list under ABL, or the payload itself.
Command: abl, a push.
Client: ABLCommand.executeCommand (bundle line 121304), CastleAllianceData.parse_ABL (bundle
line 11568), AllianceInfoVO.parseABL (bundle line 26003): parseBuffList(e.ABL ? e.ABL : e)
Fields:
-
error_code(int) -
buildings(tuple[AllianceBuilding, ...])
Validators:
-
_list_body -
_rows→buildings
buildings
pydantic-field
¶
buildings: tuple[AllianceBuilding, ...] = ()
Wire key ABL
The alliance's buffs
AllianceCrestChangedResponse
pydantic-model
¶
Bases: BaseResponse
Your alliance's crest changed.
The current crest and a fallback come inside ACCA; a top-level ACFB then replaces the
fallback, as the client reads it last.
Command: aee, a push.
Client: AEECommand.executeCommand (bundle line 121450) hands ACCA to
CastleAllianceData.parse_AEE (bundle line 11595) and parseAllianceCrestForAlliance, then
ACFB to AllianceInfoVO.parseFallbackCrest (bundle line 26195)
Fields:
-
error_code(int) -
crests(AllianceCrests | None) -
fallback_crest(AllianceCrest | None)
Validators:
-
_block→crests -
_fallback→fallback_crest
crests
pydantic-field
¶
crests: AllianceCrests | None = None
Wire key ACCA
The crest and its fallback; None when no object was sent
fallback_crest
pydantic-field
¶
fallback_crest: AllianceCrest | None = None
Wire key ACFB
The fallback crest that wins; None unless it has ACLI and ACCS
alliance_block
¶
An alliance block to read, or None: one without an AID is not read.
Client: CastleAllianceData.parseAllianceInfo (bundle line 11605)
alliance.models.members¶
Alliance member management.
Commands:
- akm: Kick a member
- arm: Change a member's rank
- aip: Invite a player
- aal: The alliance's applications
- aaa: Answer an application
- aqi: Leave the alliance
Classes:
| Name | Description |
|---|---|
KickMemberRequest |
Remove a member from your alliance. |
KickMemberResponse |
The alliance after a kick. |
RerankMemberRequest |
Give a member another rank; rank 0 hands over the leadership. |
RerankMemberResponse |
The alliance after a rank change. |
InvitePlayerRequest |
Invite a player to your alliance. |
InvitePlayerResponse |
The answer to an invitation; |
AllianceApplicationListRequest |
Ask for your alliance's applications. |
AllianceApplication |
One application to join your alliance. |
AllianceApplicationListResponse |
Your alliance's applications, with the applicants' owner records. |
AnswerApplicationRequest |
Accept or refuse an application. |
AnswerApplicationResponse |
The answer to answering an application; the client reads nothing from it. |
QuitAllianceRequest |
Leave your alliance. |
QuitAllianceResponse |
The answer to leaving; its |
KickMemberRequest
pydantic-model
¶
Bases: BaseRequest
Remove a member from your alliance.
Command: akm Payload: {"PID": player_id}
Client: C2SAllianceKickMemberVO (bundle line 70354), sent by
CastleAllianceMemberSettingsDialog.onKickMember (bundle line 70332)
Fields:
KickMemberResponse
pydantic-model
¶
Bases: _AllianceEcho
The alliance after a kick.
Command: akm
Client: AKMCommand.executeCommand (bundle line 121513)
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
Validators:
-
_alliance→alliance
RerankMemberRequest
pydantic-model
¶
Bases: BaseRequest
Give a member another rank; rank 0 hands over the leadership.
Command: arm Payload: {"PID": player_id, "R": rank}
Client: C2SAllianceRerankMemberVO (bundle line 70363), sent by
CastleAllianceMemberSettingsDialog.changeMemberRank (bundle line 70333) and
sendNewLeader (bundle line 70320)
Fields:
-
player_id(int) -
rank(AllianceRank)
RerankMemberResponse
pydantic-model
¶
Bases: _AllianceEcho
The alliance after a rank change.
Command: arm
Client: ARMCommand.executeCommand (bundle line 121589); it takes NO_CHANGE
as nothing to do
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
Validators:
-
_alliance→alliance
InvitePlayerRequest
pydantic-model
¶
Bases: BaseRequest
Invite a player to your alliance.
Command: aip Payload: {"SV": "player_id"}
Both call sites send the player's id as a string, not a name.
Client: C2SAllianceInvitePlayerVO (bundle line 42819), sent by
CastlePlayerInfoDialog.onInvitePlayerToAlliance (bundle line 3928) and
CastleMapobjectInfoComponent.onInvitePlayerToAlliance (bundle line 66485)
Fields:
for_player
classmethod
¶
for_player(player_id: int) -> InvitePlayerRequest
Invite the player player_id.
InvitePlayerResponse
pydantic-model
¶
Bases: BaseResponse
The answer to an invitation; INVALID_PLAYER_ID when there is no such player.
Command: aip
Client: AIPCommand.executeCommand (bundle line 121476)
Fields:
AllianceApplicationListRequest
pydantic-model
¶
Bases: BaseRequest
Ask for your alliance's applications.
Command: aal Payload: {}
Client: C2SAllianceApplicationListVO (bundle line 70138)
AllianceApplication
pydantic-model
¶
Bases: BasePayload
One application to join your alliance.
Client: AllianceApplicationListItemVO.parseItem (bundle line 66522)
Fields:
Validators:
-
_text→text -
_seconds→seconds_since_applied
AllianceApplicationListResponse
pydantic-model
¶
Bases: BaseResponse
Your alliance's applications, with the applicants' owner records.
Command: aal
Client: AALCommand.executeCommand (bundle line 121217) reads OI
with parseOwnerInfoArray and AL with CastleAllianceData.parse_AAL
(bundle line 11590), which sorts the applications by distance
Fields:
Validators:
-
_applications→applications -
_owners→owners
applications
pydantic-field
¶
applications: list[AllianceApplication]
Wire key AL
The applications, nearest first
owner_of
¶
owner_of(application: AllianceApplication) -> PlayerProfileBase | None
The applicant's owner record, None when the reply has none.
AnswerApplicationRequest
pydantic-model
¶
Bases: BaseRequest
Accept or refuse an application.
Command: aaa Payload: {"PID": player_id, "A": 1 or 0}
Client: C2SAllianceAnswerApplicationVO (bundle line 70244), sent by
CastleAllianceReadApplicationDialog.onAcceptApplication and
onDenyApplication (bundle line 70231)
Fields:
AnswerApplicationResponse
pydantic-model
¶
Bases: BaseResponse
The answer to answering an application; the client reads nothing from it.
Command: aaa
Client: AAACommand.executeCommand (bundle line 121191)
Fields:
QuitAllianceRequest
pydantic-model
¶
Bases: BaseRequest
Leave your alliance.
Command: aqi Payload: {}
Client: C2SAllianceQuitVO (bundle line 69639), sent by
CastleAllianceDialogManagement.quitAlliance (bundle line 69616)
QuitAllianceResponse
pydantic-model
¶
Bases: BaseResponse
The answer to leaving; its gal block stays in the extra fields.
Command: aqi
Client: AQICommand.executeCommand (bundle line 121556)
Fields:
alliance.models.bookmarks¶
Map bookmarks, your own and your alliance's.
Commands:
- gbl: Your own and your alliance's bookmarks
- bad / bch / bde / abd: Add, change and delete a bookmark; abd deletes an alliance bookmark
Classes:
| Name | Description |
|---|---|
GetBookmarksRequest |
Ask for your own and your alliance's map bookmarks. |
BookmarkAttackOrder |
The attack order an alliance attack order bookmark carries. |
Bookmark |
One map bookmark: an entry of a gbl reply's |
GetBookmarksResponse |
Your own and your alliance's map bookmarks. |
AddBookmarkRequest |
Bookmark a map position, for yourself or for your alliance. |
AddBookmarkResponse |
The bookmark added, read as a gbl entry. |
ChangeBookmarkRequest |
Rename one of your own bookmarks, or switch it between friend and enemy. |
ChangeBookmarkResponse |
The bookmark changed, read as a gbl entry. |
DeleteBookmarkRequest |
Delete own bookmarks by their positions. |
BookmarkPosition |
Where a deleted bookmark was. |
DeleteBookmarkResponse |
The own bookmarks deleted. |
DeleteAllianceBookmarkRequest |
Delete alliance bookmarks by their ids. |
DeleteAllianceBookmarkResponse |
Acknowledgement of a deleted alliance bookmark; the client reads nothing from it. |
Attributes:
| Name | Type | Description |
|---|---|---|
BOOKMARK_NAME_MAX_LENGTH |
The longest bookmark name the client's bookmark dialog takes: twice the castle name's limit. |
|
MAX_PLAYER_BOOKMARKS |
How many own bookmarks a player keeps. |
|
MAX_ALLIANCE_BOOKMARKS |
How many bookmarks an alliance keeps. |
|
ATTACK_ORDER_MIN_SECONDS |
The soonest an alliance attack order may be set, in seconds from now. |
|
ATTACK_ORDER_MAX_SECONDS |
The latest an alliance attack order may be set, in seconds from now. |
BOOKMARK_NAME_MAX_LENGTH
module-attribute
¶
The longest bookmark name the client's bookmark dialog takes: twice the castle name's limit.
Client: CastleWorldmapBookmarkSetDialog.initLoaded (bundle line 19546) sets maxChars to
2 * PlayerConst.CASTLE_NAME_MAX_LENGTH (dll line 19599)
MAX_PLAYER_BOOKMARKS
module-attribute
¶
How many own bookmarks a player keeps.
Client: PlayerConst.BOOKMARKS_MAX_ENTRYS (dll line 19599), read by CastleBookmarkData.isPlayerListFull
MAX_ALLIANCE_BOOKMARKS
module-attribute
¶
How many bookmarks an alliance keeps.
Client: AllianceConst.ALLIANCE_BOOKMARK_MAX_ENTRIES (dll line 18805), read by
CastleBookmarkData.isAllianceListFull
ATTACK_ORDER_MIN_SECONDS
module-attribute
¶
The soonest an alliance attack order may be set, in seconds from now.
Client: AllianceConst.ALLIANCE_BOOKMARK_MIN_TIME_OFFSET (dll line 18782), checked by
TeamAttackConfiguration (bundle line 68564)
ATTACK_ORDER_MAX_SECONDS
module-attribute
¶
The latest an alliance attack order may be set, in seconds from now.
Client: AllianceConst.ALLIANCE_BOOKMARK_MAX_TIME_OFFSET (dll line 18783), checked by
TeamAttackConfiguration (bundle line 68564)
GetBookmarksRequest
pydantic-model
¶
Bases: BaseRequest
Ask for your own and your alliance's map bookmarks.
Command: gbl Payload: {}
Client: C2SGetBookmarkList (bundle line 25872)
BookmarkAttackOrder
pydantic-model
¶
Bases: BasePayload
The attack order an alliance attack order bookmark carries.
Client: CastleBookmarkAttackOrderDetailsVO.parseParamObject (bundle line 68503)
Fields:
-
assigned_attacker_ids(list[int]) -
attack_in_seconds(int | float | None)
Validators:
-
_player_ids→assigned_attacker_ids -
_number→attack_in_seconds
Bookmark
pydantic-model
¶
Bases: BasePayload
One map bookmark: an entry of a gbl reply's BL or ABL.
Client: CastleBookmarkData.parseBookmarkObject (bundle line 33427) reads
OI as an owner record, then CastleWorldmapBookmarkVO.parseParamObject
(bundle line 68469) reads the rest.
Fields:
-
kingdom(ClientInt) -
x(ClientInt) -
y(ClientInt) -
area(MapAreaItem | None) -
owner(PlayerProfileBase | None) -
name(str | None) -
bookmark_type(int | None) -
bookmark_id(ClientInt) -
creator_id(ClientInt) -
attack_order(BookmarkAttackOrder | None)
Validators:
-
_flat_entry -
_name→name -
_area_row→area -
_owner_record→owner -
_type→bookmark_type
owner
pydantic-field
¶
owner: PlayerProfileBase | None = None
Wire key OI
The owner record of the bookmarked area
bookmark_type
pydantic-field
¶
bookmark_type: int | None = None
Wire key TY
What the bookmark marks, a BookmarkType value
creator_id
pydantic-field
¶
creator_id: ClientInt = 0
Wire key C
The player who made it; 0 when unsent
attack_order
pydantic-field
¶
attack_order: BookmarkAttackOrder | None = None
The attack order; only on alliance attack order bookmarks
bookmark_type_enum
property
¶
bookmark_type_enum: BookmarkType | None
bookmark_type as a BookmarkType, None for a type the client does not define.
GetBookmarksResponse
pydantic-model
¶
Bases: BaseResponse
Your own and your alliance's map bookmarks.
Command: gbl
Client: GBLCommand.executeCommand (bundle line 131706),
CastleBookmarkData.parse_GBL (bundle line 33453)
Fields:
Validators:
-
_entries→own_bookmarks,alliance_bookmarks
AddBookmarkRequest
pydantic-model
¶
Bases: BaseRequest
Bookmark a map position, for yourself or for your alliance.
Command: bad Payload: {"K", "X", "Y", "TY", "TI", "IM", "N", "M"}, in the client's key order
Only an alliance attack order carries its time (TI, seconds from now), its attackers
(M) and whether they get a message (IM); every other bookmark sends -1, []
and 0. The name goes out as typed.
Client: C2SAddBookmark (bundle line 68517), sent by
CastleWorldmapBookmarkSetDialog.onSubmitButtonClicked (bundle line 19584); the attack
order's seconds from TeamAttackConfiguration.updateDateAndTimeDisplay (bundle line 68566)
Fields:
-
kingdom(int) -
x(int) -
y(int) -
bookmark_type(int) -
attack_in_seconds(int) -
message_attackers(int) -
name(str) -
attacker_ids(list[int])
AddBookmarkResponse
pydantic-model
¶
Bases: BaseResponse, Bookmark
The bookmark added, read as a gbl entry.
Command: bad
Client: BADCommand.executeCommand (bundle line 131653) passes the reply to
CastleBookmarkData.parse_BAD (bundle line 33442), which reads it with
parseBookmarkObject (bundle line 33427)
Fields:
-
kingdom(ClientInt) -
x(ClientInt) -
y(ClientInt) -
area(MapAreaItem | None) -
owner(PlayerProfileBase | None) -
name(str | None) -
bookmark_type(int | None) -
bookmark_id(ClientInt) -
creator_id(ClientInt) -
attack_order(BookmarkAttackOrder | None) -
error_code(int)
Validators:
-
_flat_entry -
_name→name -
_area_row→area -
_owner_record→owner -
_type→bookmark_type
ChangeBookmarkRequest
pydantic-model
¶
Bases: BaseRequest
Rename one of your own bookmarks, or switch it between friend and enemy.
Command: bch Payload: {"KID", "X", "Y", "IF", "DN"}, in the client's key order
Client: C2SChangeBookmark (bundle line 68532), sent by
CastleWorldmapBookmarkSetDialog.onSubmitButtonClicked (bundle line 19584) only for an
own bookmark the dialog edits; IF is !!typeIndex
Fields:
ChangeBookmarkResponse
pydantic-model
¶
Bases: BaseResponse, Bookmark
The bookmark changed, read as a gbl entry.
Command: bch
Client: BCHCommand.executeCommand (bundle line 131672), CastleBookmarkData.parse_BCH
(bundle line 33443)
Fields:
-
kingdom(ClientInt) -
x(ClientInt) -
y(ClientInt) -
area(MapAreaItem | None) -
owner(PlayerProfileBase | None) -
name(str | None) -
bookmark_type(int | None) -
bookmark_id(ClientInt) -
creator_id(ClientInt) -
attack_order(BookmarkAttackOrder | None) -
error_code(int)
Validators:
-
_flat_entry -
_name→name -
_area_row→area -
_owner_record→owner -
_type→bookmark_type
DeleteBookmarkRequest
pydantic-model
¶
Bases: BaseRequest
Delete own bookmarks by their positions.
Command: bde Payload: {"BM": [[kingdom, x, y], ...]}
Client: C2SDeleteBookmark (bundle line 68457), sent by CastleBookmarkData.deleteBookmark
and deleteBookmarks (bundle lines 33474-33475) for an own bookmark
Fields:
BookmarkPosition
pydantic-model
¶
Bases: BasePayload
Where a deleted bookmark was.
Client: CastleBookmarkData.parse_BDE (bundle line 33445) reads K, X and Y
Fields:
DeleteBookmarkResponse
pydantic-model
¶
Bases: BaseResponse
The own bookmarks deleted.
Command: bde
Client: BDECommand.executeCommand (bundle line 131687), CastleBookmarkData.parse_BDE
(bundle line 33445): the BM list, else the reply itself as one position
Fields:
Validators:
-
_one_or_many -
_positions→deleted
DeleteAllianceBookmarkRequest
pydantic-model
¶
Bases: BaseRequest
Delete alliance bookmarks by their ids.
Command: abd Payload: {"BM": [[bookmark_id, notify], ...]}
notify is 1 to tell an attack order's attackers, as the delete dialog's notify button does.
Client: C2SDeleteAllianceBookmark (bundle line 68446), sent by
CastleBookmarkData.deleteBookmark (bundle line 33474) from
CastleDeleteAllianceBookmarkDialog.deleteBookmark (bundle line 69192)
Fields:
DeleteAllianceBookmarkResponse
pydantic-model
¶
Bases: BaseResponse
Acknowledgement of a deleted alliance bookmark; the client reads nothing from it.
Command: abd
Client: ABDCommand.executeCommand (bundle line 131636)
Fields:
alliance.models.search¶
Alliance search.
Commands:
- hgh: Search alliances
- aas: Join an alliance automatically, or list alliances to join
- sal: Alliances to join, pushed
Classes:
| Name | Description |
|---|---|
AllianceSearchResult |
One row of an alliance highscore list: |
SearchAllianceRequest |
Search for an alliance. |
SearchAllianceResponse |
Response to alliance search. |
AllianceSearchListItem |
An alliance offered to join. |
AutoAllianceSearchRequest |
Join an alliance automatically, or have alliances to join listed. |
AutoAllianceSearchResponse |
Either your new membership, or alliances to join. |
AllianceSearchListResponse |
Alliances to join, pushed. |
AllianceSearchResult
pydantic-model
¶
Bases: BasePayload
One row of an alliance highscore list: [rank, score, [alliance_id, name, member_count, glory_points]].
Client: CastleHighscoreDialog.onGetHighscoreData (bundle line 27538)
shifts rank and score off an alliance list's row and fills an
AllianceHighscoreInfoVO (bundle line 27680) from the third field, which
it ignores unless that is an array. Every number is read with int.
Fields:
-
rank(ClientInt) -
score(ClientInt) -
alliance_id(ClientInt) -
name(str) -
member_count(ClientInt) -
glory_points(ClientInt)
Validators:
-
_from_row
SearchAllianceRequest
pydantic-model
¶
Bases: BaseRequest
Search for an alliance.
Command: hgh Payload: {"LT": 11, "LID": 6, "SV": name_query}
Client: CastleHighscoreDialog.requestHighscoreData (bundle line 27636); 6 is
ClientConstHighscore.getLeagueIdByLevel of the level cap (bundle line 45331)
Fields:
list_type
pydantic-field
¶
list_type: RankingType = RankingType.ALLIANCE_MIGHT_POINTS
Wire key LT
The highscore list searched
league_type_id
pydantic-field
¶
league_type_id: EnumOrInt[LeagueType] = LeagueType(6)
Wire key LID
The league to search in; 6 is the level 70 league
SearchAllianceResponse
pydantic-model
¶
Bases: BaseResponse
Response to alliance search.
Command: hgh — shared with GetHighscoreResponse, which owns the registry entry; this model is instantiated manually by AllianceService.
Not registered: see class docstring.
Client: HGHCommand.executeCommand (bundle line 124377)
Fields:
Validators:
-
_rows→results
AllianceSearchListItem
pydantic-model
¶
Bases: BasePayload
An alliance offered to join.
Client: SearchListAllianceItemVO.parseItem (bundle line 42860), which reads AID, M, AH
and AL through int() and keeps N, D and ALL as sent
Fields:
-
alliance_id(ClientInt) -
name(str) -
distance(int | float) -
member_count(ClientInt) -
honor(ClientInt) -
level(ClientInt) -
language(str)
AutoAllianceSearchRequest
pydantic-model
¶
Bases: BaseRequest
Join an alliance automatically, or have alliances to join listed.
Command: aas Payload: {"N": name, "D": description, "ALL": language}
Client: C2SAutoAllianceSearchVO (bundle line 44117), sent with the translated default
alliance name by CastleAllianceTeaserDialog.onJoinAlliance (bundle line 14670), and with
the picked language too by CastleSearchAllianceDialog.setAllianceLanguage (bundle line 34593)
Fields:
AutoAllianceSearchResponse
pydantic-model
¶
Bases: BaseResponse
Either your new membership, or alliances to join.
Command: aas Payload: {"gal": {...}, "gam": {...}} when you were put in an alliance, else {"AL": [...]}
Client: AASCommand.executeCommand (bundle lines 121270-121279): a gal is applied with the
gam beside it, else each AL row is listed
Fields:
-
error_code(int) -
membership(AllianceMembership | None) -
alliances(list[AllianceSearchListItem])
Validators:
-
_membership→membership -
_alliances→alliances
membership
pydantic-field
¶
membership: AllianceMembership | None = None
Wire key gal
Your new membership; None when alliances are listed
alliances
pydantic-field
¶
alliances: list[AllianceSearchListItem]
Wire key AL
Alliances to join, when you were put in none
AllianceSearchListResponse
pydantic-model
¶
Bases: BaseResponse
Alliances to join, pushed.
Command: sal Payload: {"AL": [...]}
Client: SALCommand.executeCommand (bundle line 122033), CastleAllianceData.parse_SAL
(bundle line 11579), which only hands the list to the open search dialog
Fields:
Validators:
-
_alliances→alliances
Forum¶
Alliance forum topics, posts and visibility.
Classes:
| Name | Description |
|---|---|
ForumTopic |
A topic summary. Client: |
ForumPost |
A forum post. Client: |
GetForumTopicsRequest |
List visible topics. Client: |
GetForumTopicsResponse |
Topic overview. Client: |
GetForumTopicRequest |
Open a topic. Client: |
GetForumTopicResponse |
A topic's posts. Client: |
GetUnreadTopicCountRequest |
Ask for unread topics. Client: |
GetUnreadTopicCountResponse |
Unread topic count. Client: |
CreateForumTopicRequest |
Create a topic. Client: |
CreateForumTopicResponse |
Creation accepted. Client: |
ReplyToForumTopicRequest |
Reply to a topic. Client: |
ReplyToForumTopicResponse |
Reply accepted. Client: |
DeleteForumTopicRequest |
Delete a topic. Client: |
DeleteForumTopicResponse |
Deletion accepted. Client: |
DeleteForumReplyRequest |
Delete a post. Client: |
DeleteForumReplyResponse |
Deletion accepted. Client: |
SetForumVisibilityRequest |
Change visibility. Client: |
SetForumVisibilityResponse |
Changed topic if included. Client: |
Functions:
| Name | Description |
|---|---|
forum_text |
Validate once-encoded UTF-16 length, then encode for the constructor. |
Attributes:
| Name | Type | Description |
|---|---|---|
logger |
|
ForumTopic
pydantic-model
¶
Bases: BasePayload
A topic summary. Client: CastleForumTopicVO.parseGAT (bundle line 68085).
Fields:
-
topic_id(ClientInt) -
name(str) -
author(str) -
created_at(float) -
author_rank(EnumOrInt[AllianceRank]) -
visible_ranks(list[EnumOrInt[ForumRankGroup]]) -
reply_count(ClientInt) -
last_poster(str) -
last_post_at(float) -
was_read(bool)
Validators:
author_rank
pydantic-field
¶
author_rank: EnumOrInt[AllianceRank]
Wire key CR
Creator's alliance rank
visible_ranks
pydantic-field
¶
visible_ranks: list[EnumOrInt[ForumRankGroup]]
Wire key RG
Visible rank groups
ForumPost
pydantic-model
¶
Bases: BasePayload
A forum post. Client: CastleForumPostVO.parseGTRItem (bundle line 68066).
Fields:
-
reply_id(ClientInt) -
text(str) -
author(str) -
author_rank(EnumOrInt[AllianceRank]) -
created_at(float)
Validators:
-
_text→text
author_rank
pydantic-field
¶
author_rank: EnumOrInt[AllianceRank]
Wire key AR
Poster's alliance rank
GetForumTopicsRequest
pydantic-model
¶
GetForumTopicsResponse
pydantic-model
¶
Bases: BaseResponse
Topic overview. Client: CastleAllianceForumData.parseGAT (bundle line 8055).
Fields:
Validators:
-
_topics→topics
GetForumTopicRequest
pydantic-model
¶
GetForumTopicResponse
pydantic-model
¶
Bases: BaseResponse
A topic's posts. Client: CastleForumTopicDetailVO.parseGTR (bundle line 68044).
Fields:
-
error_code(int) -
name(str) -
author(str) -
visible_ranks(list[EnumOrInt[ForumRankGroup]]) -
posts(list[ForumPost])
Validators:
visible_ranks
pydantic-field
¶
visible_ranks: list[EnumOrInt[ForumRankGroup]]
Wire key RG
Visible rank groups
GetUnreadTopicCountRequest
pydantic-model
¶
Bases: BaseRequest
Ask for unread topics. Client: C2SGetAllianceUnreadTopicsCount (bundle line 68148).
GetUnreadTopicCountResponse
pydantic-model
¶
Bases: BaseResponse
Unread topic count. Client: CastleAllianceForumData.parseUTC (bundle line 8064).
Fields:
-
error_code(int) -
count(ClientInt)
CreateForumTopicRequest
pydantic-model
¶
Bases: BaseRequest
Create a topic. Client: C2SAllianceTopicCreateVO (bundle line 68760).
Fields:
-
name(str) -
visible_ranks(list[ForumRankGroup]) -
text(str)
CreateForumTopicResponse
pydantic-model
¶
Bases: BaseResponse
Creation accepted. Client: ATCCommand.executeCommand (bundle line 121725).
Fields:
ReplyToForumTopicRequest
pydantic-model
¶
ReplyToForumTopicResponse
pydantic-model
¶
DeleteForumTopicRequest
pydantic-model
¶
DeleteForumTopicResponse
pydantic-model
¶
Bases: BaseResponse
Deletion accepted. Client: ATDCommand.executeCommand (bundle line 121739).
Fields:
DeleteForumReplyRequest
pydantic-model
¶
DeleteForumReplyResponse
pydantic-model
¶
Bases: BaseResponse
Deletion accepted. Client: ADACommand.executeCommand (bundle line 121711).
Fields:
SetForumVisibilityRequest
pydantic-model
¶
Bases: BaseRequest
Change visibility. Client: C2SAllianceTopicChangeRanks (bundle line 68769).
Fields:
SetForumVisibilityResponse
pydantic-model
¶
Bases: BaseResponse
Changed topic if included. Client: ACRCommand.executeCommand (bundle line 121696).
Fields:
-
error_code(int) -
topic(GetForumTopicResponse | None)
Membership¶
Your alliance membership, and applying to and joining alliances.
Commands:
- gal: your alliance membership, a login section of
gbdand a push
Classes:
| Name | Description |
|---|---|
AllianceMembership |
Your alliance membership: the |
AllianceMembershipResponse |
Your alliance membership, pushed when you join or leave and sent as a login section of |
ApplyToAllianceRequest |
Send an application. Client: |
ApplyToAllianceResponse |
Application accepted. Client: |
JoinOpenAllianceRequest |
Join an open alliance. Client: |
JoinOpenAllianceResponse |
Joined alliance. Client: |
AutoJoinedAllianceResponse |
You were put in an alliance, pushed. Client: |
AllianceMembershipChange |
The membership a membership reply carries, and the alliance it names. |
GetAllianceInvitationRequest |
Read an invitation. Client: |
GetAllianceInvitationResponse |
Inviting alliance. Client: |
AcceptAllianceInvitationRequest |
Answer an invitation. Client: |
AcceptAllianceInvitationResponse |
Membership after a decision. Client: |
AllianceRecruit |
Recruit search row. Client: |
FindAllianceRecruitsRequest |
Find recruits. Client: |
FindAllianceRecruitsResponse |
Nearby recruits and owners. Client: |
SetLookingForMembersRequest |
Recruitment flags. Client: |
SetLookingForMembersResponse |
Flags accepted. Client: |
SetLookingForAllianceRequest |
Player search flag. Client: |
SetLookingForAllianceResponse |
Flag accepted. Client: |
Attributes:
| Name | Type | Description |
|---|---|---|
logger |
|
AllianceMembership
pydantic-model
¶
Bases: BasePayload
Your alliance membership: the gal block of a login, a push or a membership reply.
An alliance_id of 0 or less means no alliance; the client then forgets its alliance
and chat, and so does client.state.
Client: CastleUserData.parse_GAL (bundle line 9876), which reads AID, R and ACF
through int(), AN as sent and 1 == parseInt(e.SA)
Fields:
-
alliance_id(ClientInt) -
rank(EnumOrInt[AllianceRank] | None) -
name(str) -
current_glory(ClientInt) -
looking_for_alliance(bool)
Validators:
-
_rank→rank -
_looking→looking_for_alliance -
_name→name
alliance_id
pydantic-field
¶
alliance_id: ClientInt = 0
Wire key AID
The alliance; 0 or less for none
rank
pydantic-field
¶
rank: EnumOrInt[AllianceRank] | None = AllianceRank.LEADER
Wire key R
Your rank in the alliance; None for the -1 sent while you are in none
current_glory
pydantic-field
¶
current_glory: ClientInt = 0
Wire key ACF
The alliance's current glory points
AllianceMembershipResponse
pydantic-model
¶
Bases: BaseResponse, AllianceMembership
Your alliance membership, pushed when you join or leave and sent as a login section of gbd.
Command: gal.
Client: GALCommand.executeCommand (bundle line 129393)
Fields:
-
alliance_id(ClientInt) -
rank(EnumOrInt[AllianceRank] | None) -
name(str) -
current_glory(ClientInt) -
looking_for_alliance(bool) -
error_code(int)
Validators:
-
_rank→rank -
_looking→looking_for_alliance -
_name→name
ApplyToAllianceRequest
pydantic-model
¶
Bases: BaseRequest
Send an application. Client: C2SAllianceSendApplicationVO (bundle line 72553).
Fields:
-
alliance_id(int) -
text(str)
ApplyToAllianceResponse
pydantic-model
¶
Bases: BaseResponse
Application accepted. Client: SAACommand.executeCommand (bundle line 121965).
Fields:
JoinOpenAllianceRequest
pydantic-model
¶
Bases: BaseRequest
Join an open alliance. Client: C2SJoinOpenAllianceVO (bundle line 72504).
Fields:
JoinOpenAllianceResponse
pydantic-model
¶
Bases: BaseResponse
Joined alliance. Client: JOACommand.executeCommand (bundle line 121934).
Fields:
Validators:
-
_alliance→alliance -
_same_alliance
AutoJoinedAllianceResponse
pydantic-model
¶
Bases: BaseResponse
You were put in an alliance, pushed. Client: AJACommand.executeCommand (split.js line 623480),
which applies gal before A; the client never sends an aja.
Fields:
Validators:
-
_alliance→alliance
AllianceMembershipChange
pydantic-model
¶
Bases: BasePayload
The membership a membership reply carries, and the alliance it names.
Client: JOACommand (split.js line 624892), AAICommand (split.js line 622475) and AJACommand
(split.js line 623480) read gal with parse_GAL, then A with parseAllianceInfo;
AFOCommand (split.js line 623283) reads A, then gal; AASCommand (split.js line 622569)
reads gal, then a truthy gam with CastleArmyData.parse_GAM (split.js line 667215), which
reads its movements and not its owner records
Fields:
-
membership(AllianceMembershipResponse | None) -
alliance(AllianceInfo | None) -
movements(GetMovementsResponse | None)
Validators:
-
_membership→membership -
_alliance→alliance -
_movements→movements
membership
pydantic-field
¶
membership: AllianceMembershipResponse | None = None
Wire key gal
Your membership; None when not sent
alliance
pydantic-field
¶
alliance: AllianceInfo | None = None
Wire key A
The alliance; None when not sent or without an id
movements
pydantic-field
¶
movements: GetMovementsResponse | None = None
Wire key gam
Your movements; None when not sent
GetAllianceInvitationRequest
pydantic-model
¶
Bases: BaseRequest
Read an invitation. Client: C2SGetAllianceInvitationVO (bundle line 69387).
Fields:
GetAllianceInvitationResponse
pydantic-model
¶
Bases: BaseResponse
Inviting alliance. Client: CastleAllianceData.parse_BAI (bundle line 11562).
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
Validators:
-
_alliance→alliance
AcceptAllianceInvitationRequest
pydantic-model
¶
Bases: BaseRequest
Answer an invitation. Client: C2SAllianceAcceptInviteVO (bundle line 69378).
CastleAllianceInvitationDialog.onAccept/onRefuse (bundle lines 44828–44829)
send the invitation's message id and decision 1/0.
Fields:
-
message_id(int) -
accept(bool)
AcceptAllianceInvitationResponse
pydantic-model
¶
Bases: BaseResponse
Membership after a decision. Client: AAICommand.executeCommand (bundle line 121202).
Fields:
-
error_code(int) -
membership(AllianceMembership | None) -
alliance(AllianceInfo | None)
Validators:
-
_alliance→alliance -
_same_alliance
membership
pydantic-field
¶
membership: AllianceMembership | None = None
Wire key gal
Updated membership
AllianceRecruit
pydantic-model
¶
Bases: BasePayload
Recruit search row. Client: SearchMemberListItemVO.parseItem (bundle line 66552).
Fields:
FindAllianceRecruitsRequest
pydantic-model
¶
FindAllianceRecruitsResponse
pydantic-model
¶
Bases: BaseResponse
Nearby recruits and owners. Client: SMLCommand.executeCommand (bundle line 122040),
CastleAllianceData.parse_SML (bundle line 11580), and
WorldMapOwnerInfoVO.fillFromParamObject (bundle line 10794).
Fields:
Validators:
owner_of
¶
owner_of(recruit: AllianceRecruit) -> PlayerProfileBase | None
The recruit's owner record, or None when absent.
SetLookingForMembersRequest
pydantic-model
¶
Bases: BaseRequest
Recruitment flags. Client: C2SAllianceSetSearchMemberVO (bundle line 70154).
Fields:
SetLookingForMembersResponse
pydantic-model
¶
SetLookingForAllianceRequest
pydantic-model
¶
Bases: BaseRequest
Player search flag. Client: C2SAllianceSetSearchAllianceVO (bundle line 72562).
Fields:
SetLookingForAllianceResponse
pydantic-model
¶
Settings¶
Alliance settings requests and their echoed details.
Classes:
| Name | Description |
|---|---|
ChangeAllianceDescriptionRequest |
Client: C2SAllianceChangeDescriptionVO (bundle lines 45319–45322). |
ChangeAllianceDescriptionResponse |
Client: ACDCommand.executeCommand (bundle lines 121304–121305), reads ain. |
ChangeAllianceNameRequest |
Client: C2SAllianceChangeNameVO (bundle lines 69815–69817). |
ChangeAllianceNameResponse |
Client: ACNCommand.executeCommand (bundle lines 121354–121355), reads A. |
ChangeAllianceLanguageRequest |
Client: C2SChangeAllianceLanguageVO (bundle lines 42844–42846). |
ChangeAllianceLanguageResponse |
Client: CALCommand.executeCommand (bundle lines 121690–121691), reads A. |
SetAllianceEmblemRequest |
Client: C2SSetAllianceEmblemVO (bundle lines 69672–69674). |
SetAllianceEmblemResponse |
Client: SAECommand.executeCommand (bundle line 122004), acknowledgment only. |
Attributes:
| Name | Type | Description |
|---|---|---|
ALLIANCE_NAME_MIN_LENGTH |
|
|
ALLIANCE_NAME_MAX_LENGTH |
|
|
ALLIANCE_DESCRIPTION_MAX_LENGTH |
|
|
ALLIANCE_RENAME_RUBIES |
|
ChangeAllianceDescriptionRequest
pydantic-model
¶
Bases: BaseRequest
Client: C2SAllianceChangeDescriptionVO (bundle lines 45319–45322).
Description text goes through getForumValidText first (8090), then the constructor encodes again and truncates the encoded string to 1000. Announcement sendDescription (70504) also encodes twice on the valid branch.
Fields:
ChangeAllianceDescriptionResponse
pydantic-model
¶
Bases: GetAllianceInfoResponse
Client: ACDCommand.executeCommand (bundle lines 121304–121305), reads ain.
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
Validators:
-
_nested
ChangeAllianceNameRequest
pydantic-model
¶
ChangeAllianceNameResponse
pydantic-model
¶
Bases: GetAllianceInfoResponse
Client: ACNCommand.executeCommand (bundle lines 121354–121355), reads A.
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
ChangeAllianceLanguageRequest
pydantic-model
¶
ChangeAllianceLanguageResponse
pydantic-model
¶
Bases: GetAllianceInfoResponse
Client: CALCommand.executeCommand (bundle lines 121690–121691), reads A.
Fields:
-
error_code(int) -
alliance(AllianceInfo | None)
SetAllianceEmblemRequest
pydantic-model
¶
Bases: BaseRequest
Client: C2SSetAllianceEmblemVO (bundle lines 69672–69674).
Fields:
color_ids
pydantic-field
¶
color_ids: list[EnumOrInt[AllianceCrestColor]]
Wire key ACCS
Colours for the layout
SetAllianceEmblemResponse
pydantic-model
¶
Bases: BaseResponse
Client: SAECommand.executeCommand (bundle line 122004), acknowledgment only.
Fields:
alliance_description
¶
Client: getForumValidText/getTrimmedText (bundle lines 8090/1979).
Gifts¶
Alliance gifts received as pushes and their collection rewards.
Classes:
| Name | Description |
|---|---|
AllianceGift |
Client: AllianceGiftVO.parseArray/remainingTimeInSeconds (bundle 131974–131981). |
AllianceGiftReceived |
Client: AGRCommand/parse_AGR (bundle lines 121867–121868, 131949–131951). |
CollectAllianceGiftRequest |
Client: C2SAllianceGiftCollect (bundle lines 105252–105254). |
CollectAllianceGiftResponse |
Client: CastleAllianceGiftData.parse_AGC (bundle lines 131937–131939). |
AllianceGift
pydantic-model
¶
Bases: TimedPayload
Client: AllianceGiftVO.parseArray/remainingTimeInSeconds (bundle 131974–131981).
Fields:
Validators:
-
_row
seconds_left
pydantic-field
¶
seconds_left: ClientNumber
Wire key T
Seconds before this gift expires
AllianceGiftReceived
pydantic-model
¶
Bases: BaseResponse
Client: AGRCommand/parse_AGR (bundle lines 121867–121868, 131949–131951).
Fields:
CollectAllianceGiftRequest
pydantic-model
¶
CollectAllianceGiftResponse
pydantic-model
¶
Bases: BaseResponse
Client: CastleAllianceGiftData.parse_AGC (bundle lines 131937–131939).
Rewards use CollectableParserS2CParamList.createList (bundle 40567–40580).
Fields:
Validators:
-
_rewards→rewards
Founding¶
Founding an alliance using the ordinary client resource-payment flow.
Classes:
| Name | Description |
|---|---|
FoundAllianceRequest |
Client: C2SFoundAllianceVO (bundle 44153–44156), onCreateNewAlliance (44138–44141). |
FoundAllianceResponse |
Client: AFOCommand.executeCommand (bundle 121465–121466), reads A and gal. |
Attributes:
| Name | Type | Description |
|---|---|---|
ALLIANCE_FOUND_COINS |
|
|
ALLIANCE_FOUND_RUBIES |
|
|
ALLIANCE_FOUND_WOOD |
|
|
ALLIANCE_FOUND_STONE |
|
FoundAllianceRequest
pydantic-model
¶
Bases: BaseRequest
Client: C2SFoundAllianceVO (bundle 44153–44156), onCreateNewAlliance (44138–44141).
The normal request always sends PO=-1/PWR=0, including when its base price includes rubies. The separate resource-shortage replay (35222–35224) enables ruby payment for missing resources; this request never uses it.
Fields:
-
name(str) -
description(str) -
language(str) -
private_offer_id(Literal[-1]) -
pay_with_rubies(Literal[0]) -
open_join(bool)
private_offer_id
pydantic-field
¶
private_offer_id: Literal[-1] = -1
Wire key PO
Always -1 for no private offer
pay_with_rubies
pydantic-field
¶
pay_with_rubies: Literal[0] = 0
Wire key PWR
Always 0: missing resources are never paid with rubies
open_join
pydantic-field
¶
open_join: bool = True
Wire key IA
Whether players may join without an invitation
validate_description
¶
Client: CastleJSONTextFieldRestrictor and founding dialog (bundle 44123).
FoundAllianceResponse
pydantic-model
¶
Bases: JoinOpenAllianceResponse
Client: AFOCommand.executeCommand (bundle 121465–121466), reads A and gal.
It carries the same alliance and membership records as JOACommand. Both ids must agree and name a created alliance before either record is applied.
Fields:
Validators:
-
_alliance→alliance -
_same_alliance -
_created_ids -
_created_alliance