Giter Site home page Giter Site logo

nexxtt576 / goworld Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiaonanln/goworld

0.0 2.0 0.0 583 KB

Scalable Distributed Game Server Engine with Hot Swapping for MMORPGs Written in Go

Home Page: http://goworldgs.com/?p=64

License: Apache License 2.0

Makefile 0.49% Go 99.51%

goworld's Introduction

GoWorld - game server engine in Golang

Scalable Distributed Game Server Engine with Hot Swapping for MMORPGs Written in Golang

Working towards alpha

QQ群:662182346 中文站点:http://goworldgs.com/?p=64

Features

  • Spaces & Entities: manage multiple spaces and entities with AOI support
  • Distributed: increase server capacity by using more machines
  • Hot-Swappable: update game logic by restarting server process

Architecture

GoWorld Architecture

Introduction

GoWorld server adopts an entity framework, in which entities represent all players, monsters, NPCs. Entities in the same space can visit each other directly by calling methods or access attributes. Entities in different spaces can call each over using RPC.

A GoWorld server consists of one dispatcher, one or more games and one or more gates. The gates are responsable for handling client connections and receive/send packets from/to clients. The games manages all entities and runs all game logic. The dispatcher is responsable for redirecting packets among games and between games and gates.

The game processes are hot-swappable. We can swap a game by sending SIGUSR1 to the process and restart the process with -restore parameter to bring game back to work but with the latest executive image. This feature enables updating server-side logic or fixing server bugs transparently without significant interference of online players.

Get GoWorld

Download goworld:

get github.com/xiaonanln/goworld

Install dependencies

go get -u github.com/Sirupsen/logrus

go get -u github.com/garyburd/redigo

go get -u github.com/google/btree

go get -u github.com/pkg/errors

go get -u gopkg.in/eapache/queue.v1

go get -u github.com/xiaonanln/go-xnsyncutil/xnsyncutil

go get -u github.com/xiaonanln/goTimer

go get -u github.com/xiaonanln/typeconv

go get -u golang.org/x/net/context

go get -u gopkg.in/ini.v1

go get -u gopkg.in/mgo.v2

go get -u gopkg.in/vmihailenco/msgpack.v2

Run Example Server & Client

  1. Get MongoDB or Redis Running

  2. Copy goworld.ini.sample to goworld.ini, and configure accordingly

    cp goworld.ini.sample goworld.ini

  3. Build and run dispatcher:

    make dispatcher

    components/dispatcher/dispatcher

  4. Build and run gate:

    make gate

    components/gate/gate -gid 1

  5. Build and run test_game:

    make test_game

    examples/test_game/test_game -sid 1

  6. Build and run test_client:

    make test_client

    examples/test_client/test_client -N 500

goworld's People

Contributors

xiaonanln avatar

Watchers

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