This commit is contained in:
meixiongfeng 2022-06-29 17:46:45 +08:00
commit b3d92d2416
43 changed files with 1122 additions and 474 deletions

32
bin/json/game_global.json Normal file
View File

@ -0,0 +1,32 @@
[
{
"index": "max_hy",
"var": "30",
"intr": "最大好友数"
},
{
"index": "max_getreward",
"var": "10002,99",
"intr": "领取/赠送奖励"
},
{
"index": "max_get",
"var": "30",
"intr": "每日领取/赠送次数"
},
{
"index": "max_char",
"var": "100",
"intr": "聊天最大输入字符数量"
},
{
"index": "max_hmd",
"var": "30",
"intr": "最大黑名单数"
},
{
"index": "task_reset",
"var": "8",
"intr": "日/周常任务刷新时间8点"
}
]

View File

@ -24,7 +24,8 @@
},
"skill1": 110001,
"skill2": 110002,
"skill3": 110003
"skill3": 110003,
"enteranivalue": 100
},
{
"id": 11002,
@ -51,7 +52,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11003,
@ -78,7 +80,8 @@
},
"skill1": 110004,
"skill2": 110005,
"skill3": 110012
"skill3": 110012,
"enteranivalue": 0
},
{
"id": 11004,
@ -105,7 +108,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11005,
@ -132,7 +136,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11006,
@ -159,7 +164,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11009,
@ -186,7 +192,8 @@
},
"skill1": 110010,
"skill2": 110011,
"skill3": 110013
"skill3": 110013,
"enteranivalue": 0
},
{
"id": 22002,
@ -213,7 +220,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 90001,
@ -240,7 +248,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11011,
@ -267,7 +276,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11008,
@ -294,7 +304,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11017,
@ -321,7 +332,8 @@
},
"skill1": 110006,
"skill2": 110007,
"skill3": 110014
"skill3": 110014,
"enteranivalue": 0
},
{
"id": 11018,
@ -348,7 +360,8 @@
},
"skill1": 110008,
"skill2": 110009,
"skill3": 110015
"skill3": 110015,
"enteranivalue": 0
},
{
"id": 11019,
@ -375,7 +388,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11020,
@ -402,7 +416,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11021,
@ -429,7 +444,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 11099,
@ -456,7 +472,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 12001,
@ -483,7 +500,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 12003,
@ -501,7 +519,7 @@
],
"intr": "",
"events": "EventDataSet/Hero_11003.asset",
"cite": "11003",
"cite": "",
"effectstay": [],
"hpspace": {
"x": 0,
@ -510,7 +528,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 12009,
@ -537,7 +556,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 12017,
@ -564,7 +584,8 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
},
{
"id": 12018,
@ -582,7 +603,7 @@
],
"intr": "",
"events": "EventDataSet/Hero_11018.asset",
"cite": "11018",
"cite": "",
"effectstay": [],
"hpspace": {
"x": 0,
@ -591,6 +612,7 @@
},
"skill1": 0,
"skill2": 0,
"skill3": 0
"skill3": 0,
"enteranivalue": 0
}
]

View File

@ -6,10 +6,10 @@
"Limit": 1,
"Where": [],
"Order": [
"Type=rand"
"Type=Rnd"
],
"EmitPR": 1000,
"Type": "tongyongshanghai",
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=800"
],
@ -21,15 +21,15 @@
},
{
"Id": 200012101,
"Desc": "对敌方全体造成攻击力80%以及防御力120%的伤害",
"Desc": "对全体目标造成攻击力80%以及防御力120%的伤害",
"From": 2,
"Limit": 5,
"Where": [],
"Order": [
"Type=rand"
"Type=Rnd"
],
"EmitPR": 1000,
"Type": "tongyongshanghai",
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=800,ProSou2=0,Pro2=Total_Def,ProPar2=1200"
],
@ -41,15 +41,17 @@
},
{
"Id": 200013101,
"Desc": "对敌方全体攻击小于自身的目标造成攻击力80%的伤害",
"Desc": "对全体攻击小于自身的目标造成攻击力80%的伤害",
"From": 2,
"Limit": 5,
"Where": [
"Type=ProJudge,JudgeType=0,Key=Total_Atk,Op=1"
"Type=ProJudge,JudgeType=0,Key=Total_Atk,Op=0"
],
"Order": [
"Type=Rnd"
],
"Order": [],
"EmitPR": 1000,
"Type": "tongyongshanghai",
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=800"
],
@ -58,5 +60,114 @@
"FailFollowSK": [],
"MustHit": false,
"Tags": []
},
{
"Id": 200014101,
"Desc": "随机对敌方3个目标造成80%攻击力伤害,优先选择防御力小于自身的目标",
"From": 2,
"Limit": 3,
"Where": [],
"Order": [
"Type=Sort,SortType=0,Key=Total_Def,SortMet=0",
"Type=Rnd,SortType=ProJudge,RelyType=0,Key=Total_Def,Op=0",
"Type=Rnd,SortType=ProJudge,RelyType=0,Key=Total_Def,Op=5"
],
"EmitPR": 1000,
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=800"
],
"AddEffect": false,
"FollowSK": [],
"FailFollowSK": [],
"MustHit": false,
"Tags": []
},
{
"Id": 200015101,
"Desc": "随机对敌方防御最低的3个目标造成80%攻击力伤害",
"From": 2,
"Limit": 3,
"Where": [],
"Order": [
"Type=Sort,SortType=0,Key=Total_Def,SortMet=0"
],
"EmitPR": 1000,
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=800"
],
"AddEffect": false,
"FollowSK": [],
"FailFollowSK": [],
"MustHit": false,
"Tags": []
},
{
"Id": 200016101,
"Desc": "对敌方全体防御力小于100的敌方造成80%攻击力伤害",
"From": 2,
"Limit": 5,
"Where": [
"Type=ProJudge,JudgeType=1,Target=1,Key=Total_Def,Op=1,Val=100"
],
"Order": [
"Type=Rnd"
],
"EmitPR": 1000,
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=800"
],
"AddEffect": false,
"FollowSK": [],
"FailFollowSK": [],
"MustHit": false,
"Tags": []
},
{
"Id": 200017101,
"Desc": "对敌方全体的敌方造成攻击力110%伤害,",
"From": 2,
"Limit": 5,
"Where": [],
"Order": [
"Type=Rnd"
],
"EmitPR": 1000,
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=1100"
],
"AddEffect": false,
"FollowSK": [
200017102
],
"FailFollowSK": [],
"MustHit": false,
"Tags": []
},
{
"Id": 200017102,
"Desc": "若自身攻击力大于100则额外对全体敌方攻击力小于自身的目标造成攻击力50%伤害",
"From": 2,
"Limit": 5,
"Where": [
"Type=ProJudge,JudgeType=1,Target=0,Key=Total_Atk,Op=0,Val=100",
"Type=ProJudge,JudgeType=0,Key=Total_Atk,Op=0"
],
"Order": [
"Type=Rnd"
],
"EmitPR": 1000,
"Type": "Dmg",
"Argu": [
"DoVal=1,ProSou1=0,Pro1=Total_Atk,ProPar1=50"
],
"AddEffect": false,
"FollowSK": [],
"FailFollowSK": [],
"MustHit": false,
"Tags": []
}
]

View File

@ -142,5 +142,197 @@
]
}
]
},
{
"Id": 100014000,
"Name": "",
"Type": 1,
"Desc": "随机对敌方3个目标造成80%攻击力伤害,优先选择防御力小于自身的目标",
"MaxLV": 6,
"CD": [
4,
4,
4,
4,
4,
4
],
"Target": 2,
"ChildSkill": [
{
"Id": [
200014101
]
},
{
"Id": [
200014101
]
},
{
"Id": [
200014101
]
},
{
"Id": [
200014101
]
},
{
"Id": [
200014101
]
},
{
"Id": [
200014101
]
}
]
},
{
"Id": 100015000,
"Name": "",
"Type": 1,
"Desc": "随机对敌方防御最低的3个目标造成80%攻击力伤害",
"MaxLV": 6,
"CD": [
4,
4,
4,
4,
4,
4
],
"Target": 2,
"ChildSkill": [
{
"Id": [
200015101
]
},
{
"Id": [
200015101
]
},
{
"Id": [
200015101
]
},
{
"Id": [
200015101
]
},
{
"Id": [
200015101
]
},
{
"Id": [
200015101
]
}
]
},
{
"Id": 100016000,
"Name": "",
"Type": 1,
"Desc": "对敌方全体防御力小于100的敌方造成80%攻击力伤害",
"MaxLV": 6,
"CD": [
4,
4,
4,
4,
4,
4
],
"Target": 2,
"ChildSkill": [
{
"Id": [
200016101
]
},
{
"Id": [
200016101
]
},
{
"Id": [
200016101
]
},
{
"Id": [
200016101
]
},
{
"Id": [
200016101
]
},
{
"Id": [
200016101
]
}
]
},
{
"Id": 100017000,
"Name": "",
"Type": 1,
"Desc": "对敌方全体的敌方造成攻击力110%伤害若自身攻击力大于100则额外对全体敌方攻击力小于自身的目标造成攻击力50%伤害",
"MaxLV": 6,
"CD": [
4,
4,
4,
4,
4,
4
],
"Target": 2,
"ChildSkill": [
{
"Id": [
200017101
]
},
{
"Id": [
200017101
]
},
{
"Id": [
200017101
]
},
{
"Id": [
200017101
]
},
{
"Id": [
200017101
]
},
{
"Id": [
200017101
]
}
]
}
]

7
build.bat Normal file
View File

@ -0,0 +1,7 @@
SET CGO_ENABLED=0
SET GOOS=windows
SET GOARCH=amd64
go build -o build/gateway.exe services/gateway/main.go
go build -o build/worker.exe services/worker/main.go
go build -o build/web.exe services/web/main.go
go build -o build/dbservice.exe services/dbservice/main.go

View File

@ -21,8 +21,14 @@ var (
req: &pb.HeroInfoReq{
HeroId: "62baac19aa7c09b3679be57c",
},
rsp: &pb.HeroInfoRsp{},
enabled: true,
rsp: &pb.HeroInfoRsp{},
// enabled: true,
}, {
mainType: string(comm.ModuleHero),
subType: hero.HeroSubTypeChouka,
req: &pb.HeroChoukaReq{},
rsp: &pb.HeroChoukaResp{},
enabled: true,
},
}
)

View File

@ -19,7 +19,7 @@ import (
type Robot struct {
ws *websocket.Conn
opts *Options
user *pb.DB_UserData
user *pb.DBUser
builders []*builder
}

View File

@ -13,7 +13,7 @@ var user_builders = []*builder{
mainType: string(comm.ModuleUser),
subType: user.UserSubTypeCreate,
req: &pb.UserCreateReq{ //设置请求参数
NickName: "乐谷6281",
NickName: "乐谷62911",
},
rsp: &pb.UserCreateRsp{},
// enabled: true,

View File

@ -13,9 +13,9 @@ type (
IModule interface {
core.IModule
//向指定用户发送消息
SendMsgToUser(mainType, subType string, msg proto.Message, user *pb.Cache_UserData) (err error)
SendMsgToUser(mainType, subType string, msg proto.Message, user *pb.CacheUser) (err error)
//向多个用户发送消息
SendMsgToUsers(mainType, subType string, msg proto.Message, user ...*pb.Cache_UserData) (err error)
SendMsgToUsers(mainType, subType string, msg proto.Message, user ...*pb.CacheUser) (err error)
//校验消耗资源
CheckConsumeRes(uid string, res []*cfg.Game_atn) (code pb.ErrorCode)
}

View File

@ -24,8 +24,8 @@ func (this *ModelFriend) Init(service core.IService, module core.IModule, comp c
return
}
func (this *ModelFriend) Frined_FindCond(nickName string) *pb.DB_UserData {
var user *pb.DB_UserData
func (this *ModelFriend) Frined_FindCond(nickName string) *pb.DBUser {
var user *pb.DBUser
err := this.DB.FindOne(TableUser, bson.M{
"name": nickName,
}).Decode(&user)

View File

@ -212,7 +212,7 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
reply := &pb.RPCMessageReply{}
log.Debugf("agent:%s uId:%s MessageDistribution msg:%s.%s", this.sessionId, this.uId, msg.MainType, msg.SubType)
servicePath := comm.Service_Worker
if rule, ok := this.gateway.GetMsgDistribRule(msg.MainType, msg.SubType); ok {
if rule, ok := this.gateway.GetMsgDistribute(msg.MainType, msg.SubType); ok {
servicePath = rule
} else {
if len(this.wId) > 0 {

View File

@ -16,6 +16,7 @@ import (
/*
用户代理对象管理组件
*/
type AgentMgrComp struct {
cbase.ModuleCompBase
service base.IRPCXService
@ -29,12 +30,12 @@ func (this *AgentMgrComp) Init(service core.IService, module core.IModule, comp
return
}
//加入新的用户
// Connect 加入新的用户
func (this *AgentMgrComp) Connect(a IAgent) {
this.agents.Store(a.SessionId(), a)
}
//移除断开的用户
// DisConnect 移除断开的用户
func (this *AgentMgrComp) DisConnect(a IAgent) {
this.agents.Delete(a.SessionId())
if a.UserId() != "" { //登录用户 通知业务服务处理玩家离线相关
@ -48,7 +49,7 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
}
}
//用户登录绑定Id
// Bind 用户绑定Id
func (this *AgentMgrComp) Bind(ctx context.Context, args *pb.AgentBuildReq, reply *pb.RPCMessageReply) error {
if a, ok := this.agents.Load(args.UserSessionId); ok {
a.(IAgent).Bind(args.UserId, args.WorkerId)
@ -59,7 +60,7 @@ func (this *AgentMgrComp) Bind(ctx context.Context, args *pb.AgentBuildReq, repl
return nil
}
//用户登录解绑Id
// UnBind 用户解绑Id
func (this *AgentMgrComp) UnBind(ctx context.Context, args *pb.AgentUnBuildReq, reply *pb.RPCMessageReply) error {
if a, ok := this.agents.Load(args.UserSessionId); ok {
a.(IAgent).UnBind()
@ -70,7 +71,7 @@ func (this *AgentMgrComp) UnBind(ctx context.Context, args *pb.AgentUnBuildReq,
return nil
}
//向用户发送消息
// SendMsgToAgent 向用户发送消息
func (this *AgentMgrComp) SendMsgToAgent(ctx context.Context, args *pb.AgentSendMessageReq, reply *pb.RPCMessageReply) error {
if a, ok := this.agents.Load(args.UserSessionId); ok {
a.(IAgent).WriteMsg(&pb.UserMessage{
@ -85,7 +86,7 @@ func (this *AgentMgrComp) SendMsgToAgent(ctx context.Context, args *pb.AgentSend
return nil
}
//向多个户发送消息
// SendMsgToAgents 向多个户发送消息
func (this *AgentMgrComp) SendMsgToAgents(ctx context.Context, args *pb.BatchMessageReq, reply *pb.RPCMessageReply) error {
msg := &pb.UserMessage{
MainType: args.MainType,
@ -100,7 +101,7 @@ func (this *AgentMgrComp) SendMsgToAgents(ctx context.Context, args *pb.BatchMes
return nil
}
//向所有户发送消息
// SendMsgToAllAgent 向所有户发送消息
func (this *AgentMgrComp) SendMsgToAllAgent(ctx context.Context, args *pb.BroadCastMessageReq, reply *pb.RPCMessageReply) error {
msg := &pb.UserMessage{
MainType: args.MainType,
@ -114,7 +115,7 @@ func (this *AgentMgrComp) SendMsgToAllAgent(ctx context.Context, args *pb.BroadC
return nil
}
//关闭代理
// CloseAgent 关闭某个用户
func (this *AgentMgrComp) CloseAgent(ctx context.Context, args *pb.AgentCloseeReq, reply *pb.RPCMessageReply) error {
if a, ok := this.agents.Load(args.UserSessionId); ok {
a.(IAgent).Close()

View File

@ -16,15 +16,15 @@ type configureComp struct {
modules.MCompConfigure
}
//组件初始化接口
// Init 组件初始化接口
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.ModuleCompBase.Init(service, module, comp, options)
this.LoadConfigure(game_msgdistrib, cfg.NewGame_msgDistrib)
return
}
//获取消息分发规则读取配置表
func (this *configureComp) GetMsgDistribRule(mtype, stype string) (rule string, ok bool) {
// GetMsgDistribute 获取消息分发规则读取配置表
func (this *configureComp) GetMsgDistribute(mtype, stype string) (rule string, ok bool) {
var (
err error
v interface{}

View File

@ -8,7 +8,7 @@ import (
)
type (
//用户代理对象接口定义
// IAgent 用户代理对象接口定义
IAgent interface {
SessionId() string
IP() string
@ -19,12 +19,12 @@ type (
WriteMsg(msg *pb.UserMessage) (err error)
Close() //主动关闭接口
}
//网关模块 接口定义
// IGateway 网关模块 接口定义
IGateway interface {
core.IModule
Service() base.IRPCXService
Connect(a IAgent)
DisConnect(a IAgent)
GetMsgDistribRule(mtype, stype string) (rule string, ok bool)
GetMsgDistribute(mtype, stype string) (rule string, ok bool)
}
)

View File

@ -14,6 +14,7 @@ import (
描述:提供客户端网关路由服务 管理用户socket对象 以及分发用户消息
开发:李伟
*/
func NewModule() core.IModule {
m := new(Gateway)
return m
@ -21,73 +22,79 @@ func NewModule() core.IModule {
type Gateway struct {
modules.ModuleBase
service base.IRPCXService
wsservice *WSServiceComp //websocket 服务组件 提供websocket服务监听
agentmgr *AgentMgrComp //用户代理对象管理组件 管理用户socekt对象
service base.IRPCXService // rpcx服务接口 主要client->server
wsService *WSServiceComp // websocket服务 监听websocket连接
agentMgr *AgentMgrComp // 客户端websocket连接管理
configure *configureComp
}
//模块名
// GetType 获取模块服务类型
func (this *Gateway) GetType() core.M_Modules {
return comm.ModuleGate
}
//模块自定义参数
// NewOptions 模块自定义参数
func (this *Gateway) NewOptions() (options core.IModuleOptions) {
return new(Options)
}
//提供服务对象获取接口
// Service 获取rpcx服务接口
func (this *Gateway) Service() base.IRPCXService {
return this.service
}
//模块初始化函数
// Init 模块初始化函数
func (this *Gateway) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService)
return
}
//模块启动函数 注册rpc服务接口提供用户相关的rpc接口服务
// Start 模块启动函数 注册rpc服务接口提供用户相关的rpc接口服务
func (this *Gateway) Start() (err error) {
//注册用户绑定uid接口 登录成功后触发
this.service.RegisterFunctionName(string(comm.Rpc_GatewayAgentBind), this.agentmgr.Bind)
//注册用户解绑uid接口 登出或则切换账号是触发
this.service.RegisterFunctionName(string(comm.Rpc_GatewayAgentUnBind), this.agentmgr.UnBind)
//向用户发送消息接口
this.service.RegisterFunctionName(string(comm.Rpc_GatewayAgentSendMsg), this.agentmgr.SendMsgToAgent)
//向多个用户对象发送消息接口
this.service.RegisterFunctionName(string(comm.Rpc_GatewaySendBatchMsg), this.agentmgr.SendMsgToAgents)
//向所有用户发送消息接口
this.service.RegisterFunctionName(string(comm.Rpc_GatewaySendRadioMsg), this.agentmgr.SendMsgToAllAgent)
//关闭用户socket连接接口
this.service.RegisterFunctionName(string(comm.Rpc_GatewayAgentClose), this.agentmgr.CloseAgent)
_name2Func := map[string]any{
// 注册用户绑定uid接口 登录成功后触发
string(comm.Rpc_GatewayAgentBind): this.agentMgr.Bind,
// 注册用户解绑uid接口 登出或则切换账号是触发
string(comm.Rpc_GatewayAgentUnBind): this.agentMgr.UnBind,
// 向用户发送消息接口
string(comm.Rpc_GatewayAgentSendMsg): this.agentMgr.SendMsgToAgent,
// 向多个用户对象发送消息接口
string(comm.Rpc_GatewaySendBatchMsg): this.agentMgr.SendMsgToAgents,
// 向所有用户发送消息接口
string(comm.Rpc_GatewaySendRadioMsg): this.agentMgr.SendMsgToAllAgent,
// 关闭用户socket连接接口
string(comm.Rpc_GatewayAgentClose): this.agentMgr.CloseAgent,
}
for name, fn := range _name2Func {
this.service.RegisterFunctionName(name, fn)
}
err = this.ModuleBase.Start()
return
}
//装备组件
// OnInstallComp 装备组件
func (this *Gateway) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.agentmgr = this.RegisterComp(new(AgentMgrComp)).(*AgentMgrComp)
this.wsservice = this.RegisterComp(new(WSServiceComp)).(*WSServiceComp)
this.agentMgr = this.RegisterComp(new(AgentMgrComp)).(*AgentMgrComp)
this.wsService = this.RegisterComp(new(WSServiceComp)).(*WSServiceComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
//有新的连接对象进入
// Connect 有新的连接对象进入
func (this *Gateway) Connect(a IAgent) {
log.Debugf("[Module.Gateway] have new connect:Ip[%s] SessionId:[%s]", a.IP(), a.SessionId())
this.agentmgr.Connect(a)
this.agentMgr.Connect(a)
}
//有用户断开连接
// DisConnect 有用户断开连接
func (this *Gateway) DisConnect(a IAgent) {
log.Debugf("[Module.Gateway] have disConnect:Ip[%s] SessionId:[%s] uid:[%s]", a.IP(), a.SessionId(), a.UserId())
this.agentmgr.DisConnect(a)
this.agentMgr.DisConnect(a)
}
//读取消息分发规则
func (this *Gateway) GetMsgDistribRule(mtype, stype string) (rule string, ok bool) {
return this.configure.GetMsgDistribRule(mtype, stype)
// GetMsgDistribute 读取消息分发规则
func (this *Gateway) GetMsgDistribute(mtype, stype string) (rule string, ok bool) {
return this.configure.GetMsgDistribute(mtype, stype)
}

View File

@ -14,7 +14,7 @@ type (
}
)
//序列化参数对象
// LoadConfig 配置文件序列化为Options
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
if settings != nil {
err = mapstructure.Decode(settings, this)

View File

@ -16,19 +16,24 @@ type WSServiceComp struct {
cbase.ModuleCompBase
options *Options
module IGateway
gin gin.ISys
module IGateway // 网关
gin gin.ISys // gin服务接口
}
// Init websocket服务初始化
func (this *WSServiceComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.ModuleCompBase.Init(service, module, comp, options)
this.options = options.(*Options)
this.module = module.(IGateway)
this.gin, err = gin.NewSys(gin.SetListenPort(this.options.ListenPort))
// 游戏业务逻辑处理
this.gin.GET("/gateway", this.ws)
return
}
// ws 升级websocket连接处理本次请求
func (this *WSServiceComp) ws(c *engine.Context) {
upGrader := websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {

View File

@ -14,9 +14,10 @@ type apiComp struct {
}
const ( //消息回复的头名称
StrengthenUplv = "strengthenherolv"
HeroSubTypeInfo = "info" //英雄卡片信息
HeroSubTypeList = "list" //英雄列表
StrengthenUplv = "strengthenherolv"
HeroSubTypeInfo = "info" //英雄卡片信息
HeroSubTypeList = "list" //英雄列表
HeroSubTypeChouka = "chouka" //抽卡
)
//组件初始化接口

View File

@ -0,0 +1,42 @@
package hero
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
)
func (this *apiComp) ChoukaCheck(session comm.IUserSession, req *pb.HeroChoukaReq) (result map[string]interface{}, code comm.ErrorCode) {
result = make(map[string]interface{})
return
}
//抽卡
func (this *apiComp) Chouka(session comm.IUserSession, result map[string]interface{}, req *pb.HeroChoukaReq) (code pb.ErrorCode) {
rsp := &pb.HeroChoukaResp{}
defer func() {
err := session.SendMsg(string(this.moduleHero.GetType()), HeroSubTypeChouka, rsp)
if err != nil {
code = pb.ErrorCode_SystemError
return
}
utils.TraceFunc(session.GetUserId(), string(this.moduleHero.GetType()), HeroSubTypeChouka, req, rsp)
}()
heroCfgIds := []int32{15001, 25001}
if err := this.moduleHero.modelHero.createMultiHero(session.GetUserId(), heroCfgIds...); err != nil {
code = pb.ErrorCode_HeroCreate
return
}
heroes, err := this.moduleHero.modelHero.getHeroList(session.GetUserId())
if err != nil {
log.Errorf("%v", err)
code = pb.ErrorCode_DBError
return
}
rsp.Heroes = heroes
return
}

View File

@ -3,6 +3,7 @@ package hero
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
)
//参数校验
@ -24,6 +25,7 @@ func (this *apiComp) Info(session comm.IUserSession, result map[string]interface
code = pb.ErrorCode_SystemError
return
}
utils.TraceFunc(session.GetUserId(), string(this.moduleHero.GetType()), HeroSubTypeList, req, rsp)
}()
if v, ok := result["hero"]; ok {

View File

@ -3,6 +3,7 @@ package hero
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
)
//参数校验
@ -18,6 +19,7 @@ func (this *apiComp) List(session comm.IUserSession, result map[string]interface
if err != nil {
code = pb.ErrorCode_SystemError
}
utils.TraceFunc(session.GetUserId(), string(this.moduleHero.GetType()), HeroSubTypeList, req, rsp)
}()
list, err := this.moduleHero.modelHero.getHeroList(session.GetUserId())

View File

@ -42,8 +42,10 @@ func (this *ModelHero) initHero(uid string, heroCfgId int32) *pb.DBHero {
NormalSkill: []*pb.SkillData{}, //初始技能
IsOverlying: true, //是否允许叠加,
Block: false, //未锁定
CardType: heroCfg.Type, //卡片类型
Skins: []int32{},
EquipID: make([]string, 6), //初始装备
SameCount: 1, //默认叠加数量
AddProperty: make(map[int32]int32),
Energy: make(map[int32]int32),
Property: make(map[int32]int32),
@ -52,29 +54,58 @@ func (this *ModelHero) initHero(uid string, heroCfgId int32) *pb.DBHero {
}
//创建一个指定的英雄
func (this *ModelHero) createOneHero(uid string, heroCfgId int32) error {
func (this *ModelHero) createOneHero(uid string, heroCfgId int32) (err error) {
hero := this.initHero(uid, heroCfgId)
if hero != nil {
return this.moduleHero.modelHero.AddList(uid, hero.Id, hero)
if err = this.moduleHero.modelHero.AddList(uid, hero.Id, hero); err != nil {
log.Errorf("%v", err)
return
}
}
return nil
}
//创建多个指定的英雄 heroCfgIds可填入多个英雄ID
func (this *ModelHero) createMultiHero(uid string, heroCfgIds ...int32) error {
// data := make(map[string]interface{})
for _, v := range heroCfgIds {
if err := this.createOneHero(uid, v); err != nil {
return err
heroes, err := this.moduleHero.modelHero.getHeroList(uid)
if err != nil {
return err
}
if len(heroes) == 0 {
for _, v := range heroCfgIds {
if err := this.createOneHero(uid, v); err != nil {
return err
}
}
} else {
findHero := func(heroId int32) (*pb.DBHero, bool) {
for _, h := range heroes {
if h.HeroID == heroId {
return h, true
}
}
return nil, false
}
for _, v := range heroCfgIds {
if h, ok := findHero(v); ok {
h.SameCount++
data := map[string]interface{}{
"sameCount": h.SameCount, //叠加数
}
if err := this.modifyHero(uid, h.Id, data); err != nil {
return err
}
} else {
if err := this.createOneHero(uid, v); err != nil {
return err
}
}
}
// hero := this.initHero(uid, v)
// if hero != nil {
// data[hero.Id] = hero
// }
}
return nil
// return this.moduleHero.model_hero.AddLists(uid, data)
}
//获取一个英雄
@ -104,7 +135,6 @@ func (this *ModelHero) getHeroList(uid string) ([]*pb.DBHero, error) {
if err != nil {
return nil, err
}
return heroes, nil
}

View File

@ -56,7 +56,7 @@ func (this *Mail) CreateNewMail(uId string) {
log.Error("create mail failed")
}
// 通知玩家
var _cache = &pb.Cache_UserData{}
var _cache = &pb.CacheUser{}
err = this.modelMail.MCompModel.Get(uId, _cache)
if err == nil {
return

View File

@ -34,7 +34,7 @@ func (this *ModuleBase) Init(service core.IService, module core.IModule, options
}
//向指定用户发送消息
func (this *ModuleBase) SendMsgToUser(mainType, subType string, msg proto.Message, user *pb.Cache_UserData) (err error) {
func (this *ModuleBase) SendMsgToUser(mainType, subType string, msg proto.Message, user *pb.CacheUser) (err error) {
reply := &pb.RPCMessageReply{}
data, _ := ptypes.MarshalAny(msg)
if _, err = this.service.RpcGo(context.Background(), fmt.Sprintf("%s/%s", comm.Service_Gateway, user.GatewayServiceId), string(comm.Rpc_GatewayAgentSendMsg), &pb.AgentSendMessageReq{
@ -49,7 +49,7 @@ func (this *ModuleBase) SendMsgToUser(mainType, subType string, msg proto.Messag
}
//向多个用户发送消息
func (this *ModuleBase) SendMsgToUsers(mainType, subType string, msg proto.Message, user ...*pb.Cache_UserData) (err error) {
func (this *ModuleBase) SendMsgToUsers(mainType, subType string, msg proto.Message, user ...*pb.CacheUser) (err error) {
var (
gateways map[string][]string = make(map[string][]string)
gateway []string

View File

@ -8,7 +8,7 @@ import (
func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.UserCreateReq) (result map[string]interface{}, code comm.ErrorCode) {
result = make(map[string]interface{})
self := &pb.DB_UserData{}
self := &pb.DBUser{}
err := this.module.modelUser.Get(session.GetUserId(), self)
if err != nil {
code = comm.ErrorCode{Code: pb.ErrorCode_DBError}
@ -29,6 +29,14 @@ func (this *apiComp) Create(session comm.IUserSession, result map[string]interfa
}
}()
if self, ok := result["self"]; ok {
v := self.(*pb.DBUser)
if v.Name != "" {
code = pb.ErrorCode_RoleCreated
return
}
}
update := map[string]interface{}{
"name": req.NickName,
}

View File

@ -21,7 +21,7 @@ func (this *apiComp) LoginCheck(session comm.IUserSession, req *pb.UserLoginReq)
func (this *apiComp) Login(session comm.IUserSession, result map[string]interface{}, req *pb.UserLoginReq) (code pb.ErrorCode) {
var (
err error
user *pb.DB_UserData
user *pb.DBUser
)
defer func() {

View File

@ -27,18 +27,18 @@ func (this *ModelUser) Init(service core.IService, module core.IModule, comp cor
return
}
func (this *ModelUser) User_FindByAccount(sid int32, account string) (*pb.DB_UserData, error) {
func (this *ModelUser) User_FindByAccount(sid int32, account string) (*pb.DBUser, error) {
filter := bson.M{
"sid": sid,
"binduid": account,
}
sr := this.DB.FindOne(TableUser, filter)
var nd *pb.DB_UserData
var nd *pb.DBUser
err := sr.Decode(&nd)
return nd, err
}
func (this *ModelUser) User_Create(user *pb.DB_UserData) (err error) {
func (this *ModelUser) User_Create(user *pb.DBUser) (err error) {
_id := primitive.NewObjectID().Hex()
user.Id = _id
user.Uid = fmt.Sprintf("%d_%s", user.Sid, _id)
@ -49,8 +49,8 @@ func (this *ModelUser) User_Create(user *pb.DB_UserData) (err error) {
}
//获取用户
func (this *ModelUser) getUser(uid string) *pb.DB_UserData {
dbUser := &pb.DB_UserData{}
func (this *ModelUser) getUser(uid string) *pb.DBUser {
dbUser := &pb.DBUser{}
if err := this.Get(uid, dbUser); err != nil {
log.Errorf("getUser err:%v", err)
return nil

View File

@ -37,7 +37,7 @@ func (this *Api_Comp) Register(c *engine.Context) {
rsp := &pb.UserRegisterRsp{}
err := c.BindJSON(&req)
if err == nil {
err := this.module.modelUser.User_Create(&pb.DB_UserData{
err := this.module.modelUser.User_Create(&pb.DBUser{
Binduid: req.Account,
Sid: req.Sid,
})

View File

@ -48,6 +48,7 @@ const (
ErrorCode_BindUser ErrorCode = 1002 //用户绑定错误
ErrorCode_GoldNoEnough ErrorCode = 1003 // 金币不足
ErrorCode_DiamondNoEnough ErrorCode = 1004 // 钻石不足
ErrorCode_RoleCreated ErrorCode = 1005 //已创角
// friend
ErrorCode_FriendNotSelf ErrorCode = 1100 //不能是自己
ErrorCode_FriendSelfMax ErrorCode = 1101 //超出好友最大数量
@ -67,6 +68,7 @@ const (
ErrorCode_ItemsGridNumUpper ErrorCode = 1202 //背包格子数量已达上限
ErrorCode_ItemsGirdAmountUpper ErrorCode = 1203 //背包格子容量已达上限
// hero
<<<<<<< HEAD
ErrorCode_HeroNoExist ErrorCode = 1300 //英雄不存在
ErrorCode_HeroNoEnough ErrorCode = 1301 //英雄数量不足
ErrorCode_HeroMaxLv ErrorCode = 1302 //英雄达到最大等级
@ -77,6 +79,14 @@ const (
ErrorCode_HeroNoResonate ErrorCode = 1037 // 没有共鸣
ErrorCode_HeroNotNeedResonate ErrorCode = 1038 // 不需要重置共鸣
ErrorCode_HeroNoEnergy ErrorCode = 1039 // 没有能量点数
=======
ErrorCode_HeroNoExist ErrorCode = 1300 //英雄不存在
ErrorCode_HeroNoEnough ErrorCode = 1301 //英雄数量不足
ErrorCode_HeroMaxLv ErrorCode = 1302 //英雄达到最大等级
ErrorCode_HeroInitCreat ErrorCode = 1303 //初始化英雄
ErrorCode_HeroColorErr ErrorCode = 1304 // 品质不匹配
ErrorCode_HeroCreate ErrorCode = 1305 // 创建卡失败
>>>>>>> 0ca503749757556138d05f70d507ec75fc80bc23
// equipment
ErrorCode_EquipmentOnFoundEquipment ErrorCode = 1400 // 未找到武器
ErrorCode_EquipmentLvlimitReached ErrorCode = 1401 // 武器等级已达上限
@ -109,6 +119,7 @@ var (
1002: "BindUser",
1003: "GoldNoEnough",
1004: "DiamondNoEnough",
1005: "RoleCreated",
1100: "FriendNotSelf",
1101: "FriendSelfMax",
1102: "FriendTargetMax",
@ -130,11 +141,15 @@ var (
1302: "HeroMaxLv",
1303: "HeroInitCreat",
1304: "HeroColorErr",
<<<<<<< HEAD
1035: "HeroSkillUpErr",
1036: "HeroMaxResonate",
1037: "HeroNoResonate",
1038: "HeroNotNeedResonate",
1039: "HeroNoEnergy",
=======
1305: "HeroCreate",
>>>>>>> 0ca503749757556138d05f70d507ec75fc80bc23
1400: "EquipmentOnFoundEquipment",
1401: "EquipmentLvlimitReached",
}
@ -163,6 +178,7 @@ var (
"BindUser": 1002,
"GoldNoEnough": 1003,
"DiamondNoEnough": 1004,
"RoleCreated": 1005,
"FriendNotSelf": 1100,
"FriendSelfMax": 1101,
"FriendTargetMax": 1102,
@ -184,11 +200,15 @@ var (
"HeroMaxLv": 1302,
"HeroInitCreat": 1303,
"HeroColorErr": 1304,
<<<<<<< HEAD
"HeroSkillUpErr": 1035,
"HeroMaxResonate": 1036,
"HeroNoResonate": 1037,
"HeroNotNeedResonate": 1038,
"HeroNoEnergy": 1039,
=======
"HeroCreate": 1305,
>>>>>>> 0ca503749757556138d05f70d507ec75fc80bc23
"EquipmentOnFoundEquipment": 1400,
"EquipmentLvlimitReached": 1401,
}
@ -225,7 +245,11 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
<<<<<<< HEAD
0x6f, 0x2a, 0xcf, 0x08, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
=======
0x6f, 0x2a, 0x85, 0x08, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
>>>>>>> 0ca503749757556138d05f70d507ec75fc80bc23
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -255,6 +279,7 @@ var file_errorcode_proto_rawDesc = []byte{
0x73, 0x65, 0x72, 0x10, 0xea, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f,
0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xeb, 0x07, 0x12, 0x14, 0x0a, 0x0f, 0x44, 0x69, 0x61,
0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xec, 0x07, 0x12,
<<<<<<< HEAD
0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, 0x66,
0x10, 0xcc, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c,
0x66, 0x4d, 0x61, 0x78, 0x10, 0xcd, 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e,
@ -296,6 +321,44 @@ var file_errorcode_proto_rawDesc = []byte{
0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64,
0x10, 0xf9, 0x0a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
=======
0x10, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x10, 0xed,
0x07, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65,
0x6c, 0x66, 0x10, 0xcc, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53,
0x65, 0x6c, 0x66, 0x4d, 0x61, 0x78, 0x10, 0xcd, 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69,
0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x10, 0xce, 0x08, 0x12,
0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4e, 0x6f, 0x44,
0x61, 0x74, 0x61, 0x10, 0xcf, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64,
0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xd0, 0x08, 0x12,
0x0e, 0x0a, 0x09, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x59, 0x65, 0x74, 0x10, 0xd1, 0x08, 0x12,
0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x65,
0x74, 0x10, 0xd2, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65,
0x6c, 0x66, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd3, 0x08, 0x12, 0x19, 0x0a,
0x14, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x61,
0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd4, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65,
0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd5, 0x08, 0x12,
0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61,
0x78, 0x10, 0xd6, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65,
0x61, 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xd7, 0x08,
0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67,
0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46,
0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72,
0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64,
0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x10,
0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a,
0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68,
0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76,
0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43,
0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65,
0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x99, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45,
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45,
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45,
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52,
0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
>>>>>>> 0ca503749757556138d05f70d507ec75fc80bc23
}
var (

View File

@ -1084,6 +1084,92 @@ func (x *HeroJuexingResp) GetHero() *DBHero {
return nil
}
//抽卡
type HeroChoukaReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *HeroChoukaReq) Reset() {
*x = HeroChoukaReq{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_hero_msg_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HeroChoukaReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HeroChoukaReq) ProtoMessage() {}
func (x *HeroChoukaReq) ProtoReflect() protoreflect.Message {
mi := &file_hero_hero_msg_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HeroChoukaReq.ProtoReflect.Descriptor instead.
func (*HeroChoukaReq) Descriptor() ([]byte, []int) {
return file_hero_hero_msg_proto_rawDescGZIP(), []int{20}
}
type HeroChoukaResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Heroes []*DBHero `protobuf:"bytes,1,rep,name=heroes,proto3" json:"heroes"`
}
func (x *HeroChoukaResp) Reset() {
*x = HeroChoukaResp{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_hero_msg_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HeroChoukaResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HeroChoukaResp) ProtoMessage() {}
func (x *HeroChoukaResp) ProtoReflect() protoreflect.Message {
mi := &file_hero_hero_msg_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HeroChoukaResp.ProtoReflect.Descriptor instead.
func (*HeroChoukaResp) Descriptor() ([]byte, []int) {
return file_hero_hero_msg_proto_rawDescGZIP(), []int{21}
}
func (x *HeroChoukaResp) GetHeroes() []*DBHero {
if x != nil {
return x.Heroes
}
return nil
}
var File_hero_hero_msg_proto protoreflect.FileDescriptor
var file_hero_hero_msg_proto_rawDesc = []byte{
@ -1145,6 +1231,7 @@ var file_hero_hero_msg_proto_rawDesc = []byte{
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a,
0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x49, 0x44,
<<<<<<< HEAD
0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x76, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f,
0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04,
@ -1184,6 +1271,50 @@ var file_hero_hero_msg_proto_rawDesc = []byte{
0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52,
0x04, 0x68, 0x65, 0x72, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
=======
0x22, 0x76, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67,
0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04,
0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x2a, 0x0a, 0x0a,
0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x0a, 0x75, 0x70,
0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, 0x22, 0x34, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6f,
0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71,
0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x4f,
0x0a, 0x15, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65,
0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72,
0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67,
0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22,
0x70, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55,
0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68,
0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65,
0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73,
0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79,
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70,
0x65, 0x22, 0x3b, 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e,
0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e,
0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70,
0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5a,
0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71,
0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a,
0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52,
0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x48, 0x65,
0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a,
0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62,
0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x0f, 0x0a,
0x0d, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x22, 0x34,
0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70,
0x12, 0x22, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65,
0x72, 0x6f, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
>>>>>>> 0ca503749757556138d05f70d507ec75fc80bc23
}
var (
@ -1198,7 +1329,7 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte {
return file_hero_hero_msg_proto_rawDescData
}
var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
var file_hero_hero_msg_proto_goTypes = []interface{}{
(*HeroInfoReq)(nil), // 0: pb.HeroInfoReq
(*HeroInfoRsp)(nil), // 1: pb.HeroInfoRsp
@ -1220,27 +1351,30 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{
(*HeroGongmingUseEnergyResp)(nil), // 17: pb.HeroGongmingUseEnergyResp
(*HeroJuexingReq)(nil), // 18: pb.HeroJuexingReq
(*HeroJuexingResp)(nil), // 19: pb.HeroJuexingResp
(*DBHero)(nil), // 20: pb.DBHero
(*HeroChoukaReq)(nil), // 20: pb.HeroChoukaReq
(*HeroChoukaResp)(nil), // 21: pb.HeroChoukaResp
(*DBHero)(nil), // 22: pb.DBHero
}
var file_hero_hero_msg_proto_depIdxs = []int32{
20, // 0: pb.HeroInfoRsp.base:type_name -> pb.DBHero
20, // 1: pb.HeroListRsp.list:type_name -> pb.DBHero
20, // 2: pb.HeroStrengthenUplvResp.hero:type_name -> pb.DBHero
22, // 0: pb.HeroInfoRsp.base:type_name -> pb.DBHero
22, // 1: pb.HeroListRsp.list:type_name -> pb.DBHero
22, // 2: pb.HeroStrengthenUplvResp.hero:type_name -> pb.DBHero
7, // 3: pb.HeroStrengthenUpStarReq.hero:type_name -> pb.CostCardData
7, // 4: pb.HeroStrengthenUpStarReq.heroRace:type_name -> pb.CostCardData
20, // 5: pb.HeroStrengthenUpStarResp.hero:type_name -> pb.DBHero
20, // 6: pb.HeroStrengthenUpSkillResp.hero:type_name -> pb.DBHero
20, // 7: pb.HeroGongmingResp.hero:type_name -> pb.DBHero
20, // 8: pb.HeroGongmingResp.upStarCard:type_name -> pb.DBHero
20, // 9: pb.HeroGongmingResetResp.hero:type_name -> pb.DBHero
20, // 10: pb.HeroGongmingUseEnergyResp.hero:type_name -> pb.DBHero
22, // 5: pb.HeroStrengthenUpStarResp.hero:type_name -> pb.DBHero
22, // 6: pb.HeroStrengthenUpSkillResp.hero:type_name -> pb.DBHero
22, // 7: pb.HeroGongmingResp.hero:type_name -> pb.DBHero
22, // 8: pb.HeroGongmingResp.upStarCard:type_name -> pb.DBHero
22, // 9: pb.HeroGongmingResetResp.hero:type_name -> pb.DBHero
22, // 10: pb.HeroGongmingUseEnergyResp.hero:type_name -> pb.DBHero
4, // 11: pb.HeroJuexingReq.costItmes:type_name -> pb.ItemData
20, // 12: pb.HeroJuexingResp.hero:type_name -> pb.DBHero
13, // [13:13] is the sub-list for method output_type
13, // [13:13] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
22, // 12: pb.HeroJuexingResp.hero:type_name -> pb.DBHero
22, // 13: pb.HeroChoukaResp.heroes:type_name -> pb.DBHero
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
}
func init() { file_hero_hero_msg_proto_init() }
@ -1490,6 +1624,30 @@ func file_hero_hero_msg_proto_init() {
return nil
}
}
file_hero_hero_msg_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HeroChoukaReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hero_hero_msg_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HeroChoukaResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -1497,7 +1655,7 @@ func file_hero_hero_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hero_hero_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 20,
NumMessages: 22,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -23,11 +23,12 @@ enum ErrorCode {
ConfigNoFound = 104; //
// user
SecKeyInvalid = 1000; //
SecKey = 1001; //
BindUser = 1002; //
GoldNoEnough = 1003; //
SecKeyInvalid = 1000; //
SecKey = 1001; //
BindUser = 1002; //
GoldNoEnough = 1003; //
DiamondNoEnough = 1004; //
RoleCreated = 1005; //
// friend
FriendNotSelf = 1100; //
@ -54,12 +55,15 @@ enum ErrorCode {
HeroNoEnough = 1301; //
HeroMaxLv = 1302; //
HeroInitCreat = 1303; //
HeroColorErr = 1304; //
HeroSkillUpErr = 1035;//
HeroMaxResonate = 1036; //
HeroNoResonate = 1037; //
HeroNotNeedResonate = 1038; //
HeroNoEnergy = 1039; //
HeroSkillUpErr = 1305;//
HeroMaxResonate = 1306; //
HeroNoResonate = 1307; //
HeroNotNeedResonate = 1308; //
HeroNoEnergy = 1309; //
HeroColorErr = 1310; //
HeroCreate = 1311; //
// equipment
EquipmentOnFoundEquipment = 1400; //
EquipmentLvlimitReached = 1401; //

View File

@ -25,9 +25,9 @@ message ItemData {
//
message HeroStrengthenUplvReq {
string heroObjID = 1; // ID
string expCardID = 2; // ID
int32 amount = 3; // }
string heroObjID = 1; // ID
string expCardID = 2; // ID
int32 amount = 3; // }
}
//
@ -41,8 +41,8 @@ message CostCardData {
}
//
message HeroStrengthenUpStarReq {
string heroObjID = 1; // ID
repeated CostCardData hero = 2; // ID
string heroObjID = 1; // ID
repeated CostCardData hero = 2; // ID
repeated CostCardData heroRace = 3; // ID
}
@ -71,7 +71,7 @@ message HeroGongmingReq {
message HeroGongmingResp {
DBHero hero = 1; //
int32 energy = 2; //
int32 energy = 2; //
DBHero upStarCard = 3; //
}
@ -81,8 +81,8 @@ message HeroGongmingResetReq {
}
message HeroGongmingResetResp {
DBHero hero = 1; //
int32 energy = 2; //
DBHero hero = 1; //
int32 energy = 2; //
}
// 使
@ -105,4 +105,9 @@ message HeroJuexingReq {
//
message HeroJuexingResp {
DBHero hero = 1; //
}
}
//
message HeroChoukaReq {}
message HeroChoukaResp { repeated DBHero heroes = 1; }

View File

@ -1,14 +1,14 @@
syntax = "proto3";
option go_package = ".;pb";
message Cache_UserData {
message CacheUser {
string uid = 1;
string SessionId = 2;
string GatewayServiceId = 3;
// DB_UserData UserData = 4; //@go_tags(`json:",inline"`)
}
message DB_UserData {
message DBUser {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //@go_tags(`bson:"uid"`) ID
string uuid = 3; //@go_tags(`bson:"uuid"`) uuid

View File

@ -9,7 +9,7 @@ message UserLoginReq {
int32 sid = 2; //
}
message UserLoginResp { DB_UserData data = 1; }
message UserLoginResp { DBUser data = 1; }
message UserRegisterReq {
string account = 1;
@ -21,7 +21,7 @@ message UserRegisterRsp {
string account = 2;
}
message UserLoadRsp { Cache_UserData data = 1; }
message UserLoadRsp { CacheUser data = 1; }
//
message UserCreateReq {

View File

@ -20,7 +20,7 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Cache_UserData struct {
type CacheUser struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -30,8 +30,8 @@ type Cache_UserData struct {
GatewayServiceId string `protobuf:"bytes,3,opt,name=GatewayServiceId,proto3" json:",inline"` // DB_UserData UserData = 4; //
}
func (x *Cache_UserData) Reset() {
*x = Cache_UserData{}
func (x *CacheUser) Reset() {
*x = CacheUser{}
if protoimpl.UnsafeEnabled {
mi := &file_user_user_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -39,13 +39,13 @@ func (x *Cache_UserData) Reset() {
}
}
func (x *Cache_UserData) String() string {
func (x *CacheUser) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Cache_UserData) ProtoMessage() {}
func (*CacheUser) ProtoMessage() {}
func (x *Cache_UserData) ProtoReflect() protoreflect.Message {
func (x *CacheUser) ProtoReflect() protoreflect.Message {
mi := &file_user_user_db_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -57,33 +57,33 @@ func (x *Cache_UserData) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use Cache_UserData.ProtoReflect.Descriptor instead.
func (*Cache_UserData) Descriptor() ([]byte, []int) {
// Deprecated: Use CacheUser.ProtoReflect.Descriptor instead.
func (*CacheUser) Descriptor() ([]byte, []int) {
return file_user_user_db_proto_rawDescGZIP(), []int{0}
}
func (x *Cache_UserData) GetUid() string {
func (x *CacheUser) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *Cache_UserData) GetSessionId() string {
func (x *CacheUser) GetSessionId() string {
if x != nil {
return x.SessionId
}
return ""
}
func (x *Cache_UserData) GetGatewayServiceId() string {
func (x *CacheUser) GetGatewayServiceId() string {
if x != nil {
return x.GatewayServiceId
}
return ""
}
type DB_UserData struct {
type DBUser struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -104,8 +104,8 @@ type DB_UserData struct {
Exp int32 `protobuf:"varint,14,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验
}
func (x *DB_UserData) Reset() {
*x = DB_UserData{}
func (x *DBUser) Reset() {
*x = DBUser{}
if protoimpl.UnsafeEnabled {
mi := &file_user_user_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -113,13 +113,13 @@ func (x *DB_UserData) Reset() {
}
}
func (x *DB_UserData) String() string {
func (x *DBUser) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DB_UserData) ProtoMessage() {}
func (*DBUser) ProtoMessage() {}
func (x *DB_UserData) ProtoReflect() protoreflect.Message {
func (x *DBUser) ProtoReflect() protoreflect.Message {
mi := &file_user_user_db_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -131,103 +131,103 @@ func (x *DB_UserData) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use DB_UserData.ProtoReflect.Descriptor instead.
func (*DB_UserData) Descriptor() ([]byte, []int) {
// Deprecated: Use DBUser.ProtoReflect.Descriptor instead.
func (*DBUser) Descriptor() ([]byte, []int) {
return file_user_user_db_proto_rawDescGZIP(), []int{1}
}
func (x *DB_UserData) GetId() string {
func (x *DBUser) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DB_UserData) GetUid() string {
func (x *DBUser) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DB_UserData) GetUuid() string {
func (x *DBUser) GetUuid() string {
if x != nil {
return x.Uuid
}
return ""
}
func (x *DB_UserData) GetBinduid() string {
func (x *DBUser) GetBinduid() string {
if x != nil {
return x.Binduid
}
return ""
}
func (x *DB_UserData) GetName() string {
func (x *DBUser) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *DB_UserData) GetSid() int32 {
func (x *DBUser) GetSid() int32 {
if x != nil {
return x.Sid
}
return 0
}
func (x *DB_UserData) GetCreateip() string {
func (x *DBUser) GetCreateip() string {
if x != nil {
return x.Createip
}
return ""
}
func (x *DB_UserData) GetLastloginip() string {
func (x *DBUser) GetLastloginip() string {
if x != nil {
return x.Lastloginip
}
return ""
}
func (x *DB_UserData) GetCtime() int64 {
func (x *DBUser) GetCtime() int64 {
if x != nil {
return x.Ctime
}
return 0
}
func (x *DB_UserData) GetLogintime() int64 {
func (x *DBUser) GetLogintime() int64 {
if x != nil {
return x.Logintime
}
return 0
}
func (x *DB_UserData) GetFriendPoint() int32 {
func (x *DBUser) GetFriendPoint() int32 {
if x != nil {
return x.FriendPoint
}
return 0
}
func (x *DB_UserData) GetAvatar() int32 {
func (x *DBUser) GetAvatar() int32 {
if x != nil {
return x.Avatar
}
return 0
}
func (x *DB_UserData) GetGold() int32 {
func (x *DBUser) GetGold() int32 {
if x != nil {
return x.Gold
}
return 0
}
func (x *DB_UserData) GetExp() int32 {
func (x *DBUser) GetExp() int32 {
if x != nil {
return x.Exp
}
@ -238,36 +238,35 @@ var File_user_user_db_proto protoreflect.FileDescriptor
var file_user_user_db_proto_rawDesc = []byte{
0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x62, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x0e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x55, 0x73,
0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x65, 0x73, 0x73,
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x65, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61,
0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x49, 0x64, 0x22, 0xd5, 0x02, 0x0a, 0x0b, 0x44, 0x42, 0x5f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61,
0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x6e, 0x64,
0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x69, 0x6e, 0x64, 0x75,
0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x65, 0x61,
0x74, 0x65, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x72, 0x65, 0x61,
0x74, 0x65, 0x69, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x6c, 0x6f, 0x67, 0x69,
0x6e, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x6c,
0x6f, 0x67, 0x69, 0x6e, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09,
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52,
0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72,
0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06,
0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x76,
0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x0d, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18,
0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x67, 0x0a, 0x09, 0x43, 0x61, 0x63, 0x68, 0x65, 0x55, 0x73, 0x65,
0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49,
0x64, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x74,
0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0xd0, 0x02,
0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75,
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18,
0x0a, 0x07, 0x62, 0x69, 0x6e, 0x64, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x62, 0x69, 0x6e, 0x64, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03,
0x73, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x1a,
0x0a, 0x08, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x69, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61,
0x73, 0x74, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x6c, 0x61, 0x73, 0x74, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05,
0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69,
0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x65,
0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18,
0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69,
0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0c, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f,
0x6c, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10,
0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -284,8 +283,8 @@ func file_user_user_db_proto_rawDescGZIP() []byte {
var file_user_user_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_user_user_db_proto_goTypes = []interface{}{
(*Cache_UserData)(nil), // 0: Cache_UserData
(*DB_UserData)(nil), // 1: DB_UserData
(*CacheUser)(nil), // 0: CacheUser
(*DBUser)(nil), // 1: DBUser
}
var file_user_user_db_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
@ -302,7 +301,7 @@ func file_user_user_db_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_user_user_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Cache_UserData); i {
switch v := v.(*CacheUser); i {
case 0:
return &v.state
case 1:
@ -314,7 +313,7 @@ func file_user_user_db_proto_init() {
}
}
file_user_user_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DB_UserData); i {
switch v := v.(*DBUser); i {
case 0:
return &v.state
case 1:

View File

@ -81,7 +81,7 @@ type UserLoginResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DB_UserData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
Data *DBUser `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *UserLoginResp) Reset() {
@ -116,7 +116,7 @@ func (*UserLoginResp) Descriptor() ([]byte, []int) {
return file_user_user_msg_proto_rawDescGZIP(), []int{1}
}
func (x *UserLoginResp) GetData() *DB_UserData {
func (x *UserLoginResp) GetData() *DBUser {
if x != nil {
return x.Data
}
@ -238,7 +238,7 @@ type UserLoadRsp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *Cache_UserData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
Data *CacheUser `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *UserLoadRsp) Reset() {
@ -273,7 +273,7 @@ func (*UserLoadRsp) Descriptor() ([]byte, []int) {
return file_user_user_msg_proto_rawDescGZIP(), []int{4}
}
func (x *UserLoadRsp) GetData() *Cache_UserData {
func (x *UserLoadRsp) GetData() *CacheUser {
if x != nil {
return x.Data
}
@ -376,27 +376,26 @@ var file_user_user_msg_proto_rawDesc = []byte{
0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f,
0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x5f, 0x55, 0x73, 0x65, 0x72, 0x44,
0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x0f, 0x55, 0x73, 0x65,
0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07,
0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x43,
0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f,
0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x32, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x61,
0x64, 0x52, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x55, 0x73, 0x65, 0x72, 0x44,
0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x0d, 0x55, 0x73, 0x65,
0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69,
0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69,
0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x2c, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f,
0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04,
0x64, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x73, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73,
0x74, 0x65, 0x72, 0x52, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,
0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x22, 0x2d, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x73, 0x70, 0x12,
0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x43, 0x61, 0x63, 0x68, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
0x2b, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d,
0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x73, 0x70, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -420,14 +419,14 @@ var file_user_user_msg_proto_goTypes = []interface{}{
(*UserLoadRsp)(nil), // 4: UserLoadRsp
(*UserCreateReq)(nil), // 5: UserCreateReq
(*UserCreateRsp)(nil), // 6: UserCreateRsp
(*DB_UserData)(nil), // 7: DB_UserData
(*DBUser)(nil), // 7: DBUser
(ErrorCode)(0), // 8: ErrorCode
(*Cache_UserData)(nil), // 9: Cache_UserData
(*CacheUser)(nil), // 9: CacheUser
}
var file_user_user_msg_proto_depIdxs = []int32{
7, // 0: UserLoginResp.data:type_name -> DB_UserData
7, // 0: UserLoginResp.data:type_name -> DBUser
8, // 1: UserRegisterRsp.Code:type_name -> ErrorCode
9, // 2: UserLoadRsp.data:type_name -> Cache_UserData
9, // 2: UserLoadRsp.data:type_name -> CacheUser
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name

View File

@ -12,6 +12,7 @@ package cfg
type JsonLoader func(string) ([]map[string]interface{}, error)
type Tables struct {
global *Game_global
hero *Game_hero
ui *Game_ui
skill *Game_skill
@ -26,12 +27,14 @@ type Tables struct {
heroStargrow *Game_heroStargrow
heroLevelgrow *Game_heroLevelgrow
heroStarup *Game_heroStarup
heroExp *Game_heroExp
heroLevelup *Game_heroLevelup
equip *Game_equip
equipAttrlibrary *Game_equipAttrlibrary
equipSuit *Game_equipSuit
equipIntensify *Game_equipIntensify
item *Game_item
heroSkillLevel *Game_heroSkillLevel
}
func NewTables(loader JsonLoader) (*Tables, error) {
@ -39,6 +42,12 @@ func NewTables(loader JsonLoader) (*Tables, error) {
var buf []map[string]interface{}
tables := &Tables{}
if buf, err = loader("game_global") ; err != nil {
return nil, err
}
if tables.global, err = NewGame_global(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_hero") ; err != nil {
return nil, err
}
@ -123,6 +132,12 @@ func NewTables(loader JsonLoader) (*Tables, error) {
if tables.heroStarup, err = NewGame_heroStarup(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_heroexp") ; err != nil {
return nil, err
}
if tables.heroExp, err = NewGame_heroExp(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_herolevelup") ; err != nil {
return nil, err
}
@ -159,5 +174,11 @@ func NewTables(loader JsonLoader) (*Tables, error) {
if tables.item, err = NewGame_item(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_heroskilllevel") ; err != nil {
return nil, err
}
if tables.heroSkillLevel, err = NewGame_heroSkillLevel(buf) ; err != nil {
return nil, err
}
return tables, nil
}

View File

@ -1,3 +1,4 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -10,39 +11,19 @@ package cfg
import "errors"
type Game_atn struct {
A string //资源类型
T string //资源名称
N int32 //数量
A string
T string
N int32
}
func (Game_atn) GetTypeId() int {
return -1770297697
return -1770297697
}
func NewGame_atn(_buf map[string]interface{}) (_v *Game_atn, err error) {
_v = &Game_atn{}
{
var _ok_ bool
if _v.A, _ok_ = _buf["a"].(string); !_ok_ {
err = errors.New("a error")
return
}
}
{
var _ok_ bool
if _v.T, _ok_ = _buf["t"].(string); !_ok_ {
err = errors.New("t error")
return
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["n"].(float64); !_ok_ {
err = errors.New("n error")
return
}
_v.N = int32(_tempNum_)
}
return
_v = &Game_atn{}
{ var _ok_ bool; if _v.A, _ok_ = _buf["a"].(string); !_ok_ { err = errors.New("a error"); return } }
{ var _ok_ bool; if _v.T, _ok_ = _buf["t"].(string); !_ok_ { err = errors.New("t error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["n"].(float64); !_ok_ { err = errors.New("n error"); return }; _v.N = int32(_tempNum_) }
return
}

View File

@ -1,3 +1,4 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -10,87 +11,38 @@ package cfg
import "errors"
type Game_equipAttrlibraryData struct {
Key int32
Libraryid int32
Attrkey string
Attrvar int32
Probability int32
Addition []int32
Key int32
Libraryid int32
Attrkey string
Attrvar int32
Probability int32
Addition []int32
}
func (Game_equipAttrlibraryData) GetTypeId() int {
return -437457248
return -437457248
}
func NewGame_equipAttrlibraryData(_buf map[string]interface{}) (_v *Game_equipAttrlibraryData, err error) {
_v = &Game_equipAttrlibraryData{}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ {
err = errors.New("key error")
return
}
_v.Key = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["libraryid"].(float64); !_ok_ {
err = errors.New("libraryid error")
return
}
_v.Libraryid = int32(_tempNum_)
}
{
var _ok_ bool
if _v.Attrkey, _ok_ = _buf["attrkey"].(string); !_ok_ {
err = errors.New("attrkey error")
return
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["attrvar"].(float64); !_ok_ {
err = errors.New("attrvar error")
return
}
_v.Attrvar = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["probability"].(float64); !_ok_ {
err = errors.New("probability error")
return
}
_v.Probability = int32(_tempNum_)
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["Addition"].([]interface{}); !_ok_ {
err = errors.New("Addition error")
return
}
_v = &Game_equipAttrlibraryData{}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["libraryid"].(float64); !_ok_ { err = errors.New("libraryid error"); return }; _v.Libraryid = int32(_tempNum_) }
{ var _ok_ bool; if _v.Attrkey, _ok_ = _buf["attrkey"].(string); !_ok_ { err = errors.New("attrkey error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["attrvar"].(float64); !_ok_ { err = errors.New("attrvar error"); return }; _v.Attrvar = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["probability"].(float64); !_ok_ { err = errors.New("probability error"); return }; _v.Probability = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["Addition"].([]interface{}); !_ok_ { err = errors.New("Addition error"); return }
_v.Addition = make([]int32, 0, len(_arr_))
_v.Addition = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Addition = append(_v.Addition, _list_v_)
}
}
for _, _e_ := range _arr_ {
var _list_v_ int32
{
var _ok_ bool
var _x_ float64
if _x_, _ok_ = _e_.(float64); !_ok_ {
err = errors.New("_list_v_ error")
return
}
_list_v_ = int32(_x_)
}
_v.Addition = append(_v.Addition, _list_v_)
}
}
return
return
}

View File

@ -1,3 +1,4 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -10,133 +11,57 @@ package cfg
import "errors"
type Game_equipData struct {
Id int32
Suittype int32
Suitintr string
Pos int32
Star int32
Leadlibrary int32
Addattrnum []int32
Addattrnump []int32
Addlibrary int32
Id int32
Suittype int32
Suitintr string
Pos int32
Star int32
Leadlibrary int32
Addattrnum []int32
Addattrnump []int32
Addlibrary int32
}
func (Game_equipData) GetTypeId() int {
return 1778846974
return 1778846974
}
func NewGame_equipData(_buf map[string]interface{}) (_v *Game_equipData, err error) {
_v = &Game_equipData{}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ {
err = errors.New("id error")
return
}
_v.Id = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["suittype"].(float64); !_ok_ {
err = errors.New("suittype error")
return
}
_v.Suittype = int32(_tempNum_)
}
{
var _ok_ bool
if _v.Suitintr, _ok_ = _buf["suitintr"].(string); !_ok_ {
err = errors.New("suitintr error")
return
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["pos"].(float64); !_ok_ {
err = errors.New("pos error")
return
}
_v.Pos = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ {
err = errors.New("star error")
return
}
_v.Star = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["leadlibrary"].(float64); !_ok_ {
err = errors.New("leadlibrary error")
return
}
_v.Leadlibrary = int32(_tempNum_)
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["addattrnum"].([]interface{}); !_ok_ {
err = errors.New("addattrnum error")
return
}
_v = &Game_equipData{}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["suittype"].(float64); !_ok_ { err = errors.New("suittype error"); return }; _v.Suittype = int32(_tempNum_) }
{ var _ok_ bool; if _v.Suitintr, _ok_ = _buf["suitintr"].(string); !_ok_ { err = errors.New("suitintr error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pos"].(float64); !_ok_ { err = errors.New("pos error"); return }; _v.Pos = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["leadlibrary"].(float64); !_ok_ { err = errors.New("leadlibrary error"); return }; _v.Leadlibrary = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["addattrnum"].([]interface{}); !_ok_ { err = errors.New("addattrnum error"); return }
_v.Addattrnum = make([]int32, 0, len(_arr_))
_v.Addattrnum = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Addattrnum = append(_v.Addattrnum, _list_v_)
}
}
for _, _e_ := range _arr_ {
var _list_v_ int32
{
var _ok_ bool
var _x_ float64
if _x_, _ok_ = _e_.(float64); !_ok_ {
err = errors.New("_list_v_ error")
return
}
_list_v_ = int32(_x_)
}
_v.Addattrnum = append(_v.Addattrnum, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["addattrnump"].([]interface{}); !_ok_ { err = errors.New("addattrnump error"); return }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["addattrnump"].([]interface{}); !_ok_ {
err = errors.New("addattrnump error")
return
}
_v.Addattrnump = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Addattrnump = append(_v.Addattrnump, _list_v_)
}
}
_v.Addattrnump = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{
var _ok_ bool
var _x_ float64
if _x_, _ok_ = _e_.(float64); !_ok_ {
err = errors.New("_list_v_ error")
return
}
_list_v_ = int32(_x_)
}
_v.Addattrnump = append(_v.Addattrnump, _list_v_)
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["addlibrary"].(float64); !_ok_ {
err = errors.New("addlibrary error")
return
}
_v.Addlibrary = int32(_tempNum_)
}
return
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["addlibrary"].(float64); !_ok_ { err = errors.New("addlibrary error"); return }; _v.Addlibrary = int32(_tempNum_) }
return
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type Game_global struct {
_dataMap map[string]*Game_globalData
_dataList []*Game_globalData
}
func NewGame_global(_buf []map[string]interface{}) (*Game_global, error) {
_dataList := make([]*Game_globalData, 0, len(_buf))
dataMap := make(map[string]*Game_globalData)
for _, _ele_ := range _buf {
if _v, err2 := NewGame_globalData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Index] = _v
}
}
return &Game_global{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *Game_global) GetDataMap() map[string]*Game_globalData {
return table._dataMap
}
func (table *Game_global) GetDataList() []*Game_globalData {
return table._dataList
}
func (table *Game_global) Get(key string) *Game_globalData {
return table._dataMap[key]
}

View File

@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type Game_globalData struct {
Index string
Var string
Intr string
}
func (Game_globalData) GetTypeId() int {
return -518904471
}
func NewGame_globalData(_buf map[string]interface{}) (_v *Game_globalData, err error) {
_v = &Game_globalData{}
{ var _ok_ bool; if _v.Index, _ok_ = _buf["index"].(string); !_ok_ { err = errors.New("index error"); return } }
{ var _ok_ bool; if _v.Var, _ok_ = _buf["var"].(string); !_ok_ { err = errors.New("var error"); return } }
{ var _ok_ bool; if _v.Intr, _ok_ = _buf["intr"].(string); !_ok_ { err = errors.New("intr error"); return } }
return
}

View File

@ -31,6 +31,7 @@ type Game_heroData struct {
Skill1 int32
Skill2 int32
Skill3 int32
Enteranivalue int32
}
func (Game_heroData) GetTypeId() int {
@ -91,5 +92,6 @@ func NewGame_heroData(_buf map[string]interface{}) (_v *Game_heroData, err error
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill1"].(float64); !_ok_ { err = errors.New("skill1 error"); return }; _v.Skill1 = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill2"].(float64); !_ok_ { err = errors.New("skill2 error"); return }; _v.Skill2 = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill3"].(float64); !_ok_ { err = errors.New("skill3 error"); return }; _v.Skill3 = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["enteranivalue"].(float64); !_ok_ { err = errors.New("enteranivalue error"); return }; _v.Enteranivalue = int32(_tempNum_) }
return
}