Context for AI assistants — the Claude GitHub App (@claude) and contributors using Claude — working in
this repo. Humans: also read doc/CodingStandard.md.
MangosThree — The Cataclysm World of Warcraft 4.3.4 server (C++, MySQL/MariaDB). Compatibility target is 4.3.4 only; do not introduce 5.x/MoP or later-expansion assumptions.
- Database changes go in the separate
mangosthree/databaserepo, not here — as transactional, idempotentRel##_##_###_*.sqlmigrations that chain viadb_version. - Clone/update recursively:
src/modules/SD3andsrc/modules/Elunaare submodules. Never shallow-update a submodule to a non-tip pinned SHA. - Less-obvious locations: scripting in
src/modules/(Eluna = Lua, SD3 = C++, Bots = playerbots). Thesrc/game/tree is under an ongoing decomp cohesion-split (large classes likePlayer/Unit/SpellEffectsare being broken into topical*.cppfiles, e.g.UnitCombat.cpp,UnitAura.cpp,SpellEffectSkillEnchantPet.cpp,ObjectMgrCreatures.cpp); locate code by symbol/string, not a fixed file, because methods move between files.
C++17 — strict (-std=c++17, GNU extensions off); C code is C11. CMake ≥ 3.18; GCC/Clang
(Linux/macOS/BSD) or MSVC ≥ 2015 (Windows). The exact flags CI builds with:
git clone --recursive https://github.com/mangosthree/server.git && cd server
sudo apt-get install -y git cmake make build-essential \
libssl-dev libbz2-dev default-libmysqlclient-dev libreadline-dev # Debian/Ubuntu deps
mkdir -p _build _install && cd _build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../_install \
-DBUILD_TOOLS=1 -DBUILD_MANGOSD=1 -DBUILD_REALMD=1 -DSOAP=1 \
-DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3=1 -DPLAYERBOTS=0 \
-DPCH=0
make -j"$(nproc)" && make install -j"$(nproc)"Windows: use the EasyBuild helper. A PR MUST keep CI green: the Linux build compiles with both GCC and
Clang, Windows builds on AppVeyor, and Codacy/CodeFactor gate quality. PLAYERBOTS defaults OFF; only
enable it deliberately. A full make install also installs the map/vmap/mmap extractor tools, so BUILD_TOOLS
targets must build before installing.
Source of truth: doc/CodingStandard.md. Non-default rules:
- 4-space indent, never tabs; ~80-column lines.
- Allman braces, and YOU MUST brace single-statement blocks — even one-line
if/for/while. Do not de-brace existing ones. (Exception: do not braceswitch/casebodies.) - One space before
(, none inside:if (x), notif( x ). - Doxygen:
///above a member,///<trailing,/** ... */multi-line. - Some
.cpp/.hcarry Windows-1252 bytes (e.g.Map.cpp); preserve them byte-for-byte. Tools that re-encode to UTF-8 corrupt non-ASCII bytes — use byte-preserving edits and checkgit diffafter.
Console output is rendered on a dedicated off-thread writer (src/shared/Log/ConsoleLogWriter) so the
world/map-update threads never block on console I/O. Two rules follow:
- Never write to stdout directly (
printf/fprintf/std::cout, progress bars, ad-hoc notices) for console output — route it throughLog::ConsoleEmitRawso stdout has a single owner and lines can't tear against, or overtake, the writer's output. - Gate high-volume runtime debug with
DEBUG_FILTER_LOG(LOG_FILTER_*, …)(orDETAIL_/BASIC_), reusing an existingLogFiltersbit where one fits (e.g.LOG_FILTER_GRID_ADD,LOG_FILTER_DB_SCRIPTS,LOG_FILTER_MAP_LOADING). All filters ship default-on (suppressed); set aLogFilter_*key to0to see a category. Never filteroutError/outErrorDb— errors must always show.
Recommended runtime mode: LogLevel=1 (quiet console) + LogFileLevel=3 (buffered full file). Packet
logging is opt-in via PacketLoggingEnabled (off by default).
Prioritise: (1) correctness/safety in src/game/ handlers and anything touching live world/DB state;
(2) coding-standard conformance above (including the Windows-1252 byte-preservation rule); (3) build/CI
impact (GCC and Clang, Windows/AppVeyor); (4) DB-migration correctness (use the mangosthree/database
pattern). Keep feedback concrete and minimal-diff; flag correctness/standard issues, not style preferences
the standard doesn't cover.