ToCloud9 is an attempt to make TrinityCore and its forks scalable and cloud-native. The project is at the beginning of development and has limited functionality. Right now, it can be used for deploying without downtime and for recovery from crashes on the TrinityCore side. Small demo video available here.
The original idea to make it scalable described (in simplified form) in the image bellow:
At the moment, it supports 3.3.5 client and has the next applications:
- authserver authorizes players, provides realmlist and connects a game client to the "smart" game load balancer with the least active connections;
- game-load-balancer holds game client TCP connection, offloads encryption, reads packets and routes requests to other services. For every character creates connection to the game server (TrinityCore) that Servers Registry provides.
- servers-registry holds information about every running instance of Game Load Balancer and Game Server (TrinityCore world server). Makes health checks and collects necessary metrics (active connections at the moment).
- chatserver at the moments holds characters online and handles "whisper" messages;
- charserver at the moments only provides information to handle SMsgCharEnum opcode.
- gameserver is modified TrinityCore world server with
sidecar
library, that registers GameServer in Servers Registry and handles health checks.
Prerequisites:
- Database for TrinityCore;
- TrinityCore data folder (dbc, vmaps, mmaps).
- Docker & docker-compose (for 'Docker-compose' approach);
- Golang (for 'Without Docker' approach).
- Fill in
.env
file with relevant data. $ docker-compose up -d
- Run
$ make install
. - Apply
game-server/trinitycore/31ea74b96e.diff
patch on TrinityCore (should be compatible with this rev). - Place
bin/libsidecar.dylib
&bin/libsidecar.h
files in$TRINITY_CORE_SRC_PATH/dep/libsidecar
folder and in folder withworldserver
executable. - Build patched TrinityCore.
- Install and run NATS.
- Run everything.
export AUTH_DB_CONNECTION=trinity:trinity@tcp(127.0.0.1:3306)/auth
export CHAR_DB_CONNECTION=trinity:trinity@tcp(127.0.0.1:3306)/characters
export WORLD_DB_CONNECTION=trinity:trinity@tcp(127.0.0.1:3306)/world
export NATS_URL=nats://nats:4222
./bin/servers-registry
./bin/charserver
./bin/chatserver
# this port will be used in realmlist.wtf
PORT=3724 ./bin/authserver
# PREFERRED_HOSTNAME & PORT address that game client will connect to after auth
REALM_ID=1 \
PREFERRED_HOSTNAME=domain-or-ip.com \
PORT=9876 ./bin/game-load-balancer
# run TrinityCore worldserver as always but add HEALTH_CHECK_PORT env variable
HEALTH_CHECK_PORT=9898 ./worldserver
See LICENSE.