Skip to content

API reference

Generated from the source's docstrings. Each model lists its fields, with the wire key each one is read from and what it holds.

What is public

A name is public when the package root or a first-level package exports it in its __all__:

  • from empire_core import ...: the client, its configuration, the account pool, every error, the state models and the common enums.
  • from empire_core.<area> import ...: each game area (map, castle, alliance, spy, ...) exports its service, its request and response models and its enums.
  • empire_core.enums, gamedata, combat, protocol, state, services, texts, accounts, config, pool and exceptions export the same way.

The modules inside them (empire_core.map.models.items, empire_core.spy.service, ...) are private: this reference shows where each name is defined, but those paths may move in any release. empire_core.client and empire_core.network are private as a whole; what they hold that you need is exported from the root.

Core

Page What it covers
Client EmpireClient, EmpireConfig, accounts and the account pool, BaseService
State GameState and the state models
Exceptions Every error, and the server's error codes as GGEError
Enums Game constants, one module per area
Game data GameData, its row models and the generated ids
Texts The game's texts and error messages from its language file
Protocol Request and response bases, packets, codecs and the connection
Utilities Internal: cancelling long calls

Areas

Each area page starts with its service, reached as client.<area>, then its models.

Page Service
Map client.map
Ranking client.ranking
Quests read from client.state
Events client.events
Commanders client.commanders, client.equipment, client.skills
Castle client.castle
Army client.army
Movements client.movements
Messages client.messages
Rewards client.rewards
Defense client.defense
Combat used by client.attack
Player client.player
Attack client.attack
Alliance client.alliance
Spy client.spy