# goserver
**Repository Path**: ccnu027cs_admin/goserver
## Basic Information
- **Project Name**: goserver
- **Description**: 基于nats的分布式的游戏服务器框架
- **Primary Language**: JavaScript
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2020-01-09
- **Last Updated**: 2024-03-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# goserver
<<<<<<< HEAD
=======
#### 介绍
基于nats的分布式的游戏服务器框架
# goserver
>>>>>>> 915882d1eebe58d2fe81d13691722eddb8783686
基于消息队列(nats)的游戏服务器框架
# 架构
## 1,gate服
和客户端通信使用websocket,仅支持protobuf,数据结构:
-------------------------
| id | protobuf message |
-------------------------
id是消息名的Hash值,用于标记消息名,反解析数据
因为websocket协议已经支持iframe分帧处理,不需要处理粘包,故包结构中无需包长度字段
## 2,多服rpc通信
使用nats(消息队列)构建服务器间通信,支持send,request,call请求
# 示例
<<<<<<< HEAD
1,启动消息队列服务(https://github.com/nats-io/nats-streaming-server)
2,见example目录,依次启动user/main.go,gate/main.go,client/main.go
# 基于goserver的游戏服务器
avatar-fight-server https://github.com/0990/avatar-fight-server
=======
1,启动消息队列服务([https://github.com/nats-io/nats-streaming-server](https://github.com/nats-io/nats-streaming-server))
2,见example目录,依次启动user/main.go,gate/main.go,client/main.go
# 基于goserver的游戏服务器
avatar-fight-server [https://github.com/0990/avatar-fight-server](https://github.com/0990/avatar-fight-server)
>>>>>>> 915882d1eebe58d2fe81d13691722eddb8783686