-
Notifications
You must be signed in to change notification settings - Fork 1
Installation Windows
This guide covers what you need to install and run the fb server stack on Windows for local development.
For architecture overview, see Architecture and Technology Stack.
A full local stack includes:
| Layer | Components |
|---|---|
| Infrastructure | MySQL 8.x, Redis, RabbitMQ |
| C++ services | Gateway, Login, Game, Bot |
| .NET services | Internal, Write-back, Log, Marketplace, Admin Tool |
| Runtime assets | Map files, Lua scripts, generated JSON/model data |
There are two common workflows on Windows:
- Run prebuilt binaries — use the Runner tool and the Patch feature (fastest way to start servers).
- Build from source — required for C++ / protocol / game-data development.
- Windows 10 or Windows 11 (64-bit)
| Requirement | Version / notes |
|---|---|
| Git for Windows | Submodule support (tools/data-converter, tools/flatbuffer-ex) |
| .NET 8 SDK | Backend services and build tools (SDK, not runtime only) |
| Network access | Submodule fetch; optional Runner patch download |
| Requirement | Version / notes |
|---|---|
| CMake |
3.28+ (CMakeLists.txt minimum) |
| Visual Studio 2022 | Desktop development with C++ workload |
| MSVC toolset | C++20 (/std:c++20) |
| Disk space | Several GB free; tools/update-modules.bat clones and builds Boost and other native libraries under tools/library/
|
Native libraries are installed into dependency/ (gitignored, generated locally):
- jsoncpp, rabbitmq-c, Lua, zlib, FlatBuffers, cpp-async, aho_corasick, Boost
| Service | Purpose | Default dev port |
|---|---|---|
| MySQL 8.x | Unified DB, per-world global/data/log databases | 3306 |
| Redis | Cache, sessions, distributed locks | 6379 |
| RabbitMQ | Internal events, write-back queue, log pipeline |
5672 (AMQP) |
Example connection layout (see server/internal/appsettings.Development.json):
- Unified MySQL:
fb-unified - World 1:
fb-1-global,fb-1-data-0…fb-1-data-2 - Log shards: created by migrations under
infra/db/migrations/
Database:AutoMigration is enabled in development configs. On first start, Internal (and other .NET services) apply SQL migrations from infra/db/migrations/ when the MySQL user can create databases and tables.
| Tool | Purpose |
|---|---|
Runner (tools/runner) |
WPF launcher: Patch download, config generation, start/stop processes |
| Visual Studio | Debug C++ services; local *.vcxproj files (gitignored) |
| Excel | Only if you edit game tables in resources/table/ and rerun tools/update-data.bat
|
Note:
tools/setup.batis outdated (old directory layout, removedinfra/db/latest.sql). Do not use it. Follow this guide or the CI steps in.github/workflows/build.yml(build-windowsjob) instead.
git clone --recurse-submodules https://github.com/boyism80/fb.git
cd fbIf already cloned without submodules:
git submodule update --init --recursiveSubmodules used for development:
-
tools/data-converter— Excel → C++/C#/JSON -
tools/flatbuffer-ex— FlatBuffer protocol codegen -
wiki— project wiki (optional for running servers)
Install and start MySQL, Redis, and RabbitMQ on the same machine or update the connection settings in:
server/internal/appsettings.Development.jsonserver/write-back/appsettings.Development.jsonserver/log/appsettings.Development.jsonserver/marketplace/appsettings.Development.jsonserver/gateway/config/config.dev.jsonserver/login/config/config.dev.jsonserver/game/config/config.dev.json
Default development ports (C++ config examples):
| Service | Port |
|---|---|
| Internal (HTTP) | 3000 |
| Gateway (TCP) | 3001 |
| Login (TCP) | 3002 |
| Game (TCP) |
3004 (see server/game/config/config.dev.json) |
Ensure Windows Firewall allows inbound connections on the ports clients and services use.
Best when you only need a running server and do not need to compile C++.
cd tools\runner
dotnet publish -c Release -o binOr use tools\run.bat from the tools directory.
- Start
tools\runner\bin\runner.exe - Set Working directory to your
fbrepository root - Click Patch — downloads
dist.zipand extracts tobuild\dist\
The Patch step provides prebuilt executables:
-
gateway.exe,login.exe,game.exe -
internal\,write-back\,log\,marketplace\,admin-tool\
After patching, update maps, generated JSON, and scripts from the repo:
| Runner menu | Source in repo | Output |
|---|---|---|
| 파일 → 업데이트 → 맵 | resources/maps/maps.zip |
build/dist/maps/ |
| 파일 → 업데이트 → 데이터 | runs tools/update-data.bat
|
build/dist/json/, build/dist/internal/json/
|
| 파일 → 업데이트 → 스크립트 | server/game/scripts/ |
build/dist/scripts/ |
If 스크립트 update fails, copy manually:
server\game\scripts→build\dist\scripts
In Runner, configure:
-
External IP — address clients connect to (LAN IP or
127.0.0.1for local-only) - MySQL / Redis / RabbitMQ — must be reachable (Runner checks TCP ports before start)
- Login and Game server entries with ports
-
Internal port (default
3000)
Click Run to generate configs under build\dist\config\ and start:
- Gateway, Login, Game (C++)
- Internal, Write-back (.NET)
MySQL / Redis / RabbitMQ must already be running.
Required for C++, protocol, or game-table changes. Matches the build-windows job in .github/workflows/build.yml.
Open Developer PowerShell for VS 2022 (or a shell with cl.exe on PATH):
cd tools
.\update-modules.batThis 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.
Only needed after changing Excel files in resources/table/:
cd tools
.\update-data.batOutputs include:
include/fb/model/model.h-
server/game/json/,server/login/json/,server/bot/json/ -
server/http/Model/Model.csand JSON for .NET services
Only needed after changing files under protocol/:
cd tools
.\update-flatbuffer.batmkdir build -ErrorAction SilentlyContinue
cd build
cmake ..
cmake --build . --config DebugOutputs (Debug):
build\server\gateway\Debug\gateway.exebuild\server\login\Debug\login.exebuild\server\game\Debug\game.exebuild\server\bot\Debug\bot.exe
CMake also generates a Visual Studio solution under build\ if you prefer IDE debugging.
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-toolSet ASPNETCORE_ENVIRONMENT=Development when using appsettings.Development.json (Runner sets ASPNETCORE_ENVIRONMENT to the service folder name).
Create a build\dist layout similar to the Patch 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\jsonConfigs: copy or symlink server/*/config/config.dev.json, or use Runner to generate build\dist\config\ at runtime.
Minimal stack for one world:
- Start MySQL, Redis, RabbitMQ
- Internal — applies DB migrations, central HTTP API
- Write-back — persists Redis cache to MySQL
- Log — optional but recommended for structured logs
- Marketplace — required for in-game marketplace features
- Gateway → Login → Game — client-facing TCP services
Example (Internal):
$env:ASPNETCORE_ENVIRONMENT = "Development"
$env:ASPNETCORE_HTTP_PORTS = "3000"
dotnet build/dist/internal/internal.dllC++ example (Game):
cd build\dist
.\game.exe -c config\game\config_game_0.jsonUsing Runner after building into build\dist is still the easiest way to manage multi-process startup.
-
server/**/*.vcxprojfiles are local and gitignored - CMake
GLOBpicks up new C++ sources automatically; Visual Studio projects must be updated manually (seetools/codegen/integration_protocol/README.mdfor Bot) - Do not run
cmaketo regenerate vcxproj unless you intentionally want to refresh the CMake solution
| Problem | Check |
|---|---|
dependency\lib\*.lib not found |
Run tools\update-modules.bat
|
| CMake version error | Install CMake 3.28 or newer |
dotnet not found |
Install .NET 8 SDK |
| MySQL connection failed | Server running, credentials match appsettings.Development.json, port open |
| Runner: port not open | Redis / RabbitMQ / MySQL not listening on configured host:port |
game.exe not found in build\dist
|
Complete Path B build or use Runner Patch |
| Korean text garbled in scripts | Source files are UTF-8; ensure editor and console use UTF-8 |