mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[-][+] Change .proto
[-][+] Change .proto
This commit is contained in:
43
Luban/Proto/pb_schemas/ExternalMessage.proto
Normal file
43
Luban/Proto/pb_schemas/ExternalMessage.proto
Normal file
@@ -0,0 +1,43 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package GameProto;
|
||||
|
||||
// 对外服数据协议
|
||||
message ExternalMessage {
|
||||
// 请求命令类型: 0 心跳,1 业务
|
||||
int32 cmdCode = 1;
|
||||
// 协议开关,用于一些协议级别的开关控制,比如 安全加密校验等。 : 0 不校验
|
||||
int32 protocolSwitch = 2;
|
||||
// 业务路由(高16为主, 低16为子)
|
||||
int32 cmdMerge = 3;
|
||||
// 响应码: 0:成功, 其他为有错误
|
||||
sint32 responseStatus = 4;
|
||||
// 验证信息: 当 responseStatus == -1001 时, 会有值
|
||||
string validMsg = 5;
|
||||
// 业务请求数据
|
||||
bytes data = 6;
|
||||
}
|
||||
|
||||
// int 包装类
|
||||
message IntPb {
|
||||
// int 值
|
||||
sint32 intValue = 1;
|
||||
}
|
||||
|
||||
// int list 包装类
|
||||
message IntListPb {
|
||||
// intList
|
||||
repeated sint32 intValues = 1;
|
||||
}
|
||||
|
||||
// long 包装类
|
||||
message LongPb {
|
||||
// long 值
|
||||
sint64 longValue = 1;
|
||||
}
|
||||
|
||||
// long list 包装类
|
||||
message LongListPb {
|
||||
// longList
|
||||
repeated sint64 longValues = 1;
|
||||
}
|
8
Luban/Proto/pb_schemas/GameProto.proto
Normal file
8
Luban/Proto/pb_schemas/GameProto.proto
Normal file
@@ -0,0 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package GameProto;
|
||||
// 游戏全局基础数据,和协议无关,就放结构
|
||||
|
||||
// 导入定义
|
||||
import "ProtoBase";
|
||||
|
36
Luban/Proto/pb_schemas/ProtoBase.proto
Normal file
36
Luban/Proto/pb_schemas/ProtoBase.proto
Normal file
@@ -0,0 +1,36 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package GameProto;
|
||||
// 这个文件只放协议,和协议头
|
||||
|
||||
// 消息协议
|
||||
message CSPkg
|
||||
{
|
||||
CSPkgHead Head = 1; //消息协议头
|
||||
CSPkgBody Body = 2; //消息协议体
|
||||
}
|
||||
|
||||
// 消息协议头
|
||||
message CSPkgHead
|
||||
{
|
||||
uint32 MsgId = 1; //协议号
|
||||
uint32 MsgLength = 2; //协议长度
|
||||
uint32 MsgVersion = 3; //协议版本
|
||||
uint32 Echo = 4; //回带字段
|
||||
uint32 SvrTime = 5; //服务器时间
|
||||
}
|
||||
|
||||
// 消息协议体
|
||||
message CSPkgBody
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 协议ID
|
||||
enum CSMsgID
|
||||
{
|
||||
CS_START = 0;
|
||||
CS_HeartBeat = 10001;
|
||||
CS_END = 10000;
|
||||
}
|
Reference in New Issue
Block a user