Giter Site home page Giter Site logo

xxmingming / moba_game_server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facelessxcy/moba_game_server

0.0 1.0 0.0 121.58 MB

学习高并发、高Cpu利用率的分布式服务器MOBA

C 12.15% C++ 35.36% Starlark 0.26% Makefile 5.73% Ruby 0.62% Shell 1.30% CMake 0.30% M4 0.17% Java 12.92% Objective-C 8.19% PHP 2.62% Python 4.69% Batchfile 0.01% PowerShell 0.01% C# 15.60% Vim Script 0.01% Emacs Lisp 0.02% Dart 0.01% Go 0.02% Awk 0.01%

moba_game_server's Introduction

服务器以及帧同步下的客户端逻辑学习

学习分布式服务器架构 以及在帧同步下,客户端的同步逻辑(MOBA)

主要功能

1.使用libuv处理异步操作,例如:文件io,工作队列,计时器等。

2.内置lua解释器,导出C函数接口。可以支持纯Lua开发以及C++、lua混合开发

3.自定义包结构,包体数据支持json和protobuf

4.支持Mysql及Redis数据库

5.异步日志文件输出

6.支持tcp及udp

7.分布式部署各功能模块服务器

8.同步方式为基于UDP的帧同步

9.使用UDP实现一定程度上的可靠传输

总体架构

image1

网关数据转发细节

image2

帧同步步骤

1.开始,由服务器向客户端发送帧数据包,驱动客户端开始调用帧同步循环LogicUpdate()

2.每次循环中:

   (1)同步_lastFrameOpts的逻辑操作,调整位置到真实的逻辑位置:
        调整完以后,客户端同步到syncFrameID
    
   (2)从syncFrameID+1开始-->frame.frameid-1
       同步丢失的帧,快速同步到当前帧
       所有客户端的数据都被同步到frame.frameid-1
       同步这些帧造成的由帧驱动的公共物体的位置(如小兵位置)

  (3)获取最后一个操作 frame.frameid的操作,同时syncFrameID=frame,frameid
      更新_lastFrameOpts为该帧
      根据这个帧来处理,更新动画状态以及位移,产生的位移为“假位移”

  (4)采集下一帧要发送给服务器的操作

moba_game_server's People

Contributors

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