Git Product home page Git Product logo

tocloud9's Introduction

ToCloud9


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.

Run

Prerequisites:

  • Database for TrinityCore;
  • TrinityCore data folder (dbc, vmaps, mmaps).
  • Docker & docker-compose (for 'Docker-compose' approach);
  • Golang (for 'Without Docker' approach).

Docker-compose

  1. Fill in .env file with relevant data.
  2. $ docker-compose up -d

Without Docker

  1. Run $ make install.
  2. Apply game-server/trinitycore/31ea74b96e.diff patch on TrinityCore (should be compatible with this rev).
  3. Place bin/libsidecar.dylib & bin/libsidecar.h files in $TRINITY_CORE_SRC_PATH/dep/libsidecar folder and in folder with worldserver executable.
  4. Build patched TrinityCore.
  5. Install and run NATS.
  6. 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

License

See LICENSE.

tocloud9's People

Contributors

walkline avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.