Giter VIP home page Giter VIP logo

loric's Introduction

loric

License: MIT Go Reference

1.介绍

loric 是一款基于golang的分布式游戏服务器框架

2.功能

  • 网关:tcp协议的网关服务器
  • 节点通信:grpc
  • 日志:基于zap
  • 服务发现注册:支持etcd
  • 协议:支持protobuf、json
  • 配置: 基于viper
  • 游戏常用技术(见gkit):异步操作 、定时任务及守护任务 、延迟保存、时间轮
  • 集成服务权重,通过设置权重,达到流量控制,另一层面实现热更新效果。
  • gm管理系统

3.安装项目和依赖工具

go get github.com/cr-mao/[email protected]
# protobuf 编译
go install google.golang.org/protobuf/cmd/[email protected]
# grpc通信
go install google.golang.org/grpc/cmd/[email protected]

# https://github.com/protocolbuffers/protobuf/releases/tag/v23.4

4.tcp协议

-------------------------------
| len | seq | route | message |
-------------------------------

说明:

  1. 使用tcp协议时,为了解决粘包问题,还应在包前面加上包长度len,固定为4字节,使用大端序编码
  2. seq表示请求序列号 4字节,常用于请求、响应对的确认。
  3. route表示消息路由 2字节,不同的路由对应不同的业务处理流程。
  4. message表示消息体,采用json或protobuf编码。
  5. 心跳包 包长度len,固定为4字节, 包长度固定为0。

框架相关文档

框架相关文档

参考

loric's People

Contributors

cr-mao 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.