syntax = "proto3";
option go_package = ".;pb";
import "errorcode.proto";
import "google/protobuf/any.proto";

message ErrorData {
  string title = 1;
  int32 dataint = 2;
  string datastring = 3;
}

//用户消息流结构1
message UserMessage {
  string MainType = 1;  //用户消息处理 模块名 例如:user 对应项目中 user的模块
  string SubType = 2;   //用户消息处理函数名 例如:login  对应项目中 user的模块中
                        // api_login 的处理函数
  string servicePath = 3;     // 消息路由地址 部分消息前端确定转发给谁 \worker\worker0
  google.protobuf.Any data = 4;
  string sec = 5; //密文
}

//代理用户转发消息结构
message AgentMessage {
  string Ip = 1;
  string UserSessionId = 2;
  string UserId = 3;
  string ServiceTag = 4;
  string GatewayServiceId = 5;
  string MainType = 6;
  string SubType = 7;
  google.protobuf.Any Message = 8;
}

// RPC 服务固定回复结构
message RPCMessageReply {
  ErrorCode Code = 1;
  string ErrorMessage = 2;
  ErrorData 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;
  repeated UserMessage Reply = 2;
}

//发送批量消息
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 NoticeUserLoginReq {
  string Ip = 1;
  string UserSessionId = 2;
  string UserId = 3;
  string ServiceTag = 4;
  string GatewayServiceId = 5;
}

//通知用户登录
message NoticeUserCreateReq {
  string Ip = 1;
  string UserSessionId = 2;
  string UserId = 3;
  string ServiceTag = 4;
  string GatewayServiceId = 5;
}

//通知用户离线
message NoticeUserCloseReq {
  string Ip = 1;
  string UserSessionId = 2;
  string UserId = 3;
  string ServiceTag = 4;
  string GatewayServiceId = 5;
}

//英雄属性类型
enum HeroAttributesType {
  Hp = 0;    //血量
  Atk = 1;   //攻击
  Def = 2;   //防御
  Speed = 3; //速度
  Crit = 4;  //暴击
}

message SkillData {
  int32 skillID = 1;
  int32 skillLv = 2;
}

//用户资产数据 对标*cfg.Game_atn 数据结构
message UserAssets {
  string A = 1;
  string T = 2;
  int32 N = 3;
}

// ATNO 类型
message UserAtno {
  string A = 1;
  string T = 2;
  int32 N = 3;
  string O = 4;
}

message TaskParam {
  int32 first = 1;  //限定条件
  int32 second = 2; //次数
}

message RtaskParam {
  int32 param1 = 1;
  int32 param2 = 2;
  int32 param3 = 3;
}

message UIdReq { string uid = 1; }

message NameReq { string name = 1; }

message EmptyReq {}
message EmptyResp {}
// rpc 通用请求消息 1
message RPCGeneralReqA1 { string param1 = 1; }
// rpc 通用请求消息 1
message RPCGeneralReqA2 {
  string param1 = 1;
  string param2 = 2;
}
// rpc 通用请求消息 1
message RPCGeneralReqA3 {
  string param1 = 1;
  string param2 = 2;
  string param3 = 3;
}
// rpc 通用请求消息 1
message RPCGeneralReqA4 {
  string param1 = 1;
  string param2 = 2;
  string param3 = 3;
  string param4 = 4;
}

// rpc 通用请求消息 1
message RPCRTaskReq {
  string uid = 1;
  int32 taskType = 2;
  repeated int32 param = 3;
}

//服务列表信息
message ServiceDBInfo{
  string serverid = 1;              //@go_tags(`bson:"serverid"`)
  string serverName = 2;            //@go_tags(`bson:"serverName"`)
  string owner = 3;                 //@go_tags(`bson:"owner"`)
  string cross = 4;                 //@go_tags(`bson:"cross"`)
  string crossId = 5;                 //@go_tags(`bson:"crossId"`)
  string singleserver = 6;          //@go_tags(`bson:"singleserver"`)
  int64 opentime = 7;               //@go_tags(`bson:"opentime"`)
  bool redisIsCluster = 8;          //@go_tags(`bson:"redisIsCluster"`)
  repeated string redisAddr = 9;    //@go_tags(`bson:"redisAddr"`)
  string redisPassword = 10;         //@go_tags(`bson:"redisPassword"`)
  int32 redisDb = 11;               //@go_tags(`bson:"redisDb"`)
  string MongodbUrl = 12;           //@go_tags(`bson:"MongodbUrl"`)
  string mongodbDatabase = 13;      //@go_tags(`bson:"mongodbDatabase"`)
}