Skip to content

Installation Windows Build

boyism80 edited this page Jul 4, 2026 · 1 revision

Windows — Build from source

Build fb server binaries manually on Windows. Required for C++, protocol, or game-table development, or when you need full control over the compile pipeline.

After building, you can still use Runner to generate configs and start services.

Parent guide: Windows Installation


Requirements

Operating system

  • Windows 10 or later (64-bit)

Toolchain

Requirement Version / notes
Git for Windows Submodule support
.NET SDK 8.0 or later
CMake 3.28 or later (CMakeLists.txt minimum)
Visual Studio 2022 or later with Desktop development with C++ workload
MSVC toolset C++20 (/std:c++20)
Disk space 10 GB or more free; tools/update-modules.bat clones and builds Boost and other libraries

Infrastructure (to run servers)

Service Default dev port
MySQL 8.0 or later 3306
Redis 6379
RabbitMQ 5672

See Windows Installation — Infrastructure for database layout and migration behavior.

Native libraries are installed into dependency/ (gitignored, generated locally):

  • jsoncpp, rabbitmq-c, Lua, zlib, FlatBuffers, cpp-async, aho_corasick, Boost

1. Clone the repository

git clone --recurse-submodules https://github.com/boyism80/fb.git
cd fb

If already cloned without submodules:

git submodule update --init --recursive

2. Set up infrastructure

Install and start MySQL, Redis, and RabbitMQ, then update connection settings if needed:

  • server/internal/appsettings.Development.json
  • server/write-back/appsettings.Development.json
  • server/log/appsettings.Development.json
  • server/marketplace/appsettings.Development.json
  • server/gateway/config/config.dev.json
  • server/login/config/config.dev.json
  • server/game/config/config.dev.json

Or configure these through Runner and let it generate build/dist/config/ at runtime.


3. Build native dependencies

Open Developer PowerShell for Visual Studio 2022 or later (or a shell with cl.exe on PATH):

cd tools
.\update-modules.bat

This clones third-party sources into tools\library\, builds them, and copies headers/libs into dependency\.

Boost in particular can take a long time on first run.

Runner's infrastructure check verifies sentinel files under dependency/ before allowing local Build.


4. Generate game data (optional)

Only needed after changing Excel files in resources/table/:

cd tools
.\update-data.bat

Outputs include:

  • include/fb/model/model.h
  • server/game/json/, server/login/json/, server/bot/json/
  • server/http/Model/Model.cs and JSON for .NET services

5. Generate protocol (optional)

Only needed after changing files under protocol/:

cd tools
.\update-flatbuffer.bat

6. Build C++ servers

mkdir build -ErrorAction SilentlyContinue
cd build
cmake ..
cmake --build . --config Debug

Outputs (Debug):

  • build\server\gateway\Debug\gateway.exe
  • build\server\login\Debug\login.exe
  • build\server\game\Debug\game.exe
  • build\server\bot\Debug\bot.exe

CMake also generates a Visual Studio solution under build\ if you prefer IDE debugging.


7. Build .NET services

From the repository root:

dotnet publish server/internal/internal.csproj -c Release -o build/dist/internal
dotnet publish server/write-back/write-back.csproj -c Release -o build/dist/write-back
dotnet publish server/log/log.csproj -c Release -o build/dist/log
dotnet publish server/marketplace/marketplace.csproj -c Release -o build/dist/marketplace
dotnet publish server/admin-tool/admin-tool.csproj -c Release -o build/dist/admin-tool

Set ASPNETCORE_ENVIRONMENT=Development when using appsettings.Development.json.


8. Prepare runtime layout

Create a build\dist layout similar to Runner Patch/Build output:

# C++ binaries
Copy-Item build\server\gateway\Debug\gateway.exe build\dist\
Copy-Item build\server\login\Debug\login.exe build\dist\
Copy-Item build\server\game\Debug\game.exe build\dist\

# Maps
Expand-Archive -Path resources\maps\maps.zip -DestinationPath build\dist\maps -Force

# Scripts and JSON
Copy-Item -Recurse server\game\scripts build\dist\scripts
Copy-Item -Recurse server\game\json build\dist\json

Configs: copy or symlink server/*/config/config.dev.json, or use Runner to generate build\dist\config\ at runtime.


9. Run services

Minimal stack for one world:

  1. Start MySQL, Redis, RabbitMQ
  2. Internal — applies DB migrations, central HTTP API
  3. Log — structured log pipeline (RabbitMQ consumer)
  4. Write-back — persists Redis cache to MySQL
  5. Marketplace — in-game marketplace API
  6. Admin Tool — web-based administration UI
  7. Gateway → Login → Game — client-facing TCP services

Example (Internal):

$env:ASPNETCORE_ENVIRONMENT = "Development"
$env:ASPNETCORE_HTTP_PORTS = "3000"
dotnet build/dist/internal/internal.dll

C++ example (Game):

cd build\dist
.\game.exe -c config\game\config_game_0.json

Using Runner after building into build\dist is the easiest way to manage multi-process startup and config generation.

Alternatively, Runner Build automates steps 6–8 (CMake, dotnet publish, maps/scripts/json copy) when the infrastructure checks pass.


Visual Studio notes

  • server/**/*.vcxproj files are local and gitignored
  • CMake GLOB picks up new C++ sources automatically; Visual Studio projects must be updated manually (see tools/codegen/integration_protocol/README.md for Bot)
  • Do not run cmake to regenerate vcxproj unless you intentionally want to refresh the CMake solution

Troubleshooting

Problem Check
dependency\lib\*.lib not found Run tools\update-modules.bat in Developer PowerShell
CMake version error Install CMake 3.28 or later
dotnet not found Install .NET SDK 8.0 or later
MySQL connection failed Server running, credentials match appsettings.Development.json, port open
game.exe not found in build/dist Complete C++ build or use Runner Patch
Korean text garbled in scripts Source files are UTF-8; ensure editor and console use UTF-8

This workflow matches the build-windows job in .github/workflows/build.yml.


Related pages

Clone this wiki locally