From 4e1db72bce7281efebfa049198a629ba6a13b288 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 25 Jul 2022 16:35:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9gm=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=B8=BAweb=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 +- modules/{gm => web}/api.go | 6 ++--- modules/{gm => web}/api_createnotify.go | 2 +- modules/{gm => web}/api_register.go | 2 +- modules/{gm => web}/config.go | 2 +- modules/{gm => web}/core.go | 2 +- modules/{gm => web}/modelNotify.go | 6 ++--- modules/{gm => web}/modelUser.go | 6 ++--- modules/{gm => web}/module.go | 30 ++++++++++++------------- modules/{gm => web}/options.go | 2 +- services/mainte/main.go | 4 ++-- 11 files changed, 32 insertions(+), 32 deletions(-) rename modules/{gm => web}/api.go (94%) rename modules/{gm => web}/api_createnotify.go (99%) rename modules/{gm => web}/api_register.go (98%) rename modules/{gm => web}/config.go (98%) rename modules/{gm => web}/core.go (93%) rename modules/{gm => web}/modelNotify.go (94%) rename modules/{gm => web}/modelUser.go (93%) rename modules/{gm => web}/module.go (70%) rename modules/{gm => web}/options.go (97%) diff --git a/comm/const.go b/comm/const.go index 9c3871b12..f1240d41a 100644 --- a/comm/const.go +++ b/comm/const.go @@ -29,7 +29,7 @@ const ( //模块名定义处 const ( ModuleGate core.M_Modules = "gateway" //gate模块 网关服务模块 - ModuleGM core.M_Modules = "gm" //gm模块 + ModuleWeb core.M_Modules = "web" //gm模块 ModuleUser core.M_Modules = "user" //用户模块 ModulePack core.M_Modules = "pack" //背包模块 ModuleMail core.M_Modules = "mail" //邮件模块 diff --git a/modules/gm/api.go b/modules/web/api.go similarity index 94% rename from modules/gm/api.go rename to modules/web/api.go index 2ec464dd4..e3ba489f9 100644 --- a/modules/gm/api.go +++ b/modules/web/api.go @@ -1,4 +1,4 @@ -package gm +package web import ( "go_dreamfactory/lego/core" @@ -15,7 +15,7 @@ import ( type Api_Comp struct { cbase.ModuleCompBase options *Options //模块参数 - module *GM //当前模块对象 + module *Web //当前模块对象 gin gin.ISys //gin 框架 web的热门框架 } @@ -23,7 +23,7 @@ type Api_Comp struct { func (this *Api_Comp) 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.(*GM) + this.module = module.(*Web) this.gin, err = gin.NewSys(gin.SetListenPort(this.options.Port)) this.suitableMethods() //发射注册api return diff --git a/modules/gm/api_createnotify.go b/modules/web/api_createnotify.go similarity index 99% rename from modules/gm/api_createnotify.go rename to modules/web/api_createnotify.go index c4045b4e6..5bbc6a497 100644 --- a/modules/gm/api_createnotify.go +++ b/modules/web/api_createnotify.go @@ -1,4 +1,4 @@ -package gm +package web import ( "go_dreamfactory/lego/sys/gin" diff --git a/modules/gm/api_register.go b/modules/web/api_register.go similarity index 98% rename from modules/gm/api_register.go rename to modules/web/api_register.go index 85641b0fa..25a97ff6e 100644 --- a/modules/gm/api_register.go +++ b/modules/web/api_register.go @@ -1,4 +1,4 @@ -package gm +package web import ( "go_dreamfactory/lego/sys/gin/engine" diff --git a/modules/gm/config.go b/modules/web/config.go similarity index 98% rename from modules/gm/config.go rename to modules/web/config.go index a3dff571f..b714579a9 100644 --- a/modules/gm/config.go +++ b/modules/web/config.go @@ -1,4 +1,4 @@ -package gm +package web import ( "fmt" diff --git a/modules/gm/core.go b/modules/web/core.go similarity index 93% rename from modules/gm/core.go rename to modules/web/core.go index 27fdba7a7..f4eb91b6b 100644 --- a/modules/gm/core.go +++ b/modules/web/core.go @@ -1,4 +1,4 @@ -package gm +package web import "go_dreamfactory/pb" diff --git a/modules/gm/modelNotify.go b/modules/web/modelNotify.go similarity index 94% rename from modules/gm/modelNotify.go rename to modules/web/modelNotify.go index 448fe119e..f9fd5b6d3 100644 --- a/modules/gm/modelNotify.go +++ b/modules/web/modelNotify.go @@ -1,4 +1,4 @@ -package gm +package web import ( "go_dreamfactory/lego/core" @@ -12,12 +12,12 @@ import ( //公告数据模块 type modelNotifyComp struct { modules.MCompModel - module *GM + module *Web } func (this *modelNotifyComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) { this.MCompModel.Init(service, module, comp, opt) - this.module = module.(*GM) + this.module = module.(*Web) this.TableName = "notify" return } diff --git a/modules/gm/modelUser.go b/modules/web/modelUser.go similarity index 93% rename from modules/gm/modelUser.go rename to modules/web/modelUser.go index cb39401af..8e7fe4f56 100644 --- a/modules/gm/modelUser.go +++ b/modules/web/modelUser.go @@ -1,4 +1,4 @@ -package gm +package web import ( "fmt" @@ -14,12 +14,12 @@ import ( //用户数据模块 type modelUserComp struct { modules.MCompModel - module *GM + module *Web } func (this *modelUserComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) { this.MCompModel.Init(service, module, comp, opt) - this.module = module.(*GM) + this.module = module.(*Web) this.TableName = "user" return } diff --git a/modules/gm/module.go b/modules/web/module.go similarity index 70% rename from modules/gm/module.go rename to modules/web/module.go index 85c1329c9..3a8715420 100644 --- a/modules/gm/module.go +++ b/modules/web/module.go @@ -1,4 +1,4 @@ -package gm +package web import ( "fmt" @@ -9,16 +9,16 @@ import ( ) /* -模块名:gm +模块名:web 描述:提供管理员相关的http接口 开发:李伟 */ func NewModule() core.IModule { - m := new(GM) + m := new(Web) return m } -type GM struct { +type Web struct { cbase.ModuleBase options *Options api_comp *Api_Comp //提供weba pi服务的组件 @@ -28,22 +28,22 @@ type GM struct { } //模块名 -func (this *GM) GetType() core.M_Modules { - return comm.ModuleGM +func (this *Web) GetType() core.M_Modules { + return comm.ModuleWeb } //模块自定义参数 -func (this *GM) NewOptions() (options core.IModuleOptions) { +func (this *Web) NewOptions() (options core.IModuleOptions) { return new(Options) } -func (this *GM) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { +func (this *Web) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.options = options.(*Options) return } -func (this *GM) OnInstallComp() { +func (this *Web) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp) this.modelUser = this.RegisterComp(new(modelUserComp)).(*modelUserComp) @@ -52,32 +52,32 @@ func (this *GM) OnInstallComp() { } //日志 -func (this *GM) Debugf(format string, a ...interface{}) { +func (this *Web) Debugf(format string, a ...interface{}) { if this.options.GetDebug() { this.options.GetLog().Debugf(fmt.Sprintf("[Module:%s] ", this.GetType())+format, a...) } } -func (this *GM) Infof(format string, a ...interface{}) { +func (this *Web) Infof(format string, a ...interface{}) { if this.options.GetDebug() { this.options.GetLog().Infof(fmt.Sprintf("[Module:%s] ", this.GetType())+format, a...) } } -func (this *GM) Warnf(format string, a ...interface{}) { +func (this *Web) Warnf(format string, a ...interface{}) { if this.options.Debug { this.options.GetLog().Warnf(fmt.Sprintf("[Module:%s] ", this.GetType())+format, a...) } } -func (this *GM) Errorf(format string, a ...interface{}) { +func (this *Web) Errorf(format string, a ...interface{}) { if this.options.GetLog() != nil { this.options.GetLog().Errorf(fmt.Sprintf("[Module:%s] ", this.GetType())+format, a...) } } -func (this *GM) Panicf(format string, a ...interface{}) { +func (this *Web) Panicf(format string, a ...interface{}) { if this.options.GetLog() != nil { this.options.GetLog().Panicf(fmt.Sprintf("[Module:%s] ", this.GetType())+format, a...) } } -func (this *GM) Fatalf(format string, a ...interface{}) { +func (this *Web) Fatalf(format string, a ...interface{}) { if this.options.GetLog() != nil { this.options.GetLog().Fatalf(fmt.Sprintf("[Module:%s] ", this.GetType())+format, a...) } diff --git a/modules/gm/options.go b/modules/web/options.go similarity index 97% rename from modules/gm/options.go rename to modules/web/options.go index 014d10431..37c740d7a 100644 --- a/modules/gm/options.go +++ b/modules/web/options.go @@ -1,4 +1,4 @@ -package gm +package web import ( "go_dreamfactory/lego/utils/mapstructure" diff --git a/services/mainte/main.go b/services/mainte/main.go index 9a1d6db47..a8e20035c 100644 --- a/services/mainte/main.go +++ b/services/mainte/main.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "go_dreamfactory/modules/gm" "go_dreamfactory/modules/mgolog" + "go_dreamfactory/modules/web" "go_dreamfactory/services" "go_dreamfactory/sys/cache" "go_dreamfactory/sys/db" @@ -35,7 +35,7 @@ func main() { ) lego.Run(s, //运行模块 mgolog.NewModule(), - gm.NewModule(), + web.NewModule(), ) } From 65dc3ece12a18a4dde01e9082a0235f9ba09c019 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 25 Jul 2022 16:40:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0gm=20=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 3 +- modules/gm/api.go | 29 ++++++++++++++ modules/gm/module.go | 39 ++++++++++++++++++ modules/gm/module_test.go | 83 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 modules/gm/api.go create mode 100644 modules/gm/module.go create mode 100644 modules/gm/module_test.go diff --git a/comm/const.go b/comm/const.go index f1240d41a..c03a585a5 100644 --- a/comm/const.go +++ b/comm/const.go @@ -29,7 +29,7 @@ const ( //模块名定义处 const ( ModuleGate core.M_Modules = "gateway" //gate模块 网关服务模块 - ModuleWeb core.M_Modules = "web" //gm模块 + ModuleWeb core.M_Modules = "web" //后台模块 ModuleUser core.M_Modules = "user" //用户模块 ModulePack core.M_Modules = "pack" //背包模块 ModuleMail core.M_Modules = "mail" //邮件模块 @@ -44,6 +44,7 @@ const ( ModuleMainline core.M_Modules = "mainline" //主线模块 ModuleNotify core.M_Modules = "notify" //公告模块 ModuleChat core.M_Modules = "chat" //装备模块 + ModuleGM core.M_Modules = "gm" //gm模块 ) //RPC服务接口定义处 diff --git a/modules/gm/api.go b/modules/gm/api.go new file mode 100644 index 000000000..45c6f1a3d --- /dev/null +++ b/modules/gm/api.go @@ -0,0 +1,29 @@ +package gm + +import ( + "go_dreamfactory/modules" + + "go_dreamfactory/lego/core" +) + +/* +装备模块 API +*/ +type apiComp struct { + modules.MCompGate + service core.IService + module *GM +} + +//组件初始化接口 +func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.MCompGate.Init(service, module, comp, options) + this.module = module.(*GM) + this.service = service + return +} + +func (this *apiComp) Start() (err error) { + err = this.MCompGate.Start() + return +} diff --git a/modules/gm/module.go b/modules/gm/module.go new file mode 100644 index 000000000..fd6b30130 --- /dev/null +++ b/modules/gm/module.go @@ -0,0 +1,39 @@ +package gm + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +/* +模块名:GM工具模块 +描述:处理客户端发过来的gm命令 +开发:李伟 +*/ +func NewModule() core.IModule { + m := new(GM) + return m +} + +type GM struct { + modules.ModuleBase + api_comp *apiComp +} + +//模块名 +func (this *GM) GetType() core.M_Modules { + return comm.ModuleGM +} + +//模块初始化接口 注册用户创建角色事件 +func (this *GM) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { + err = this.ModuleBase.Init(service, module, options) + return +} + +//装备组件 +func (this *GM) OnInstallComp() { + this.ModuleBase.OnInstallComp() + this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) +} diff --git a/modules/gm/module_test.go b/modules/gm/module_test.go new file mode 100644 index 000000000..b88548d2d --- /dev/null +++ b/modules/gm/module_test.go @@ -0,0 +1,83 @@ +package gm_test + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/lego" + "go_dreamfactory/lego/base/rpcx" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/modules/equipment" + "go_dreamfactory/modules/gm" + "go_dreamfactory/modules/hero" + "go_dreamfactory/modules/items" + "go_dreamfactory/modules/user" + "go_dreamfactory/services" + "go_dreamfactory/sys/cache" + "go_dreamfactory/sys/configure" + "go_dreamfactory/sys/db" + "os" + "testing" + "time" +) + +func newService(ops ...rpcx.Option) core.IService { + s := new(TestService) + s.Configure(ops...) + return s +} + +//梦工厂基础服务对象 +type TestService struct { + rpcx.RPCXService +} + +//初始化相关系统 +func (this *TestService) InitSys() { + this.RPCXService.InitSys() + if err := cache.OnInit(this.GetSettings().Sys["cache"]); err != nil { + panic(fmt.Sprintf("init sys.cache err: %s", err.Error())) + } else { + log.Infof("init sys.cache success!") + } + if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil { + panic(fmt.Sprintf("init sys.db err: %s", err.Error())) + } else { + log.Infof("init sys.db success!") + } + if err := configure.OnInit(this.GetSettings().Sys["configure"]); err != nil { + panic(fmt.Sprintf("init sys.configure err: %s", err.Error())) + } else { + log.Infof("init sys.configure success!") + } +} + +var service core.IService +var s_gateComp comm.ISC_GateRouteComp = services.NewGateRouteComp() +var module = new(gm.GM) + +//测试环境下初始化db和cache 系统 +func TestMain(m *testing.M) { + service = newService( + rpcx.SetConfPath("../../bin/conf/worker_1.yaml"), + rpcx.SetVersion("1.0.0.0"), + ) + service.OnInstallComp( //装备组件 + s_gateComp, //此服务需要接受用户的消息 需要装备网关组件 + ) + go func() { + lego.Run(service, //运行模块 + module, + hero.NewModule(), + user.NewModule(), + items.NewModule(), + equipment.NewModule(), + ) + }() + time.Sleep(time.Second * 3) + defer os.Exit(m.Run()) +} + +func Test_Module(t *testing.T) { + +} From a09167d66aa446f0089f0a46eabae8ca3712a49e Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 26 Jul 2022 10:19:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=BB=E9=99=A4proto=EF=BC=8C=E9=87=87?= =?UTF-8?q?=E7=94=A8svn=20=E7=9A=84proto=20=E6=BA=90=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pb/proto/chat/chat_db.proto | 25 ---- pb/proto/chat/chat_msg.proto | 70 ----------- pb/proto/comm.proto | 96 --------------- pb/proto/equipment/equipment_db.proto | 25 ---- pb/proto/equipment/equipment_msg.proto | 39 ------ pb/proto/errorcode.proto | 109 ----------------- pb/proto/forum/forum_db.proto | 3 - pb/proto/forum/forum_msg.proto | 2 - pb/proto/friend/friend_db.proto | 9 -- pb/proto/friend/friend_msg.proto | 108 ----------------- pb/proto/google/protobuf/any.proto | 158 ------------------------- pb/proto/hero/hero_db.proto | 33 ------ pb/proto/hero/hero_msg.proto | 155 ------------------------ pb/proto/items/items_db.proto | 15 --- pb/proto/items/items_msg.proto | 45 ------- pb/proto/mail/mail_db.proto | 15 --- pb/proto/mail/mail_msg.proto | 44 ------- pb/proto/mainline/mainline_db.proto | 11 -- pb/proto/mainline/mainline_msg.proto | 36 ------ pb/proto/notify/notify_db.proto | 12 -- pb/proto/notify/notify_msg.proto | 25 ---- pb/proto/shop/shop_db.proto | 35 ------ pb/proto/shop/shop_msg.proto | 36 ------ pb/proto/task/task_db.proto | 22 ---- pb/proto/task/task_msg.proto | 51 -------- pb/proto/user/user_db.proto | 49 -------- pb/proto/user/user_msg.proto | 102 ---------------- pb/proto/userexpand.proto | 14 --- pb/proto/userrecord.proto | 21 ---- 29 files changed, 1365 deletions(-) delete mode 100644 pb/proto/chat/chat_db.proto delete mode 100644 pb/proto/chat/chat_msg.proto delete mode 100644 pb/proto/comm.proto delete mode 100644 pb/proto/equipment/equipment_db.proto delete mode 100644 pb/proto/equipment/equipment_msg.proto delete mode 100644 pb/proto/errorcode.proto delete mode 100644 pb/proto/forum/forum_db.proto delete mode 100644 pb/proto/forum/forum_msg.proto delete mode 100644 pb/proto/friend/friend_db.proto delete mode 100644 pb/proto/friend/friend_msg.proto delete mode 100644 pb/proto/google/protobuf/any.proto delete mode 100644 pb/proto/hero/hero_db.proto delete mode 100644 pb/proto/hero/hero_msg.proto delete mode 100644 pb/proto/items/items_db.proto delete mode 100644 pb/proto/items/items_msg.proto delete mode 100644 pb/proto/mail/mail_db.proto delete mode 100644 pb/proto/mail/mail_msg.proto delete mode 100644 pb/proto/mainline/mainline_db.proto delete mode 100644 pb/proto/mainline/mainline_msg.proto delete mode 100644 pb/proto/notify/notify_db.proto delete mode 100644 pb/proto/notify/notify_msg.proto delete mode 100644 pb/proto/shop/shop_db.proto delete mode 100644 pb/proto/shop/shop_msg.proto delete mode 100644 pb/proto/task/task_db.proto delete mode 100644 pb/proto/task/task_msg.proto delete mode 100644 pb/proto/user/user_db.proto delete mode 100644 pb/proto/user/user_msg.proto delete mode 100644 pb/proto/userexpand.proto delete mode 100644 pb/proto/userrecord.proto diff --git a/pb/proto/chat/chat_db.proto b/pb/proto/chat/chat_db.proto deleted file mode 100644 index 758cbc2d3..000000000 --- a/pb/proto/chat/chat_db.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -enum ChatChannel { - World = 0; //世界频道 - Union = 1; //工会频道 - Private = 2; //私有频道 - CrossServer = 3; //跨服频道 - System = 4; //系统频道 -} - - -message DBChat { - string id =1; //主键id - ChatChannel channel = 2; //频道 - string suid =3; //发送用户id - string ruid = 4; //接收用户id channel == Private 有效 - int32 groud = 5; //跨服频道 分组id - int32 areaId = 6; //跨服频道 频道Id - string unionId = 7; //工会id - int32 headid = 8; //用户头像 - string uname = 9; //用户名 - string content = 10; //内容 - int64 ctime = 11; //创建时间 -} \ No newline at end of file diff --git a/pb/proto/chat/chat_msg.proto b/pb/proto/chat/chat_msg.proto deleted file mode 100644 index ccdd431c9..000000000 --- a/pb/proto/chat/chat_msg.proto +++ /dev/null @@ -1,70 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "chat/chat_db.proto"; - -//聊天消息推送 -message ChatMessagePush{ - DBChat chat = 1; -} - -//申请跨服频道号 -message ChatCrossChannelReq { - -} -//申请跨服频道号 回应 -message ChatCrossChannelResp { - int32 channelId = 1; -} - -//申请切换频道 -message ChatChanageChannelReq { - int32 channelId = 1; -} -//申请切换频道 回应 -message ChatChanageChannelResp { - int32 channelId = 1; - bool isSucc = 2; -} - -//请求聊天消息 -message ChatGetListReq { - ChatChannel channel = 1; //频道 -} -//请求聊天消息 回应 -message ChatGetListResp { - repeated DBChat chats = 1; -} - - -//请求跨服聊天消息 -message ChatSpanGetListReq { - ChatChannel channel = 1; //频道 - int32 channelId = 2; //跨服频道id -} -//请求跨服聊天消息 回应 -message ChatSpanGetListResp { - repeated DBChat chats = 1; -} - -//消息发送请求 -message ChatSendReq { - ChatChannel channel = 1; //频道 - string targetId = 2; //目标用户id - string content = 3; //内容 -} -//消息发送请求 回应 -message ChatSendResp { - -} - - -//跨服消息发送请求 -message ChatSpanSendReq { - ChatChannel channel = 1; //频道 - string content = 2; //内容 -} -//跨服消息发送请求 回应 -message ChatSpanSendResp { - -} - diff --git a/pb/proto/comm.proto b/pb/proto/comm.proto deleted file mode 100644 index d2395df05..000000000 --- a/pb/proto/comm.proto +++ /dev/null @@ -1,96 +0,0 @@ -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 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; - google.protobuf.Any 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 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; //暴击 -} - -//用户资产数据 对标*cfg.Game_atn 数据结构 -message UserAssets { - string A = 1; - string T = 2; - int32 N = 3; -} - -message TaskParam { - int32 first = 1; //限定条件 - int32 second = 2; //次数 -} \ No newline at end of file diff --git a/pb/proto/equipment/equipment_db.proto b/pb/proto/equipment/equipment_db.proto deleted file mode 100644 index f6a16094a..000000000 --- a/pb/proto/equipment/equipment_db.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -//装备属性词条 -message EquipmentAttributeEntry { - int32 Id = 1; //属性词条主键id 唯一 - int32 libraryid = 2; //属性词条id 非唯一 - string AttrName = 3; //属性名 - int32 Lv = 4; //属性等级 - int32 Value = 5; //属性值 -} - -//武器数据 -message DB_Equipment { - string Id = 1; //@go_tags(`bson:"_id"`) 装备id - string cId = 2; //@go_tags(`bson:"cId"`) 配置Id - string uId = 3; //@go_tags(`bson:"uid"`) 所属玩家Id - string heroId = 5; //@go_tags(`bson:"heroId"`) 挂在的英雄卡片id 未装备 填 '' - sint32 lv = 6; //@go_tags(`bson:"lv"`) 装备强化等级 - sint32 keepFailNum = 7; //@go_tags(`bson:"keepFailNum"`) 连续强化失败次数 - EquipmentAttributeEntry mainEntry = 8; //@go_tags(`bson:"mainEntry"`) 装备主词条 - repeated EquipmentAttributeEntry adverbEntry = 9; //@go_tags(`bson:"adverbEntry"`) 装备副词条 - uint32 overlayNum = 10; //@go_tags(`bson:"overlayNum"`) 叠加数量 - bool isInitialState = 11; //@go_tags(`bson:"isInitialState"`) 是否初始状态 -} \ No newline at end of file diff --git a/pb/proto/equipment/equipment_msg.proto b/pb/proto/equipment/equipment_msg.proto deleted file mode 100644 index ebedb3487..000000000 --- a/pb/proto/equipment/equipment_msg.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "equipment/equipment_db.proto"; - -//获取装备列表请求 -message EquipmentGetListReq { - -} -//获取装备列表请求 回应 -message EquipmentGetListResp { - repeated DB_Equipment Equipments = 1; //装备列表 -} - -//推送装备背包变化 -message EquipmentChangePush { - repeated DB_Equipment Equipments = 1; //装备列表 -} - -//装备挂在到英雄上 -message EquipmentEquipReq{ - string HeroCardId = 1; //英雄卡Id - repeated string EquipmentId = 2; //装备Id 固定长度的数组 0-5 对应的装备栏 -} - -//装备挂在到英雄上 回应 -message EquipmentEquipResp{ - repeated DB_Equipment Equipments = 1; //挂在装备列表 -} - -//装备升级 -message EquipmentUpgradeReq{ - string EquipmentId = 1; //装备Id -} - -//装备升级 回应 -message EquipmentUpgradeResp{ - bool IsSucc = 1; - repeated DB_Equipment Equipment = 2; //由于装备可以叠加 升级后会创建一个新的装备出来 所以可能影响两个装备 -} \ No newline at end of file diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto deleted file mode 100644 index d50b99127..000000000 --- a/pb/proto/errorcode.proto +++ /dev/null @@ -1,109 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -enum ErrorCode { - Success = 0; //成功 - NoFindService = 10; //没有找到远程服务器 - NoFindServiceHandleFunc = 11; //远程服务器未找到执行方法 - RpcFuncExecutionError = 12; // Rpc方法执行错误 - CacheReadError = 13; //缓存读取失败 - SqlExecutionError = 14; //数据库执行错误 - ReqParameterError = 15; //请求参数错误 - SignError = 16; //签名错误 - InsufficientPermissions = 17; //权限不足 - NoLogin = 18; //未登录 - UserSessionNobeing = 19; //用户不存在 - StateInvalid = 20; //无效状态 - DBError = 21; //数据库操作失败 - SystemError = 22; //通用错误 - Exception = 100; //程序执行异常 - Unknown = 101; //未知错误 - ResNoEnough = 102; //资源不足 - ConfigurationException = 103; //配置异常 - ConfigNoFound = 104; //配置未找到 - - // user - SecKeyInvalid = 1000; //秘钥无效 - SecKey = 1001; //秘钥格式错误 - BindUser = 1002; //用户绑定错误 - GoldNoEnough = 1003; // 金币不足 - DiamondNoEnough = 1004; // 钻石不足 - RoleCreated = 1005; //已创角 - NameExist = 1006; //昵称已存在 - VeriCodeNoValid = 1007; //验证码无效 - VeriCodeExpired = 1008; //验证码过期 - UserResetData = 1009; //初始化用户失败 - ModifynameCount = 1010; //名称修改次数不足 - MailErr = 1011; // 邮件不存在 - - // friend - FriendNotSelf = 1100; //不能是自己 - FriendSelfMax = 1101; //超出好友最大数量 - FriendTargetMax = 1102; //超出目标好友最大数量 - FriendSelfNoData = 1103; //无好友记录 - FriendTargetNoData = 1104; //无目标好友记录 - FriendYet = 1105; //已是好友 - FriendApplyYet = 1106; //已申请该好友 - FriendSelfBlackYet = 1107; //已在自己黑名单中 - FriendTargetBlackYet = 1108; //已在对方的黑名单中 - FriendApplyError = 1109; //申请失败 - FriendBlackMax = 1110; //黑名单最大数量 - FriendSearchNameEmpty = 1111; //查询昵称为空 - - // item - ItemsNoEnough = 1200; //背包物品不足 - ItemsNoFoundGird = 1201; //背包未找到物品格子 - ItemsGridNumUpper = 1202; //背包格子数量已达上限 - ItemsGirdAmountUpper = 1203; //背包格子容量已达上限 - ItemsUseNotSupported = 1204; //暂不支持使用 - - // hero - HeroNoExist = 1300; //英雄不存在 - HeroNoEnough = 1301; //英雄数量不足 - HeroMaxLv = 1302; //英雄达到最大等级 - HeroInitCreat = 1303; //初始化英雄 - HeroColorErr = 1304; // 品质不匹配 - HeroSkillUpErr = 1305; // 技能升级失败 - HeroMaxResonate = 1306; // 达到最大共鸣次数 - HeroNoResonate = 1307; // 没有共鸣 - HeroNotNeedResonate = 1308; // 不需要重置共鸣 - HeroNoEnergy = 1309; // 没有能量点数 - HeroCreate = 1310; // 创建卡失败 - HeroEquipUpdate = 1311; // 更新装备失败 - HeroMaxAwaken = 1312; // 达到最大觉醒等级 - HeroIsLock = 1313; // 英雄被锁定不能被消耗 - HeroMaxCount = 1314; // 英雄达到最大数量 - HeroCostTypeErr = 1315; // 消耗英雄参数不匹配 - HeroStarErr = 1316; // 不满足升星条件 - HeroTypeErr = 1317; // 升级英雄类型不对 - HeroExpTypeErr = 1318; // 技能升级卡类型不对 - HeroAddMaxExp = 1319; // 升级经验卡溢出 检查传入的数量 - HeroStarLvErr = 1320; // 升星等级不够 - HeroMaxStarLv = 1321; // 达到最大升星等级 - DrawCardTypeNotFound = 1322; // 抽卡类型不匹配 - - // equipment - EquipmentOnFoundEquipment = 1400; // 未找到武器 - EquipmentLvlimitReached = 1401; // 武器等级已达上限 - // mainMainline - MainlineNotFindChapter = 1500; // 没有找到主线关卡信息 - MainlineIDFailed = 1501; // 关卡ID 错误 - MainlineNotFound = 1502; // 主线关卡不存在 - MainlinePreNotFound = 1503; // 前置关卡不匹配 - MainlineRepeatReward = 1504; // 重复领奖 - MainlineCompleteReward = 1505; // 通关才能领奖 - - // task - TaskInit = 1600; //初始化失败 - TaskReset = 1601; //重置任务失败 - TaskHandle = 1602; //任务处理失败 - TaskReceived = 1603; //已领取 - TaskActiveInit = 1604; //初始化活跃度失败 - TaskActiveNofound = 1605; //未找到用户活跃度配置 - TaskActiveNoenough = 1606; //活跃值未达标 - TaskNoFinished = 1607; //任务未完成 - TaskFinished = 1608; //已完成 - - // shop - ShopGoodsIsSoldOut = 1700; //商品已售罄 -} \ No newline at end of file diff --git a/pb/proto/forum/forum_db.proto b/pb/proto/forum/forum_db.proto deleted file mode 100644 index f3d2253e6..000000000 --- a/pb/proto/forum/forum_db.proto +++ /dev/null @@ -1,3 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - diff --git a/pb/proto/forum/forum_msg.proto b/pb/proto/forum/forum_msg.proto deleted file mode 100644 index fbeb20245..000000000 --- a/pb/proto/forum/forum_msg.proto +++ /dev/null @@ -1,2 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; \ No newline at end of file diff --git a/pb/proto/friend/friend_db.proto b/pb/proto/friend/friend_db.proto deleted file mode 100644 index 41072cfcc..000000000 --- a/pb/proto/friend/friend_db.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message DBFriend { - string uid = 1; //@go_tags(`bson:"uid"`) 用户ID - repeated string friendIds = 2; //@go_tags(`bson:"friendIds"`) 好友ID - repeated string applyIds = 3; //@go_tags(`bson:"applyIds"`) 申请用户ID - repeated string blackIds = 4; //@go_tags(`bson:"blackIds"`) 黑名单ID -} \ No newline at end of file diff --git a/pb/proto/friend/friend_msg.proto b/pb/proto/friend/friend_msg.proto deleted file mode 100644 index 86ca75635..000000000 --- a/pb/proto/friend/friend_msg.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message FriendBase { - string userId = 1; // ID - string NickName = 2; //昵称 - int32 level = 3; //等级 - int32 avatar = 4; //头像 - int64 strength = 5; //战力 - int32 serverId = 6; //服务编号 - int64 offlineTime = 7; //最近一次下线时间 0在线 -} - -//好友列表 -message FriendListReq {} - -message FriendListResp { repeated FriendBase list = 1; } - -//申请好友 -message FriendApplyReq { - string friendId = 1; //好友ID -} -message FriendApplyResp { - string userId = 1; //用户ID - string friendId = 2; //好友ID -} - -//删除好友 -message FriendDelReq { - string friendId = 1; //好友ID -} - -message FriendDelResp { - string friendId = 1; //好友ID - string userId = 2; //用户ID -} - -//同意 -message FriendAgreeReq { - repeated string friendIds = 1; //被同意的用户 -} -message FriendAgreeResp { - int32 Num = 1; //操作的数量 -} - -//拒绝 -message FriendRefuseReq { - repeated string friendIds = 1; //被拒绝的用户 -} -message FriendRefuseResp { - int32 Num = 1; //操作的数量 -} - -//好友申请列表 -message FriendApplyListReq {} -message FriendApplyListResp { repeated FriendBase list = 1; } - -//好友搜索 -message FriendSearchReq { - string nickName = 1; //好友昵称 -} - -message FriendSearchResp { FriendBase friend = 1; } - -//黑名单 -message FriendBlackListReq {} - -message FriendBlackListResp { repeated FriendBase friends = 1; } - -//添加黑名单 -message FriendBlackAddReq { string friendId = 1; } - -message FriendBlackAddResp { - string friendId = 1; - string userId = 2; -} - -//删除黑名单 -message FriendDelBlackReq { string friendId = 1; } - -message FriendDelBlackResp { - string friendId = 1; - string userId = 2; -} - -//接收 -message FriendReceiveReq { string friendId = 1; } - -message FriendReceiveResp { - string friendId = 1; - string userId = 2; -} - -//赠送 -message FriendGiveReq { string friendId = 1; } - -message FriendGiveResp { - string friendId = 1; - string userId = 2; -} - -//好友数量 -message FriendTotalReq { string friendId = 1; } - -message FriendTotalResp { - string friendId = 1; - int32 total = 2; //好友数量 -} \ No newline at end of file diff --git a/pb/proto/google/protobuf/any.proto b/pb/proto/google/protobuf/any.proto deleted file mode 100644 index e2c2042fd..000000000 --- a/pb/proto/google/protobuf/any.proto +++ /dev/null @@ -1,158 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/anypb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; -} diff --git a/pb/proto/hero/hero_db.proto b/pb/proto/hero/hero_db.proto deleted file mode 100644 index ee77ad2e1..000000000 --- a/pb/proto/hero/hero_db.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message SkillData { - int32 skillID = 1; - int32 skillLv = 2; -} - -message DBHero { - string id = 1; //@go_tags(`bson:"_id"`) ID - string uid = 2; - string heroID = 3; //@go_tags(`bson:"heroID"`) 英雄的配置表ID - int32 star = 4; // 英雄星级 - int32 lv = 5; // 英雄等级 - int32 exp = 6; // 英雄经验 - int32 juexingLv = 7; //@go_tags(`bson:"juexingLv"`) 觉醒等级 - int32 captainSkill = 8; //@go_tags(`bson:"captainSkill"`) 队长技能 - repeated SkillData normalSkill = 9; //@go_tags(`bson:"normalSkill"`) 普通技能 - map property = 10; // 属性相关 - map addProperty = 11; //@go_tags(`bson:"addProperty"`) 附加属性相关 - int32 cardType = 12; //@go_tags(`bson:"cardType"`) 卡片类型(升星卡、经验卡、技能升级卡) - int32 curSkin = 13; //@go_tags(`bson:"curSkin"`) 当前装备的皮肤ID - repeated int32 skins = 14; // 所有皮肤ID - bool block = 15; // 锁定 - repeated string equipID = 16; //@go_tags(`bson:"equipID"`) 装备 objID - int32 resonateNum = 17; //@go_tags(`bson:"resonateNum"`) 共鸣次数 - int32 distributionResonate = 18; //@go_tags(`bson:"distributionResonate"`) 分配的共鸣能量 - map energy = 19; // @go_tags(`bson:"energy"`)能量分配到哪里[1,0] - int32 sameCount = 20; // @go_tags(`bson:"sameCount"`) 卡片叠加数量 - int32 suiteId = 21; //@go_tags(`bson:"suiteId"`) 套装Id - int32 suiteExtId = 22; // go_tags(`bson:"suiteExtId"`) 扩展套装Id - bool isOverlying = 23; // go_tags(`bson:"isOverlying"`) 是否允许叠加 默认true -} \ No newline at end of file diff --git a/pb/proto/hero/hero_msg.proto b/pb/proto/hero/hero_msg.proto deleted file mode 100644 index e6938646d..000000000 --- a/pb/proto/hero/hero_msg.proto +++ /dev/null @@ -1,155 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "hero/hero_db.proto"; - -//英雄基础信息 -message HeroInfoReq { - string heroId = 1; //英雄唯一ID -} -message HeroInfoResp { DBHero base = 1; } - -//英雄列表 -message HeroListReq {} - -message HeroListResp { repeated DBHero list = 1; } - -/// 卡牌养成: 强化(卡牌升级、卡牌升星、技能升级) -/// 卡牌养成: 共鸣(共鸣消耗、材料返回、能量点使用) -/// 卡牌养成: 觉醒(英雄觉醒、材料消耗) - -message ItemData { - int32 itemId = 2; //物品Id - int32 amount = 3; //数量 -} - -message MapStringInt32 { - string Key = 1; - int32 Value = 2; -} - -// 卡牌升级 -message HeroStrengthenUplvReq { - string heroObjID = 1; // 英雄对象ID - repeated MapStringInt32 expCards = 2; -} - -// 卡牌升级返回 -message HeroStrengthenUplvResp { - DBHero hero = 1; // 英雄对象 -} - -message CostCardData { - string costCardObj = 1; // 对象ID - int32 amount = 2; // 数量 -} -// 卡牌升星 -message HeroStrengthenUpStarReq { - string heroObjID = 1; // 英雄对象ID - repeated CostCardData hero = 2; // 消耗卡牌对象ID - repeated CostCardData heroRace = 3; // 消耗种族卡牌对象ID -} - -// 卡牌升星返回 -message HeroStrengthenUpStarResp { - DBHero hero = 1; // 英雄对象 -} - -// 卡牌技能升级 -message HeroStrengthenUpSkillReq { - string heroObjID = 1; // 英雄对象ID - string costCardObj = 2; // 消耗技能升级卡 -} - -// 卡牌技能升级返回 -message HeroStrengthenUpSkillResp { - DBHero hero = 1; // 英雄对象 -} - -// 共鸣英雄 -message HeroResonanceReq { - string heroObjID = 1; // 英雄对象ID - repeated string costObjID = 2; // 消耗对象 -} - -message HeroResonanceResp { - DBHero hero = 1; // 英雄对象 - int32 energy = 2; // 共鸣成功 获得的能量点数 - DBHero upStarCard = 3; //共鸣成功 获得的升星卡 -} - -// 重置共鸣属性 -message HeroResonanceResetReq { - string heroObjID = 1; // 英雄对象ID -} - -message HeroResonanceResetResp { - DBHero hero = 1; // 英雄对象 - int32 energy = 2; // 能量点数 -} - -// 使用能量点数 -message HeroResonanceUseEnergyReq { - string heroObjID = 1; // 英雄对象ID - int32 useEnergy = 2; // 使用的能量点数 - int32 useType = 3; // 使用的类型 (攻击、血量、防御) -} - -message HeroResonanceUseEnergyResp { - DBHero hero = 1; // 英雄对象 -} - -// 觉醒 -message HeroAwakenReq { - string heroObjID = 1; // 英雄对象ID -} - -// 觉醒返回 -message HeroAwakenResp { - DBHero hero = 1; // 英雄对象 -} - -//抽卡 -message HeroChoukaReq { repeated string heroIds = 1; } - -message HeroChoukaResp { repeated DBHero heroes = 1; } - -//英雄属性推送 -message HeroPropertyPush { - string heroId = 1; //英雄唯一ID - map property = 2; //基础属性 - map addProperty = 3; //附加属性 -} - -// 英雄锁定 -message HeroLockReq { string heroid = 1; } - -// 英雄锁定返回 -message HeroLockResp { - DBHero hero = 1; // 英雄对象 -} - -// 测试用(获取指定星级等级的英雄) -message HeroGetSpecifiedReq { - string heroCoinfigID = 1; // 英雄配置ID - int32 Amount = 2; // 数量 - int32 star = 3; // 星级 - int32 lv = 4; // 等级 -} - -message HeroGetSpecifiedResp { - DBHero hero = 1; // 英雄对象 -} - -// 抽卡 -message HeroDrawCardReq { - int32 drawType = 1; // 抽卡类型 见drawCardCost表 -} - -message HeroDrawCardResp { - repeated string heroes = 1; // 返回英雄的configID -} - -// 英雄变化推送 -message HeroChangePush{ - repeated DBHero list = 1; -} \ No newline at end of file diff --git a/pb/proto/items/items_db.proto b/pb/proto/items/items_db.proto deleted file mode 100644 index ee9a0d401..000000000 --- a/pb/proto/items/items_db.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - - -//背包格子 -message DB_UserItemData { - string gridId = 1; //@go_tags(`bson:"_id"`) 背包格子Id - string uId = 2; //@go_tags(`bson:"uid"`) 用户id - string itemId = 3; //@go_tags(`bson:"itemId"`) 存放物品的Id - uint32 amount = 4; //@go_tags(`bson:"amount"`) 存放物品的数量 - int64 cTime = 5; //@go_tags(`bson:"cTime"`) 物品获取时间 - int64 eTime = 6; //@go_tags(`bson:"eTime"`) 物品过期时间 - bool isNewItem = 7; //@go_tags(`bson:"isNewItem"`) 是否是新的 - int64 lastopt = 8; //@go_tags(`bson:"lastopt"`) 最后操作时间 -} diff --git a/pb/proto/items/items_msg.proto b/pb/proto/items/items_msg.proto deleted file mode 100644 index f7f2ab360..000000000 --- a/pb/proto/items/items_msg.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "items/items_db.proto"; - -//查询用户背包请求 -message ItemsGetlistReq { - int32 IType = 1; //道具类型 -} - -//查询用户背包请求 回应 -message ItemsGetlistResp { - repeated DB_UserItemData Grids = 1; //用户背包列表 -} - -//背包变化推送 -message ItemsChangePush { - repeated DB_UserItemData Grids = 1; //变化数据 -} - -//使用物品请求 -message ItemsUseItemReq { - string GridId = 1; //格子Id - uint32 Amount = 2; //使用数量 -} - -//使用物品请求 回应 -message ItemsUseItemResp { - string GridId = 1; //格子Id - uint32 Amount = 2; //使用数量 - bool issucc = 3; //是否成功 -} - -//出售道具请求sailitem -message ItemsSellItemReq { - string GridId = 1; //格子Id - string ItemId = 2; //物品Id - uint32 Amount = 3; //使用数量 -} - -//出售道具请求 回应 -message ItemsSellItemResp { - string GridId = 1; //格子Id - uint32 Amount = 2; //使用数量 - bool issucc = 3; //是否成功 -} \ No newline at end of file diff --git a/pb/proto/mail/mail_db.proto b/pb/proto/mail/mail_db.proto deleted file mode 100644 index e5f17d54a..000000000 --- a/pb/proto/mail/mail_db.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "comm.proto"; - -message DBMailData { - string ObjId = 1; // @go_tags(`bson:"_id"`) ID - string Uid = 2; - string Title = 3; // 邮件标题 - string Contex = 4; // 邮件内容 - uint64 CreateTime = 5; // 发送时间 - uint64 DueTime = 6; // 过期时间 - bool Check = 7; // 是否查看 - bool Reward = 8; // 附件领取状态 - repeated UserAssets Items = 9; // 附件 -} diff --git a/pb/proto/mail/mail_msg.proto b/pb/proto/mail/mail_msg.proto deleted file mode 100644 index 98cc9473d..000000000 --- a/pb/proto/mail/mail_msg.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "mail/mail_db.proto"; - -message MailGetListReq { - -} - -// 查询邮件信息 -message MailGetListResp { - repeated DBMailData Mails = 1; -} - -// 查看邮件 -message MailReadMailReq { - string ObjID = 1; -} - -message MailReadMailResp { - DBMailData Mail = 1; -} - -// 领取附件 -message MailGetUserMailAttachmentReq { - string ObjID = 1; -} - -message MailGetUserMailAttachmentResp { - DBMailData Mail = 1; -} - -// 删除某个邮件 -message MailDelMailReq { - string ObjID = 1; -} - -message MailDelMailResp { - string ObjID = 1; // 返回删除邮件id -} - -// 推送邮件 -message MailGetNewMailPush{ - DBMailData Mail = 1; // 推送新的邮件信息 -} \ No newline at end of file diff --git a/pb/proto/mainline/mainline_db.proto b/pb/proto/mainline/mainline_db.proto deleted file mode 100644 index 029bf03c0..000000000 --- a/pb/proto/mainline/mainline_db.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message DBMainline { - string id = 1; //@go_tags(`bson:"_id"`) ID - string uid = 2; //@go_tags(`bson:"uid"`) 用户ID - int32 chapterId = 3; //@go_tags(`bson:"chapterId"`) 章节ID - int32 mainlineId = 4; //@go_tags(`bson:"mainlineId"`) 主线关卡ID - int32 awaredID = 5; //@go_tags(`bson:"awaredID"`) 是否领奖(设置int是考虑后续扩展有多个宝箱情况) - repeated int32 branchID = 6; // @go_tags(`bson:"branchID"`) 记录分支通关的情况 -} \ No newline at end of file diff --git a/pb/proto/mainline/mainline_msg.proto b/pb/proto/mainline/mainline_msg.proto deleted file mode 100644 index 48a204ebe..000000000 --- a/pb/proto/mainline/mainline_msg.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "mainline/mainline_db.proto"; - -// 查询关卡进度 -message MainlineGetListReq { - -} -// 返回进度信息 -message MainlineGetListResp { - repeated DBMainline data = 1; -} - -// 领取关卡宝箱 -message MainlineGetRewardReq { - string chapterObj = 1; // 章节唯一对象id -} - -message MainlineGetRewardResp { - DBMainline data = 1; //当前章节信息 -} - -// 挑战关卡 -message MainlineChallengeReq { - string chapterObj = 1; // 章节唯一对象id - uint32 mainlineId = 2; // 小关ID -} - -message MainlineChallengeResp { - DBMainline data = 1; //当前章节信息 -} - -// 推送新章节 -message MainlineNewChapterPush{ - DBMainline data = 1; -} \ No newline at end of file diff --git a/pb/proto/notify/notify_db.proto b/pb/proto/notify/notify_db.proto deleted file mode 100644 index bee9b6d51..000000000 --- a/pb/proto/notify/notify_db.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -//系统公告数据结构 -message DBSystemNotify { - string id = 1; //数据公告Id - string title = 2; //公告标题 - string content = 3; //公告内容 - bool istop = 4; //是否置顶 - int64 ctime = 5; //创建时间 - int64 rtime = 6; //发布时间 -} \ No newline at end of file diff --git a/pb/proto/notify/notify_msg.proto b/pb/proto/notify/notify_msg.proto deleted file mode 100644 index 48a5572dd..000000000 --- a/pb/proto/notify/notify_msg.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "errorcode.proto"; -import "notify/notify_db.proto"; -import "google/protobuf/any.proto"; - -//统一错误码推送 -message NotifyErrorNotifyPush { - string ReqMainType = 1; // 请求协议模块 模块名 例如:user 对应项目中 user的模块 - string ReqSubType = 2; // 请求协议函数 例如:login 对应项目中 user的模块中 - // api_login 的处理函数 - ErrorCode Code = 3; // 执行返回错误码 对应 errorcode.proto 枚举 - string Message = 4; // 错误消息 - google.protobuf.Any arg = 5; //参数信息 - google.protobuf.Any Data = 6; // 错误数据 -} - -//获取系统公告 请求 -message NotifyGetListReq {} - -//获取系统公告 回应 -message NotifyGetListResp { - int64 LastReadTime = 1; //最后一次阅读时间 - repeated DBSystemNotify SysNotify = 2; //公告列表 -} \ No newline at end of file diff --git a/pb/proto/shop/shop_db.proto b/pb/proto/shop/shop_db.proto deleted file mode 100644 index eebb822bd..000000000 --- a/pb/proto/shop/shop_db.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -enum ShopType { - Null = 0; - GoldShop = 1; - DiamondShop = 2; - PVPShop = 3; - PVEShop = 4; - AllianceShop = 5; -} - -message UserShopData { - int64 LastRefreshTime = 1; //最后一次刷新时间 - int32 ManualRefreshNum = 2; //手动刷新次数 - repeated int32 Items = 3; //商品列表 -} - -message DBShop { - string id = 1; //@go_tags(`bson:"_id"`) 装备id - string uid = 2; //@go_tags(`bson:"uid"`) 装备id - UserShopData goldShop = 3; //@go_tags(`bson:"goldShop"`)金币商店数据 - UserShopData diamondShop = 4; //@go_tags(`bson:"diamondShop"`)金币商店数据 - UserShopData pvpShop = 5; //@go_tags(`bson:"pvpShop"`)金币商店数据 - UserShopData pveShop = 6; //@go_tags(`bson:"pveShop"`)金币商店数据 - UserShopData allianceShop = 7; //@go_tags(`bson:"allianceShop"`)金币商店数据 -} - -message DBShopItem { - string id = 1; //@go_tags(`bson:"_id"`) 装备id - string uid = 2; //@go_tags(`bson:"uid"`) 装备id - int32 goodsId = 3; //@go_tags(`bson:"goodsId"`)商品Id - map buyNum = 4; //@go_tags(`bson:"buyNum"`)购买数量 - map lastBuyTime = 5; //@go_tags(`bson:"lastBuyTime"`)最后一次购买的时间 -} \ No newline at end of file diff --git a/pb/proto/shop/shop_msg.proto b/pb/proto/shop/shop_msg.proto deleted file mode 100644 index f6a5ab75c..000000000 --- a/pb/proto/shop/shop_msg.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "shop/shop_db.proto"; -import "comm.proto"; - - -//商品对象数据 -message ShopItem { - int32 GoodsId = 1; //商品Id - repeated UserAssets Items = 2; //货物 - repeated UserAssets Consume = 3; //消耗 - int32 Sale = 4; //打折 - int32 LeftBuyNum = 5; //还可购买次数 -} - -//获取装备列表请求 -message ShopGetListReq { - ShopType sType = 1; //商城类型 - bool IsManualRefresh = 2; //是否手动刷新 -} - -//获取装备列表请求 -message ShopGetListResp { - repeated ShopItem Goods = 1; //商品列表 -} - -//购买商品 请求 -message ShopBuyReq { - ShopType ShopType = 1; //商店类型 - int32 GoodsId = 2; //商品Id -} - -//购买商品 回应 -message ShopBuyResp { - bool IsSucc = 1; //是否成功 -} diff --git a/pb/proto/task/task_db.proto b/pb/proto/task/task_db.proto deleted file mode 100644 index f5ba4a937..000000000 --- a/pb/proto/task/task_db.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message DBTask { - string id = 1; //@go_tags(`bson:"_id"`) ID - string uid = 2; //@go_tags(`bson:"uid"`) 用户ID - int32 taskId = 3; //@go_tags(`bson:"taskId"`) 任务Id - int32 tag = 4; //@go_tags(`bson:"tag"`) 标签 - int32 progress = 5; //@go_tags(`bson:"progress"`) 任务进度/完成次数 - int32 active = 6; //@go_tags(`bson:"active"`) 活跃度 - int32 status = 7; //@go_tags(`bson:"status"`) 任务状态 默认0未完成 1已完成 - int32 received = 8; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取 - int32 typeId = 9; //@go_tags(`bson:"typeId"`) -} - -message DBTaskActive { - string id = 1; //@go_tags(`bson:"_id"`) ID - string uid = 2; //@go_tags(`bson:"uid"`) 用户ID - int32 rId = 3; //@go_tags(`bson:"taskId"`) rewardId - int32 tag = 4; //@go_tags(`bson:"tag"`) 标签 - int32 received = 5; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取 -} \ No newline at end of file diff --git a/pb/proto/task/task_msg.proto b/pb/proto/task/task_msg.proto deleted file mode 100644 index 9a4c857f7..000000000 --- a/pb/proto/task/task_msg.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "task/task_db.proto"; - -//领取 -message TaskReceiveReq { - int32 taskTag = 1; // 1日常/2周常/3成就 - string id = 2; //任务唯一ID -} - -message TaskReceiveResp { - int32 taskId = 1; //任务配置ID -} - -//任务列表 -message TaskListReq { - int32 taskTag = 1; //日常/周常/成就 -} - -message TaskListResp { repeated DBTask list = 1; } - -//活跃度 -message TaskActiveListReq { int32 taskTag = 1; } -message TaskActiveListResp { - repeated DBTaskActive list = 1; //活跃度列表 - int32 active = 2; //活跃度值 -} - -//活跃度领取 -message TaskActiveReceiveReq { - int32 taskTag = 1; // 1日常/2周常 - string id = 2; //唯一id -} -message TaskActiveReceiveResp { - int32 taskTag = 1; - string id = 2; -} - -//攻略 -message TaskDoStrategyReq { - int32 heroCfgId = 1; //英雄ID -} - -message TaskDoStrategyResp { - repeated int32 taskIds = 1; //任务ID -} - -//任务完成推送 -message TaskFinishedPush { - int32 taskId = 1; -} \ No newline at end of file diff --git a/pb/proto/user/user_db.proto b/pb/proto/user/user_db.proto deleted file mode 100644 index 0724e33c8..000000000 --- a/pb/proto/user/user_db.proto +++ /dev/null @@ -1,49 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message CacheUser { - string uid = 1; //@go_tags(`json:"uid"`) 用户id - string SessionId = 2; //@go_tags(`json:"sessionId"`) 会话id - string ServiceTag = 3; //@go_tags(`json:"serviceTag"`) 所在服务集群 区服id - string GatewayServiceId = 4; //@go_tags(`json:"gatewayServiceId"`) 所在网关服务id - string ip = 5; //@go_tags(`json:"ip"`) 远程ip -} - -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 - string binduid = 4; //@go_tags(`bson:"binduid"`) 玩家账号 - string name = 5; //@go_tags(`bson:"name"`) 玩家名 - int32 sid = 6; //@go_tags(`bson:"sid"`) 区服id - string createip = 7; //@go_tags(`bson:"createip"`) 创建账号时的ip - string lastloginip = 8; //@go_tags(`bson:"lastloginip"`) 最后一次登录时的ip - int64 ctime = 9; //@go_tags(`bson:"ctime"`) 玩家创号时间戳 - int64 logintime = 10; //@go_tags(`bson:"logintime"`) 最后一次登录时间 - int32 friendPoint = 11; //@go_tags(`bson:"friendPoint"`) 友情点 - int32 avatar = 12; //@go_tags(`bson:"avatar"`) 头像 - int32 gold = 13; //@go_tags(`bson:"gold"`) 金币 - int32 exp = 14; //@go_tags(`bson:"exp"`) 经验 - bool created = 15; //@go_tags(`bson:"created"`) 创角 - int32 lv = 16; //@go_tags(`bson:"lv"`) 等级 - int32 vip = 17; //@go_tags(`bson:"vip"`) vip - int32 diamond = 18; //@go_tags(`bson:"diamond"`) 钻石 - int32 title = 19; //@go_tags(`bson:"title"`)头衔 -} - -message DBUserSetting { - string uid = 2; //@go_tags(`bson:"uid"`) 用户ID - uint32 huazhi = 3; //@go_tags(`bson:"huazhi"`) 画质 0极致 1精致 2正常 3流畅 - uint32 kangjuchi = 4; //@go_tags(`bson:"kangjuchi"`) 抗锯齿 0 1 2 3 - bool gaoguang = 5; //@go_tags(`bson:"gaoguang"`) 高光 - bool wuli = 6; //@go_tags(`bson:"wuli"`) 物理模拟 - bool music = 7; //@go_tags(`bson:"music"`) 音乐 - bool effect = 8; //@go_tags(`bson:"effect"`) 音效 - - bool guaji = 9; //@go_tags(`bson:"guaji"`) 挂机 - bool fuben = 10; //@go_tags(`bson:"fuben"`) 特殊副本重置 - bool tansuo = 11; //@go_tags(`bson:"tansuo"`) 蜂窝探索 - bool huodong = 12; //@go_tags(`bson:"huodong"`) 特殊活动开启 - bool xuanshang = 13; //@go_tags(`bson:"wanfa"`)悬赏玩法重置 - bool saiji = 14; //@go_tags(`bson:"wanfa"`)格斗场玩法赛季重置 -} diff --git a/pb/proto/user/user_msg.proto b/pb/proto/user/user_msg.proto deleted file mode 100644 index 2b29a1014..000000000 --- a/pb/proto/user/user_msg.proto +++ /dev/null @@ -1,102 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; -import "errorcode.proto"; -import "user/user_db.proto"; -import "comm.proto"; -import "userexpand.proto"; - -//用户登录 -message UserLoginReq { - string account = 1; //账号 - int32 sid = 2; //区服编号 -} - -message UserLoginResp { - DBUser data = 1; - DBUserExpand ex = 2; //用户扩展 -} - -//登出 -message UserLogoutReq {} - -message UserLogoutResp {} - -//注册 -message UserRegisterReq { - string account = 1; - int32 sid = 2; -} - -message UserRegisterResp { - ErrorCode Code = 1; - string account = 2; -} - -message UserLoadResp { CacheUser data = 1; } - -//创角 -message UserCreateReq { - string NickName = 1; //昵称 -} - -message UserCreateResp { - bool IsSucc = 1; -} - -//添加用户资源 -message UserAddResReq { - UserAssets res = 1; //资源类型 -} - -message UserAddResResp { - UserAssets res = 1; //资源类型 -} - -// 玩家资源变更推送 -message UserResChangePush { - int32 gold = 1; //@go_tags(`bson:"gold"`) 金币 - int32 exp = 2; //@go_tags(`bson:"exp"`) 经验 - int32 lv = 3; //@go_tags(`bson:"lv"`) 等级 - int32 vip = 4; //@go_tags(`bson:"vip"`) vip - int32 diamond = 5; //@go_tags(`bson:"diamond"`) 钻石 -} - -//用户设置获取 -message UserGetSettingReq {} - -message UserGetSettingResp { - DBUserSetting setting = 1; //用户设置 -} - -// 更新用户设置 -message UserUpdateSettingReq { DBUserSetting setting = 1; } -message UserUpdateSettingResp {} - -// 初始化验证码 -message UserVeriCodeReq {} -message UserVeriCodeResp { - int32 code = 1; //验证码 -} - -//初始化用户数据 -message UserInitdataReq { - int32 code = 1; //验证码 -} -message UserInitdataResp {} - -//修改玩家名字 -message UserModifynameReq { - string name = 1; //玩家名称 -} -message UserModifynameResp { - string uid = 1; - uint32 count = 2; //剩余修改次数 -} - -message UserGetTujianReq{ - -} - -message UserGetTujianResp{ - repeated string heroids = 1; -} \ No newline at end of file diff --git a/pb/proto/userexpand.proto b/pb/proto/userexpand.proto deleted file mode 100644 index a04842f5b..000000000 --- a/pb/proto/userexpand.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -//用户扩展数据 -message DBUserExpand { - string id = 1; //主键id - string uid = 2; //用户id - int64 lastreadnotiftime = 3; //最后阅读公告时间 - int64 lastInitdataTime = 4; //上次初始数据时间 - uint32 initdataCount = 5; //今日初始累计次数 - int32 chatchannel = 6; //跨服聊天频道 - int32 modifynameCount = 7; //修改昵称次数 - map tujian = 8; // 图鉴 -} diff --git a/pb/proto/userrecord.proto b/pb/proto/userrecord.proto deleted file mode 100644 index 717ded347..000000000 --- a/pb/proto/userrecord.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -option go_package = ".;pb"; - -message Floor{ // 记录阵型保底数据 - int32 h4 = 1; // 4星次数 - int32 h5 = 2; // 5星次数 -} - -//用户扩展数据 -message DBUserRecord { - string id = 1; //@go_tags(`bson:"_id"`) ID 主键id - string uid = 2; //@go_tags(`bson:"uid"`) 用户ID - Floor race0 = 3; // 普通卡池 - Floor race1 = 4; // 阵型1卡池 - Floor race2 = 5; // 阵型2卡池 - Floor race3 = 6; // 阵型3卡池 - Floor race4 = 7; // 阵型4卡池 - int32 triggernum = 8; // 活动数据 存放没有触发次数 - int32 activityid = 9; // 活动id - int64 mtime = 10; // 修改时间 -} \ No newline at end of file