Git Product home page Git Product logo

gameserver-1's Introduction

gameserver

手游服务端

###todo

  • 暂时用redis缓存,实际项目中会使用mysql保存冷数据,游戏角色超过一个星期没有上线,从缓存保存到mysql中并删除;缓存中的数据每天凌晨定时保存到mysql

###通讯架构

  • 架构分为三部分,客户端,网关,中心服务器,以及其他逻辑服务器(例如pvp服务器,活动服务器);
  • 消息头为16个字节;id,消息源或者目标id,4byte;seq,消息序列号,2byte;ret,消息返回结果,2byte;cmd,消息命令字,2byte;unlen,未压缩前长度;len,消息体长度,2byte,理论上不要超过65535字节.
  • 逻辑服务器不保存任何状态,所有热数据都保存在redis;逻辑服务器id不允许相同,启动同个id的服务器会覆盖掉前一个服务器; 逻辑服务器可以允许注册相同cmd,来分摊计算压力;

###项目说明

  • Gate - 网关服务器,用于转发客户端与游戏服务器之间的消息,验证玩家数据,负载均衡,广播,数据统计
  • Login - 登陆服务器,玩家通过登陆服务器获取token,再使用token与Gate登陆,并提供第三方登陆和充值功能
  • Center - 中心服务器,其中全局服务器提供验证token,创建角色等功能
  • Client - 客户端测试程序
  • Tool - 工具集合,目前有一个设置服务器的小程序,后面再补充配置文件读取工具

gameserver-1's People

Contributors

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