GithubHelp home page GithubHelp logo

eserver's Introduction

Simple erl game server framework中文

Compile

Compiled by rebar3, or execute the compile.bat script.

Run

start.bat or start.sh

client mock

Go to client and execute run.bat, which is simply implemented by python script.

protobuff, message route generation

In the proto directory, press serial number + module name.proto (e.g. 1login.proto, 2role.proto...) Write the protocol and click run.bat to generate

  1. proto.py to generate the route file route.erl
  2. protoc-erl to generate erlang protocol file

    Compile 3rd\gpb to generate protoc-erl or use 3rd\gpb\bin\protoc-erl.

  3. protoc generate client protocol file

Details

gate learns to use gen_statem behavior and uses Ranch as acceptor pool, and uses gen_server with minor modifications (see gen_server behavior used by the framework)

Process: one role for one thread, load a player on the gate by starting the role, and use mysql to store them.

role.erl gen_server
start(Args) ->%% Args is a list of elements passed in from outside
  supervisor:start_child(role_sup, Args).
  %% For simple_one_for_one supervisor, start => {'role', start_link, []}, apply(M,F,Args ++ []) call role:start_link(list_expanded), Module:init(list_expanded) will be called

Thanks to

Ranch
mysql-otp-poolboy
lager Recently when I uploaded, I realized that lager's previous bugs have been fixed, so I don't need to fork it locally anymore.
gdb
dynamic_compile

eserver's People

Contributors

anonymou3 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.