lorig

package module
v0.0.0-...-e849032 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 10 Imported by: 0

README

lori

Build Status Go Reference

1.介绍

lorig 是一款基于golang的分布式游戏服务器框架, 是基于 due 进行二次开发的。

2.安装项目和依赖工具
go get github.com/cr-mao/lorig@v0.0.0
# protobuf 编译
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
# grpc通信
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2

# https://github.com/protocolbuffers/protobuf/releases/tag/v23.4
3.功能
  • 网关:tcp协议的网关服务器
  • 日志:基于zap
  • 服务发现注册:基于etcd(todo)
  • 协议:支持protobuf、json
  • 配置: 基于viper
  • 游戏常用技术(见gamelib):异步操作 、定时任务及守护任务 、延迟保存、时间轮
4.协议
-------------------------------
| len | seq | route | message |
-------------------------------

说明:

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

tcp协议时,为了解决粘包问题,还应在包前面加上包长度len,固定为4字节,包长度固定为0。

-------
| len |
-------
|  0  |
-------
doc

文档

参考

Documentation

Index

Constants

View Source
const Version = "v0.0.0"

Version 框架版本

View Source
const Website = "https://github.com/cr-mao/lorig"

Website 框架网址

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer() *Container

NewContainer 创建一个容器

func (*Container) Add

func (c *Container) Add(components ...component.Component)

Add 添加组件

func (*Container) Serve

func (c *Container) Serve()

Serve 启动容器

Directories

Path Synopsis
Package config 负责配置信息
Package config 负责配置信息
ecc
rsa
xml
Package errors provides simple error handling primitives.
Package errors provides simple error handling primitives.
example
client
* User: cr-mao Date: 2023/7/31 Time: 15:38 Desc: 模拟app客户端
* User: cr-mao Date: 2023/7/31 Time: 15:38 Desc: 模拟app客户端
gate
* User: cr-mao Date: 2023/7/31 Time: 15:09 Desc: main.go
* User: cr-mao Date: 2023/7/31 Time: 15:09 Desc: main.go
job
lazy_save
* User: cr-mao Date: 2023/8/3 09:01 Email: crmao@qq.com Desc: discard.go
* User: cr-mao Date: 2023/8/3 09:01 Email: crmao@qq.com Desc: discard.go
internal
net
log
zap
tcp
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL