79 lines
1.8 KiB
Protocol Buffer
79 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
option go_package = ".;pb";
|
|
import "errorcode.proto";
|
|
import "google/protobuf/any.proto";
|
|
|
|
//用户消息流结构
|
|
message UserMessage {
|
|
string MainType = 1; //用户消息处理 模块名 例如:user 对应项目中 user的模块
|
|
string SubType = 2; //用户消息处理函数名 例如:login 对应项目中 user的模块中
|
|
// api_login 的处理函数
|
|
google.protobuf.Any data = 3;
|
|
string sec = 4; //密文
|
|
}
|
|
|
|
//代理用户转发消息结构
|
|
message AgentMessage {
|
|
string Ip = 1;
|
|
string UserSessionId = 2;
|
|
string UserId = 3;
|
|
string GatewayServiceId = 4;
|
|
string MainType = 5;
|
|
string SubType = 6;
|
|
google.protobuf.Any Message = 7;
|
|
}
|
|
|
|
// RPC 服务固定回复结构
|
|
message RPCMessageReply {
|
|
ErrorCode Code = 1;
|
|
string ErrorMessage = 2;
|
|
string ErrorData = 3;
|
|
repeated UserMessage Reply = 4;
|
|
}
|
|
|
|
//用户代理绑定Uid请求
|
|
message AgentBuildReq {
|
|
string UserSessionId = 1;
|
|
string UserId = 2;
|
|
string WorkerId = 3;
|
|
}
|
|
//用户代理解绑请求
|
|
message AgentUnBuildReq { string UserSessionId = 1; }
|
|
|
|
//向用户代理发送消息请求
|
|
message AgentSendMessageReq {
|
|
string UserSessionId = 1;
|
|
string MainType = 2;
|
|
string SubType = 3;
|
|
google.protobuf.Any Data = 4;
|
|
}
|
|
|
|
//发送批量消息
|
|
message BatchMessageReq {
|
|
repeated string UserSessionIds = 1;
|
|
string MainType = 2;
|
|
string SubType = 3;
|
|
google.protobuf.Any Data = 4;
|
|
}
|
|
|
|
//发送广播消息
|
|
message BroadCastMessageReq {
|
|
string MainType = 1; //服务名
|
|
string SubType = 2;
|
|
google.protobuf.Any Data = 3;
|
|
}
|
|
|
|
//关闭用户代理
|
|
message AgentCloseeReq { string UserSessionId = 1; }
|
|
|
|
//通知用户离线
|
|
message NoticeUserCloseReq {string UserSessionId = 1; string UserId = 2; }
|
|
|
|
//英雄属性类型
|
|
enum HeroAttributesType{
|
|
Hp = 0; //血量
|
|
Atk = 1; //攻击
|
|
Def = 2; //防御
|
|
Speed = 3; //速度
|
|
Crit = 4; //暴击
|
|
} |