Module: Domain

Module: FirelandsDomain (src/domain)

The domain layer models core game and account concepts and defines repository interfaces (ports). No SQL, no sockets.

Compiled sources

src/domain/CMakeLists.txt builds:

  • models/Realm.cpp — realm metadata for realm lists and live state
  • world/Map.cpp — map grid / object indexing
  • world/Creature.cpp, world/GameObject.cpp — world entities

Header-only areas

AreaExamples
ModelsCharacter, PlayerCreateInfo, GmTicket, GossipMenu, NpcText, SpellDefinition, WebSession, Chat
World entitiesPlayer, WorldObject, Unit, Aura
Repository portsIAccountRepository, ICharacterRepository, IGossipRepository, INpcTextRepository, …
Domain portsIMapNotifier — callbacks from Player to session without domain importing infrastructure

Principles

  • Express what the emulator manipulates, not how data is stored or packets are sent
  • Pure gameplay rules that need no I/O belong here
  • SQL parsing and packet handlers belong in infrastructure or shared network helpers

Repository ports (summary)

PortPurpose
IAccountRepositoryAccounts, SRP verifiers, session keys
IRealmRepositoryRealm list rows
ICharacterRepositoryCharacter CRUD
IPlayerCreateInfoRepositoryStarter positions, spells, skills
IGmTicketRepositoryGM help tickets
IGossipRepository / INpcTextRepository / IQuestGossipRepositoryGossip data
ICreatureSpawnRepositoryCreature spawns
ISpellDefinitionStoreSpell metadata

Implementations live in infrastructure/persistence/MySql*.