Giter VIP home page Giter VIP logo

channeld's Introduction

Overview

channeld is an open source, light-weight and efficient messaging gateway server designed for distributed game servers (typically MMO) and other backend applications that require real-time, subscription-based user interaction with high concurrency (e.g. instance messenger server).

architecture See the concepts in the design doc.

Applications:

There are three major types of application benifit from channeld's architecture design:

Relay Servers:

channeld can be used as the relay server to forward/broadcast messages between game clients.

Dedicated Server Gateway:

channeld can be used as the gateway server to route messages to different dedicated servers.

Seamless Distributed Server:

The ultimate purpose of channeld is to enable distributed composition of dedicated servers, together to form a seamless large virtual world.

Key features:

  • Protobuf-based binary protocol over TCP, KCP or WebSocket
  • FSM-based message filtering
  • Fanout-based data pub/sub of any type defined with Protobuf
  • Area of interest management based on channel and data pub/sub
  • [WIP] Backend servers load-balancing with auto-scaling
  • [WIP] Integration with the mainstream game engines (Unity, Unreal Engine)

Performance

channeld is aimmed to support 10Ks connections and 100Ks mps(messages per second) on a single node (uplink + downlink), and 10Ms mps in a distributed system.

Roadmap

Currently, the completeness of the project is 40%.

There is a dedicated roadmap documentation.

Keep in mind that the requirements of the real-life projects will decide the priority of the development.

Getting Started

1. Clone the source code

2. Docker

The fastest way to run the server is with Docker Compose.

There's a docker-compose file set up for running the chat rooms demo. Navigate to the root of the repo and run the command:

docker-compose up chat -d

3. The chat rooms demo

After starting the server, browse to http://localhost:8080.

Use the input box at the bottom to send messages, to the GLOBAL channel by default. The input box can also be used to send commands, which are started with '/'. The supported commands are:

  • list [typeFilter] [metadataFilter1],[metadataFilter2],... // the result format is Channel(<ChannelTypeName> <ChannelId>)
  • create <channelType> <metadata> // the channelType is an integer. See the ChannelType enum value defined in the proto file
  • remove <channelId> // only the channel creator has the permission to remove the channel.
  • sub <channelId> // subscribe to the channel
  • unsub <channelId> // unsubscribe from the channel
  • switch <channelId> // switch the active channel. Only the active channel displays the new chat messages.

4. The Unity tank demo

Follow these steps if the docker image has not been built for the tanks service yet:

  1. Check out the unity-mirror-channeld repo
  2. Create the Unity project following the instruction
  3. Either build the Linux player from Unity Editor (Build -> Linux Server), or via the command: Unity -batchmode -nographics -projectPath <PATH_TO_YOUR_UNITY_PROJECT> -executeMethod BuildScript.BuildLinuxServer -logFile build.log -quit. The path to the Unity Editor needs to added to the PATH environment argument in order to run the command.
  4. Build the docker image: docker build -t channeld/tanks .

Running the Unity tanks demo with Docker is similar to running the chat rooms demo. Navigate to the root of the repo and run the command:

docker-compose up tanks -d

Then you can the play the game in Unity Editor. See the full instruction here.

channeld's People

Contributors

indiest avatar

Watchers

James Cloos 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.