From bfce8fb1a25fcc3dfbcdbb3c761c7faf4e9689a3 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 30 Aug 2023 19:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=AF=E9=BE=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_dragonplay.json | 101 +++++ bin/json/game_dragonplot.json | 222 +++++++++ bin/json/game_trainlv.json | 452 +++++++++++++++++++ modules/dragon/api.go | 33 ++ modules/dragon/api_list.go | 18 + modules/dragon/configure_comp.go | 62 +++ modules/dragon/model_hero.go | 33 ++ modules/dragon/module.go | 45 ++ pb/dragon_db.pb.go | 292 ++++++++++++ pb/dragon_msg.pb.go | 363 +++++++++++++++ sys/configure/structs/Game.DragonPlay.go | 42 ++ sys/configure/structs/Game.DragonPlayData.go | 47 ++ sys/configure/structs/Game.DragonPlot.go | 42 ++ sys/configure/structs/Game.DragonPlotData.go | 43 ++ sys/configure/structs/Game.Trainlv.go | 42 ++ sys/configure/structs/Game.TrainlvData.go | 60 +++ sys/configure/structs/Tables.go | 21 + 17 files changed, 1918 insertions(+) create mode 100644 bin/json/game_dragonplay.json create mode 100644 bin/json/game_dragonplot.json create mode 100644 bin/json/game_trainlv.json create mode 100644 modules/dragon/api.go create mode 100644 modules/dragon/api_list.go create mode 100644 modules/dragon/configure_comp.go create mode 100644 modules/dragon/model_hero.go create mode 100644 modules/dragon/module.go create mode 100644 pb/dragon_db.pb.go create mode 100644 pb/dragon_msg.pb.go create mode 100644 sys/configure/structs/Game.DragonPlay.go create mode 100644 sys/configure/structs/Game.DragonPlayData.go create mode 100644 sys/configure/structs/Game.DragonPlot.go create mode 100644 sys/configure/structs/Game.DragonPlotData.go create mode 100644 sys/configure/structs/Game.Trainlv.go create mode 100644 sys/configure/structs/Game.TrainlvData.go diff --git a/bin/json/game_dragonplay.json b/bin/json/game_dragonplay.json new file mode 100644 index 000000000..687fea44a --- /dev/null +++ b/bin/json/game_dragonplay.json @@ -0,0 +1,101 @@ +[ + { + "key": 1, + "id": "20030001", + "grow": 1, + "type": 1, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 2, + "id": "20030001", + "grow": 1, + "type": 3, + "exp": 10, + "time": 2, + "group": 10001 + }, + { + "key": 3, + "id": "20030001", + "grow": 1, + "type": 4, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 4, + "id": "20030001", + "grow": 2, + "type": 1, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 5, + "id": "20030001", + "grow": 2, + "type": 2, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 6, + "id": "20030001", + "grow": 2, + "type": 3, + "exp": 10, + "time": 2, + "group": 10002 + }, + { + "key": 7, + "id": "20030001", + "grow": 2, + "type": 4, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 8, + "id": "20030001", + "grow": 3, + "type": 1, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 9, + "id": "20030001", + "grow": 3, + "type": 2, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 10, + "id": "20030001", + "grow": 3, + "type": 4, + "exp": 10, + "time": 2, + "group": 0 + }, + { + "key": 11, + "id": "20030001", + "grow": 3, + "type": 5, + "exp": 10, + "time": 2, + "group": 0 + } +] \ No newline at end of file diff --git a/bin/json/game_dragonplot.json b/bin/json/game_dragonplot.json new file mode 100644 index 000000000..352780528 --- /dev/null +++ b/bin/json/game_dragonplot.json @@ -0,0 +1,222 @@ +[ + { + "key": 1, + "group": 10001, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 2, + "group": 10001, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 3, + "group": 10001, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 4, + "group": 10001, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 5, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 6, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 7, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 8, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 9, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 10, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 11, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 12, + "group": 10002, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 13, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 14, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 15, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 16, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 17, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 18, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 19, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 20, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 21, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + }, + { + "key": 22, + "group": 10003, + "plot": 20200, + "pic": "", + "describe": { + "key": "", + "text": "" + } + } +] \ No newline at end of file diff --git a/bin/json/game_trainlv.json b/bin/json/game_trainlv.json new file mode 100644 index 000000000..ec5e51abc --- /dev/null +++ b/bin/json/game_trainlv.json @@ -0,0 +1,452 @@ +[ + { + "key": 1, + "id": "20030001", + "type": 1, + "lv": 1, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 1 + } + ] + }, + { + "key": 2, + "id": "20030001", + "type": 1, + "lv": 2, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 2 + } + ] + }, + { + "key": 3, + "id": "20030001", + "type": 1, + "lv": 3, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 3 + } + ] + }, + { + "key": 4, + "id": "20030001", + "type": 1, + "lv": 4, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 4 + } + ] + }, + { + "key": 5, + "id": "20030001", + "type": 1, + "lv": 5, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 5 + } + ] + }, + { + "key": 6, + "id": "20030001", + "type": 2, + "lv": 6, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 6 + } + ] + }, + { + "key": 7, + "id": "20030001", + "type": 2, + "lv": 7, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 7 + } + ] + }, + { + "key": 8, + "id": "20030001", + "type": 2, + "lv": 8, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 8 + } + ] + }, + { + "key": 9, + "id": "20030001", + "type": 2, + "lv": 9, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 9 + } + ] + }, + { + "key": 10, + "id": "20030001", + "type": 2, + "lv": 10, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 10 + } + ] + }, + { + "key": 11, + "id": "20030001", + "type": 2, + "lv": 11, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 11 + } + ] + }, + { + "key": 12, + "id": "20030001", + "type": 2, + "lv": 12, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 12 + } + ] + }, + { + "key": 13, + "id": "20030001", + "type": 2, + "lv": 13, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 13 + } + ] + }, + { + "key": 14, + "id": "20030001", + "type": 2, + "lv": 14, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 14 + } + ] + }, + { + "key": 15, + "id": "20030001", + "type": 2, + "lv": 15, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 15 + } + ] + }, + { + "key": 16, + "id": "20030001", + "type": 2, + "lv": 16, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 16 + } + ] + }, + { + "key": 17, + "id": "20030001", + "type": 2, + "lv": 17, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 17 + } + ] + }, + { + "key": 18, + "id": "20030001", + "type": 2, + "lv": 18, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 18 + } + ] + }, + { + "key": 19, + "id": "20030001", + "type": 2, + "lv": 19, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 19 + } + ] + }, + { + "key": 20, + "id": "20030001", + "type": 2, + "lv": 20, + "exp": 100, + "etime": 0, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 20 + } + ] + }, + { + "key": 21, + "id": "20030001", + "type": 3, + "lv": 21, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 21 + } + ] + }, + { + "key": 22, + "id": "20030001", + "type": 3, + "lv": 22, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 22 + } + ] + }, + { + "key": 23, + "id": "20030001", + "type": 3, + "lv": 23, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 23 + } + ] + }, + { + "key": 24, + "id": "20030001", + "type": 3, + "lv": 24, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 24 + } + ] + }, + { + "key": 25, + "id": "20030001", + "type": 3, + "lv": 25, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 25 + } + ] + }, + { + "key": 26, + "id": "20030001", + "type": 3, + "lv": 26, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 26 + } + ] + }, + { + "key": 27, + "id": "20030001", + "type": 3, + "lv": 27, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 27 + } + ] + }, + { + "key": 28, + "id": "20030001", + "type": 3, + "lv": 28, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 28 + } + ] + }, + { + "key": 29, + "id": "20030001", + "type": 3, + "lv": 29, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 29 + } + ] + }, + { + "key": 30, + "id": "20030001", + "type": 3, + "lv": 30, + "exp": 100, + "etime": 50, + "reward": [ + { + "a": "attr", + "t": "gold", + "n": 30 + } + ] + } +] \ No newline at end of file diff --git a/modules/dragon/api.go b/modules/dragon/api.go new file mode 100644 index 000000000..2d5b281cc --- /dev/null +++ b/modules/dragon/api.go @@ -0,0 +1,33 @@ +package dragon + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +type apiComp struct { + //cbase.ModuleCompBase + modules.MCompGate + service core.IService + module *Dragon + chat comm.IChat +} + +//组件初始化接口 +func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompGate.Init(service, module, comp, options) + this.module = module.(*Dragon) + this.service = service + return +} + +func (this *apiComp) Start() (err error) { + err = this.MCompGate.Start() + var module core.IModule + if module, err = this.service.GetModule(comm.ModuleChat); err != nil { + return + } + this.chat = module.(comm.IChat) + return +} diff --git a/modules/dragon/api_list.go b/modules/dragon/api_list.go new file mode 100644 index 000000000..43bc9525c --- /dev/null +++ b/modules/dragon/api_list.go @@ -0,0 +1,18 @@ +package dragon + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +//参数校验 +func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.HeroListReq) (errdata *pb.ErrorData) { + return +} + +func (this *apiComp) List(session comm.IUserSession, req *pb.HeroListReq) (errdata *pb.ErrorData) { + rsp := &pb.HeroListResp{} + + session.SendMsg(string(this.module.GetType()), "", rsp) + return +} diff --git a/modules/dragon/configure_comp.go b/modules/dragon/configure_comp.go new file mode 100644 index 000000000..9aa713cd0 --- /dev/null +++ b/modules/dragon/configure_comp.go @@ -0,0 +1,62 @@ +package dragon + +import ( + "go_dreamfactory/modules" + "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" + + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" +) + +const moduleName = "dragon" +const ( + dragon_trainlv = "game_trainlv.json" +) + +// /配置管理组件 +type configureComp struct { + modules.MCompConfigure + module *Dragon +} + +// 组件初始化接口 +func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + + err = this.MCompConfigure.Init(service, module, comp, options) + this.module = module.(*Dragon) + err = this.LoadMultiConfigure(map[string]interface{}{ + dragon_trainlv: cfg.NewGameTrainlv, + }) + + return +} + +//加载多个配置文件 +func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) { + for k, v := range confs { + err = configure.RegisterConfigure(k, v, nil) + if err != nil { + log.Errorf("配置文件:%s解析失败!", k) + break + } + } + return +} + +//读取配置数据 +func (this *configureComp) GetConfigure(name string) (v interface{}, err error) { + return configure.GetConfigure(name) +} + +func (this *configureComp) GetTrainlvConfById(id int32) (conf *cfg.GameTrainlvData, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(dragon_trainlv); err == nil { + if configure, ok := v.(*cfg.GameTrainlv); ok { + conf = configure.Get(id) + } + } + return +} diff --git a/modules/dragon/model_hero.go b/modules/dragon/model_hero.go new file mode 100644 index 000000000..d81cca346 --- /dev/null +++ b/modules/dragon/model_hero.go @@ -0,0 +1,33 @@ +package dragon + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" +) + +type ModelDragon struct { + modules.MCompModel + module *Dragon +} + +func (this *ModelDragon) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = comm.TableHero + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Dragon) + // 通过uid创建索引 + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +// 初始化英雄 +func (this *ModelDragon) InitHero(uid string, heroCfgId string) *pb.DBHero { + + return nil +} diff --git a/modules/dragon/module.go b/modules/dragon/module.go new file mode 100644 index 000000000..68225d9bd --- /dev/null +++ b/modules/dragon/module.go @@ -0,0 +1,45 @@ +package dragon + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +func NewModule() core.IModule { + m := new(Dragon) + return m +} + +type Dragon struct { + modules.ModuleBase + service core.IService + api *apiComp + configure *configureComp + modelDragon *ModelDragon +} + +// 模块名 +func (this *Dragon) GetType() core.M_Modules { + return comm.ModuleHero +} + +// 模块初始化接口 注册用户创建角色事件 +func (this *Dragon) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { + err = this.ModuleBase.Init(service, module, options) + this.service = service + return +} + +// 装备组件 +func (this *Dragon) OnInstallComp() { + this.ModuleBase.OnInstallComp() + this.api = this.RegisterComp(new(apiComp)).(*apiComp) + this.modelDragon = this.RegisterComp(new(ModelDragon)).(*ModelDragon) + this.configure = this.RegisterComp(new(configureComp)).(*configureComp) +} +func (this *Dragon) Start() (err error) { + err = this.ModuleBase.Start() + + return +} diff --git a/pb/dragon_db.pb.go b/pb/dragon_db.pb.go new file mode 100644 index 000000000..95146c598 --- /dev/null +++ b/pb/dragon_db.pb.go @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: dragon/dragon_db.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DBDragon struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` + Dragonid string `protobuf:"bytes,3,opt,name=dragonid,proto3" json:"dragonid"` // 坐骑配置id + Lv int32 `protobuf:"varint,4,opt,name=lv,proto3" json:"lv"` //等级 + Exp int32 `protobuf:"varint,5,opt,name=exp,proto3" json:"exp"` // 经验 + Property map[int32]int32 `protobuf:"bytes,6,rep,name=property,proto3" json:"property" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 坐骑属性 +} + +func (x *DBDragon) Reset() { + *x = DBDragon{} + if protoimpl.UnsafeEnabled { + mi := &file_dragon_dragon_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBDragon) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBDragon) ProtoMessage() {} + +func (x *DBDragon) ProtoReflect() protoreflect.Message { + mi := &file_dragon_dragon_db_proto_msgTypes[0] + 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 DBDragon.ProtoReflect.Descriptor instead. +func (*DBDragon) Descriptor() ([]byte, []int) { + return file_dragon_dragon_db_proto_rawDescGZIP(), []int{0} +} + +func (x *DBDragon) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBDragon) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBDragon) GetDragonid() string { + if x != nil { + return x.Dragonid + } + return "" +} + +func (x *DBDragon) GetLv() int32 { + if x != nil { + return x.Lv + } + return 0 +} + +func (x *DBDragon) GetExp() int32 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *DBDragon) GetProperty() map[int32]int32 { + if x != nil { + return x.Property + } + return nil +} + +type DBDragonExpand struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` + Rtime int64 `protobuf:"varint,3,opt,name=rtime,proto3" json:"rtime"` // 刷新时间 + Play map[string]int32 `protobuf:"bytes,4,rep,name=play,proto3" json:"play" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 坐骑训练次数 +} + +func (x *DBDragonExpand) Reset() { + *x = DBDragonExpand{} + if protoimpl.UnsafeEnabled { + mi := &file_dragon_dragon_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBDragonExpand) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBDragonExpand) ProtoMessage() {} + +func (x *DBDragonExpand) ProtoReflect() protoreflect.Message { + mi := &file_dragon_dragon_db_proto_msgTypes[1] + 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 DBDragonExpand.ProtoReflect.Descriptor instead. +func (*DBDragonExpand) Descriptor() ([]byte, []int) { + return file_dragon_dragon_db_proto_rawDescGZIP(), []int{1} +} + +func (x *DBDragonExpand) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBDragonExpand) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBDragonExpand) GetRtime() int64 { + if x != nil { + return x.Rtime + } + return 0 +} + +func (x *DBDragonExpand) GetPlay() map[string]int32 { + if x != nil { + return x.Play + } + return nil +} + +var File_dragon_dragon_db_proto protoreflect.FileDescriptor + +var file_dragon_dragon_db_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x5f, + 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x44, + 0x72, 0x61, 0x67, 0x6f, 0x6e, 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, 0x1a, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x67, 0x6f, + 0x6e, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x72, 0x61, 0x67, 0x6f, + 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42, 0x44, 0x72, 0x61, 0x67, + 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb0, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x44, 0x72, + 0x61, 0x67, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 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, 0x14, 0x0a, 0x05, + 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x44, 0x42, 0x44, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x61, 0x6e, + 0x64, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x70, 0x6c, 0x61, + 0x79, 0x1a, 0x37, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_dragon_dragon_db_proto_rawDescOnce sync.Once + file_dragon_dragon_db_proto_rawDescData = file_dragon_dragon_db_proto_rawDesc +) + +func file_dragon_dragon_db_proto_rawDescGZIP() []byte { + file_dragon_dragon_db_proto_rawDescOnce.Do(func() { + file_dragon_dragon_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_dragon_dragon_db_proto_rawDescData) + }) + return file_dragon_dragon_db_proto_rawDescData +} + +var file_dragon_dragon_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_dragon_dragon_db_proto_goTypes = []interface{}{ + (*DBDragon)(nil), // 0: DBDragon + (*DBDragonExpand)(nil), // 1: DBDragonExpand + nil, // 2: DBDragon.PropertyEntry + nil, // 3: DBDragonExpand.PlayEntry +} +var file_dragon_dragon_db_proto_depIdxs = []int32{ + 2, // 0: DBDragon.property:type_name -> DBDragon.PropertyEntry + 3, // 1: DBDragonExpand.play:type_name -> DBDragonExpand.PlayEntry + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_dragon_dragon_db_proto_init() } +func file_dragon_dragon_db_proto_init() { + if File_dragon_dragon_db_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dragon_dragon_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBDragon); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dragon_dragon_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBDragonExpand); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_dragon_dragon_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_dragon_dragon_db_proto_goTypes, + DependencyIndexes: file_dragon_dragon_db_proto_depIdxs, + MessageInfos: file_dragon_dragon_db_proto_msgTypes, + }.Build() + File_dragon_dragon_db_proto = out.File + file_dragon_dragon_db_proto_rawDesc = nil + file_dragon_dragon_db_proto_goTypes = nil + file_dragon_dragon_db_proto_depIdxs = nil +} diff --git a/pb/dragon_msg.pb.go b/pb/dragon_msg.pb.go new file mode 100644 index 000000000..dc6f58bfa --- /dev/null +++ b/pb/dragon_msg.pb.go @@ -0,0 +1,363 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: dragon/dragon_msg.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +//获取坐骑的基本信息 +type DragonGetListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DragonGetListReq) Reset() { + *x = DragonGetListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_dragon_dragon_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DragonGetListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DragonGetListReq) ProtoMessage() {} + +func (x *DragonGetListReq) ProtoReflect() protoreflect.Message { + mi := &file_dragon_dragon_msg_proto_msgTypes[0] + 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 DragonGetListReq.ProtoReflect.Descriptor instead. +func (*DragonGetListReq) Descriptor() ([]byte, []int) { + return file_dragon_dragon_msg_proto_rawDescGZIP(), []int{0} +} + +type DragonGetListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dragons []*DBDragon `protobuf:"bytes,1,rep,name=dragons,proto3" json:"dragons"` + Expand *DBDragonExpand `protobuf:"bytes,2,opt,name=expand,proto3" json:"expand"` +} + +func (x *DragonGetListResp) Reset() { + *x = DragonGetListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_dragon_dragon_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DragonGetListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DragonGetListResp) ProtoMessage() {} + +func (x *DragonGetListResp) ProtoReflect() protoreflect.Message { + mi := &file_dragon_dragon_msg_proto_msgTypes[1] + 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 DragonGetListResp.ProtoReflect.Descriptor instead. +func (*DragonGetListResp) Descriptor() ([]byte, []int) { + return file_dragon_dragon_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *DragonGetListResp) GetDragons() []*DBDragon { + if x != nil { + return x.Dragons + } + return nil +} + +func (x *DragonGetListResp) GetExpand() *DBDragonExpand { + if x != nil { + return x.Expand + } + return nil +} + +// 训练 +type DragonTrainReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid"` + Ttype int32 `protobuf:"varint,2,opt,name=ttype,proto3" json:"ttype"` // 训练类型 +} + +func (x *DragonTrainReq) Reset() { + *x = DragonTrainReq{} + if protoimpl.UnsafeEnabled { + mi := &file_dragon_dragon_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DragonTrainReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DragonTrainReq) ProtoMessage() {} + +func (x *DragonTrainReq) ProtoReflect() protoreflect.Message { + mi := &file_dragon_dragon_msg_proto_msgTypes[2] + 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 DragonTrainReq.ProtoReflect.Descriptor instead. +func (*DragonTrainReq) Descriptor() ([]byte, []int) { + return file_dragon_dragon_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *DragonTrainReq) GetOid() string { + if x != nil { + return x.Oid + } + return "" +} + +func (x *DragonTrainReq) GetTtype() int32 { + if x != nil { + return x.Ttype + } + return 0 +} + +// 训练结果 +type DragonTrainResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dragons *DBDragon `protobuf:"bytes,1,opt,name=dragons,proto3" json:"dragons"` + Expand *DBDragonExpand `protobuf:"bytes,2,opt,name=expand,proto3" json:"expand"` +} + +func (x *DragonTrainResp) Reset() { + *x = DragonTrainResp{} + if protoimpl.UnsafeEnabled { + mi := &file_dragon_dragon_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DragonTrainResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DragonTrainResp) ProtoMessage() {} + +func (x *DragonTrainResp) ProtoReflect() protoreflect.Message { + mi := &file_dragon_dragon_msg_proto_msgTypes[3] + 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 DragonTrainResp.ProtoReflect.Descriptor instead. +func (*DragonTrainResp) Descriptor() ([]byte, []int) { + return file_dragon_dragon_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *DragonTrainResp) GetDragons() *DBDragon { + if x != nil { + return x.Dragons + } + return nil +} + +func (x *DragonTrainResp) GetExpand() *DBDragonExpand { + if x != nil { + return x.Expand + } + return nil +} + +var File_dragon_dragon_msg_proto protoreflect.FileDescriptor + +var file_dragon_dragon_msg_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x5f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x64, 0x72, 0x61, 0x67, 0x6f, + 0x6e, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x44, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x61, 0x0a, 0x11, 0x44, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x47, + 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x07, 0x64, 0x72, + 0x61, 0x67, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, + 0x44, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x52, 0x07, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x73, 0x12, + 0x27, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x44, 0x42, 0x44, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, + 0x52, 0x06, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x22, 0x38, 0x0a, 0x0e, 0x44, 0x72, 0x61, 0x67, + 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x74, 0x79, + 0x70, 0x65, 0x22, 0x5f, 0x0a, 0x0f, 0x44, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x07, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x44, 0x72, 0x61, 0x67, 0x6f, + 0x6e, 0x52, 0x07, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x06, 0x65, 0x78, + 0x70, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x44, + 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x52, 0x06, 0x65, 0x78, 0x70, + 0x61, 0x6e, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_dragon_dragon_msg_proto_rawDescOnce sync.Once + file_dragon_dragon_msg_proto_rawDescData = file_dragon_dragon_msg_proto_rawDesc +) + +func file_dragon_dragon_msg_proto_rawDescGZIP() []byte { + file_dragon_dragon_msg_proto_rawDescOnce.Do(func() { + file_dragon_dragon_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_dragon_dragon_msg_proto_rawDescData) + }) + return file_dragon_dragon_msg_proto_rawDescData +} + +var file_dragon_dragon_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_dragon_dragon_msg_proto_goTypes = []interface{}{ + (*DragonGetListReq)(nil), // 0: DragonGetListReq + (*DragonGetListResp)(nil), // 1: DragonGetListResp + (*DragonTrainReq)(nil), // 2: DragonTrainReq + (*DragonTrainResp)(nil), // 3: DragonTrainResp + (*DBDragon)(nil), // 4: DBDragon + (*DBDragonExpand)(nil), // 5: DBDragonExpand +} +var file_dragon_dragon_msg_proto_depIdxs = []int32{ + 4, // 0: DragonGetListResp.dragons:type_name -> DBDragon + 5, // 1: DragonGetListResp.expand:type_name -> DBDragonExpand + 4, // 2: DragonTrainResp.dragons:type_name -> DBDragon + 5, // 3: DragonTrainResp.expand:type_name -> DBDragonExpand + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_dragon_dragon_msg_proto_init() } +func file_dragon_dragon_msg_proto_init() { + if File_dragon_dragon_msg_proto != nil { + return + } + file_dragon_dragon_db_proto_init() + if !protoimpl.UnsafeEnabled { + file_dragon_dragon_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DragonGetListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dragon_dragon_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DragonGetListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dragon_dragon_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DragonTrainReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dragon_dragon_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DragonTrainResp); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_dragon_dragon_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_dragon_dragon_msg_proto_goTypes, + DependencyIndexes: file_dragon_dragon_msg_proto_depIdxs, + MessageInfos: file_dragon_dragon_msg_proto_msgTypes, + }.Build() + File_dragon_dragon_msg_proto = out.File + file_dragon_dragon_msg_proto_rawDesc = nil + file_dragon_dragon_msg_proto_goTypes = nil + file_dragon_dragon_msg_proto_depIdxs = nil +} diff --git a/sys/configure/structs/Game.DragonPlay.go b/sys/configure/structs/Game.DragonPlay.go new file mode 100644 index 000000000..129004d51 --- /dev/null +++ b/sys/configure/structs/Game.DragonPlay.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type GameDragonPlay struct { + _dataMap map[int32]*GameDragonPlayData + _dataList []*GameDragonPlayData +} + +func NewGameDragonPlay(_buf []map[string]interface{}) (*GameDragonPlay, error) { + _dataList := make([]*GameDragonPlayData, 0, len(_buf)) + dataMap := make(map[int32]*GameDragonPlayData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameDragonPlayData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &GameDragonPlay{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameDragonPlay) GetDataMap() map[int32]*GameDragonPlayData { + return table._dataMap +} + +func (table *GameDragonPlay) GetDataList() []*GameDragonPlayData { + return table._dataList +} + +func (table *GameDragonPlay) Get(key int32) *GameDragonPlayData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.DragonPlayData.go b/sys/configure/structs/Game.DragonPlayData.go new file mode 100644 index 000000000..011621523 --- /dev/null +++ b/sys/configure/structs/Game.DragonPlayData.go @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type GameDragonPlayData struct { + Key int32 + Id string + Grow int32 + Type int32 + Exp int32 + Time int32 + Group int32 +} + +const TypeId_GameDragonPlayData = 511267245 + +func (*GameDragonPlayData) GetTypeId() int32 { + return 511267245 +} + +func (_v *GameDragonPlayData)Deserialize(_buf map[string]interface{}) (err error) { + { 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; if _v.Id, _ok_ = _buf["id"].(string); !_ok_ { err = errors.New("id error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["grow"].(float64); !_ok_ { err = errors.New("grow error"); return }; _v.Grow = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["exp"].(float64); !_ok_ { err = errors.New("exp error"); return }; _v.Exp = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time"].(float64); !_ok_ { err = errors.New("time error"); return }; _v.Time = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) } + return +} + +func DeserializeGameDragonPlayData(_buf map[string]interface{}) (*GameDragonPlayData, error) { + v := &GameDragonPlayData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Game.DragonPlot.go b/sys/configure/structs/Game.DragonPlot.go new file mode 100644 index 000000000..920603fd6 --- /dev/null +++ b/sys/configure/structs/Game.DragonPlot.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type GameDragonPlot struct { + _dataMap map[int32]*GameDragonPlotData + _dataList []*GameDragonPlotData +} + +func NewGameDragonPlot(_buf []map[string]interface{}) (*GameDragonPlot, error) { + _dataList := make([]*GameDragonPlotData, 0, len(_buf)) + dataMap := make(map[int32]*GameDragonPlotData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameDragonPlotData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &GameDragonPlot{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameDragonPlot) GetDataMap() map[int32]*GameDragonPlotData { + return table._dataMap +} + +func (table *GameDragonPlot) GetDataList() []*GameDragonPlotData { + return table._dataList +} + +func (table *GameDragonPlot) Get(key int32) *GameDragonPlotData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.DragonPlotData.go b/sys/configure/structs/Game.DragonPlotData.go new file mode 100644 index 000000000..cd9d0e6de --- /dev/null +++ b/sys/configure/structs/Game.DragonPlotData.go @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type GameDragonPlotData struct { + Key int32 + Group int32 + Plot int32 + Pic string + Describe string +} + +const TypeId_GameDragonPlotData = 907457754 + +func (*GameDragonPlotData) GetTypeId() int32 { + return 907457754 +} + +func (_v *GameDragonPlotData)Deserialize(_buf map[string]interface{}) (err error) { + { 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["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["plot"].(float64); !_ok_ { err = errors.New("plot error"); return }; _v.Plot = int32(_tempNum_) } + { var _ok_ bool; if _v.Pic, _ok_ = _buf["pic"].(string); !_ok_ { err = errors.New("pic error"); return } } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["describe"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Describe error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Describe, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } + return +} + +func DeserializeGameDragonPlotData(_buf map[string]interface{}) (*GameDragonPlotData, error) { + v := &GameDragonPlotData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Game.Trainlv.go b/sys/configure/structs/Game.Trainlv.go new file mode 100644 index 000000000..99c861f64 --- /dev/null +++ b/sys/configure/structs/Game.Trainlv.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type GameTrainlv struct { + _dataMap map[int32]*GameTrainlvData + _dataList []*GameTrainlvData +} + +func NewGameTrainlv(_buf []map[string]interface{}) (*GameTrainlv, error) { + _dataList := make([]*GameTrainlvData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrainlvData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTrainlvData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &GameTrainlv{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrainlv) GetDataMap() map[int32]*GameTrainlvData { + return table._dataMap +} + +func (table *GameTrainlv) GetDataList() []*GameTrainlvData { + return table._dataList +} + +func (table *GameTrainlv) Get(key int32) *GameTrainlvData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TrainlvData.go b/sys/configure/structs/Game.TrainlvData.go new file mode 100644 index 000000000..462c8ab9e --- /dev/null +++ b/sys/configure/structs/Game.TrainlvData.go @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type GameTrainlvData struct { + Key int32 + Id string + Type int32 + Lv int32 + Exp int32 + Etime int32 + Reward []*Gameatn +} + +const TypeId_GameTrainlvData = 696548448 + +func (*GameTrainlvData) GetTypeId() int32 { + return 696548448 +} + +func (_v *GameTrainlvData)Deserialize(_buf map[string]interface{}) (err error) { + { 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; if _v.Id, _ok_ = _buf["id"].(string); !_ok_ { err = errors.New("id error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lv"].(float64); !_ok_ { err = errors.New("lv error"); return }; _v.Lv = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["exp"].(float64); !_ok_ { err = errors.New("exp error"); return }; _v.Exp = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["etime"].(float64); !_ok_ { err = errors.New("etime error"); return }; _v.Etime = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["reward"].([]interface{}); !_ok_ { err = errors.New("reward error"); return } + + _v.Reward = make([]*Gameatn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Gameatn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } + _v.Reward = append(_v.Reward, _list_v_) + } + } + + return +} + +func DeserializeGameTrainlvData(_buf map[string]interface{}) (*GameTrainlvData, error) { + v := &GameTrainlvData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go index 3b24ce1c4..141f8ca94 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -253,6 +253,9 @@ type Tables struct { TopUIConfig *GameTopUIConfig MainShopItem *GameMainShopItem MainAchievement *GameMainAchievement + Trainlv *GameTrainlv + DragonPlay *GameDragonPlay + DragonPlot *GameDragonPlot } func NewTables(loader JsonLoader) (*Tables, error) { @@ -1712,5 +1715,23 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.MainAchievement, err = NewGameMainAchievement(buf) ; err != nil { return nil, err } + if buf, err = loader("game_trainlv") ; err != nil { + return nil, err + } + if tables.Trainlv, err = NewGameTrainlv(buf) ; err != nil { + return nil, err + } + if buf, err = loader("game_dragonplay") ; err != nil { + return nil, err + } + if tables.DragonPlay, err = NewGameDragonPlay(buf) ; err != nil { + return nil, err + } + if buf, err = loader("game_dragonplot") ; err != nil { + return nil, err + } + if tables.DragonPlot, err = NewGameDragonPlot(buf) ; err != nil { + return nil, err + } return tables, nil }