diff --git a/bin/json/game_trollcoefficient.json b/bin/json/game_trollcoefficient.json new file mode 100644 index 000000000..7e9555459 --- /dev/null +++ b/bin/json/game_trollcoefficient.json @@ -0,0 +1,50 @@ +[ + { + "id": 1, + "coefficient": "1012" + }, + { + "id": 2, + "coefficient": "1024" + }, + { + "id": 3, + "coefficient": "1036" + }, + { + "id": 4, + "coefficient": "1048" + }, + { + "id": 5, + "coefficient": "1060" + }, + { + "id": 6, + "coefficient": "1072" + }, + { + "id": 7, + "coefficient": "900" + }, + { + "id": 8, + "coefficient": "888" + }, + { + "id": 9, + "coefficient": "876" + }, + { + "id": 10, + "coefficient": "864" + }, + { + "id": 11, + "coefficient": "852" + }, + { + "id": 12, + "coefficient": "840" + } +] \ No newline at end of file diff --git a/bin/json/game_trollgoods.json b/bin/json/game_trollgoods.json new file mode 100644 index 000000000..016d52dc0 --- /dev/null +++ b/bin/json/game_trollgoods.json @@ -0,0 +1,110 @@ +[ + { + "id": 1, + "goodsname": "物品1", + "goodsfor": 1, + "goodsinfor": "物品1货品信息", + "goodsicon": "clmsg_ll_01", + "goodsprice": 2000, + "star_money": 12000, + "uptext": "物品1up", + "suptext": "物品1sup", + "max": 40 + }, + { + "id": 2, + "goodsname": "物品2", + "goodsfor": 1, + "goodsinfor": "物品2货品信息", + "goodsicon": "clmsg_ll_02", + "goodsprice": 2000, + "star_money": 13000, + "uptext": "物品2up", + "suptext": "物品2sup", + "max": 40 + }, + { + "id": 3, + "goodsname": "物品3", + "goodsfor": 1, + "goodsinfor": "物品3货品信息", + "goodsicon": "clmsg_ll_03", + "goodsprice": 2000, + "star_money": 14000, + "uptext": "物品3up", + "suptext": "物品3sup", + "max": 40 + }, + { + "id": 4, + "goodsname": "物品4", + "goodsfor": 2, + "goodsinfor": "物品4货品信息", + "goodsicon": "clmsg_ll_04", + "goodsprice": 2000, + "star_money": 11000, + "uptext": "物品4up", + "suptext": "物品4sup", + "max": 40 + }, + { + "id": 5, + "goodsname": "物品5", + "goodsfor": 2, + "goodsinfor": "物品5货品信息", + "goodsicon": "clmsg_ll_05", + "goodsprice": 2000, + "star_money": 1000, + "uptext": "物品5up", + "suptext": "物品5sup", + "max": 30 + }, + { + "id": 6, + "goodsname": "物品6", + "goodsfor": 2, + "goodsinfor": "物品6货品信息", + "goodsicon": "wp_icon_0003", + "goodsprice": 2000, + "star_money": 2000, + "uptext": "物品6up", + "suptext": "物品6sup", + "max": 30 + }, + { + "id": 7, + "goodsname": "物品7", + "goodsfor": 3, + "goodsinfor": "物品7货品信息", + "goodsicon": "wp_icon_10002", + "goodsprice": 2000, + "star_money": 1000, + "uptext": "物品7up", + "suptext": "物品7sup", + "max": 30 + }, + { + "id": 8, + "goodsname": "物品8", + "goodsfor": 3, + "goodsinfor": "物品8货品信息", + "goodsicon": "wp_icon_10012", + "goodsprice": 2000, + "star_money": 3000, + "uptext": "物品8up", + "suptext": "物品8sup", + "max": 30 + }, + { + "id": 9, + "goodsname": "物品9", + "goodsfor": 3, + "goodsinfor": "物品9货品信息", + "goodsicon": "wp_icon_10014", + "goodsprice": 2000, + "star_money": 4000, + "uptext": "物品9up", + "suptext": "物品9sup", + "max": 30 + } +] \ No newline at end of file diff --git a/bin/json/game_trolllv.json b/bin/json/game_trolllv.json new file mode 100644 index 000000000..a91cdac12 --- /dev/null +++ b/bin/json/game_trolllv.json @@ -0,0 +1,128 @@ +[ + { + "lv": 1, + "money": 10000, + "reword": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "item", + "t": "30001", + "n": 2 + } + ], + "model": [ + "14007", + "25001", + "45001" + ] + }, + { + "lv": 2, + "money": 20000, + "reword": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "item", + "t": "30001", + "n": 2 + } + ], + "model": [ + "14007", + "25001", + "45001" + ] + }, + { + "lv": 3, + "money": 30000, + "reword": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "item", + "t": "30001", + "n": 2 + } + ], + "model": [ + "14007", + "25001", + "45001" + ] + }, + { + "lv": 4, + "money": 40000, + "reword": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "item", + "t": "30001", + "n": 2 + } + ], + "model": [ + "14007", + "25001", + "45001" + ] + }, + { + "lv": 5, + "money": 50000, + "reword": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "item", + "t": "30001", + "n": 2 + } + ], + "model": [ + "14007", + "25001", + "45001" + ] + }, + { + "lv": 6, + "money": 60000, + "reword": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "item", + "t": "30001", + "n": 2 + } + ], + "model": [ + "14007", + "25001", + "45001" + ] + } +] \ No newline at end of file diff --git a/bin/json/game_trollrule.json b/bin/json/game_trollrule.json new file mode 100644 index 000000000..965fb03e6 --- /dev/null +++ b/bin/json/game_trollrule.json @@ -0,0 +1,38 @@ +[ + { + "id": 1, + "quantity": "5" + }, + { + "id": 2, + "quantity": "20" + }, + { + "id": 3, + "quantity": "40" + }, + { + "id": 4, + "quantity": "20" + }, + { + "id": 5, + "quantity": "300" + }, + { + "id": 6, + "quantity": "1020" + }, + { + "id": 7, + "quantity": "980" + }, + { + "id": 8, + "quantity": "5" + }, + { + "id": 9, + "quantity": "1500" + } +] \ No newline at end of file diff --git a/bin/json/game_trolltrain.json b/bin/json/game_trolltrain.json new file mode 100644 index 000000000..f0b1873b5 --- /dev/null +++ b/bin/json/game_trolltrain.json @@ -0,0 +1,23 @@ +[ + { + "id": 1, + "name": "右屏商人", + "information": "这是一位熊猫商人", + "ico": "action_11001", + "time": 300 + }, + { + "id": 2, + "name": "上屏商人", + "information": "这是一位波比商人再此", + "ico": "action_11003", + "time": 300 + }, + { + "id": 3, + "name": "左屏商人", + "information": "这是一位滑板鞋王子", + "ico": "ytx_js_14007", + "time": 300 + } +] \ No newline at end of file diff --git a/comm/const.go b/comm/const.go index dad1dad6c..530e5b884 100644 --- a/comm/const.go +++ b/comm/const.go @@ -63,6 +63,7 @@ const ( ModuleBattle core.M_Modules = "battle" //战斗 ModuleLibrary core.M_Modules = "library" //藏书馆 ModuleArena core.M_Modules = "arena" //竞技场 + ModuleTroll core.M_Modules = "troll" //巨怪商队 //ModuleFetter core.M_Modules = "herofetter" //好友模块 ) @@ -158,6 +159,7 @@ const ( TableArenaRank = "arenarank" //排名 // 天赋 TableTalent = "herotalent" + TableTroll = "trolltrain" ) //RPC服务接口定义处 diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index d54a4554d..9c4d88421 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -5,6 +5,7 @@ import ( "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" "go_dreamfactory/sys/db" + "time" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" @@ -186,6 +187,21 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal conn.Mgo.InsertOne(comm.TableSeasonRecord, newData) } } + var dbModel *db.DBModel + if !this.module.IsCross() { + if dbModel, err = this.module.GetDBNoduleByUid(session.GetUserId(), comm.TableSeasonRecord, time.Hour); err == nil { + if err = dbModel.Add(session.GetUserId(), newData); err != nil { + this.module.Errorf("err:%v", err) + } + // 同步zset + + } + } else { + if err = this.module.modelPagoda.Add(session.GetUserId(), newData); err != nil { + this.module.Errorf("err:%v", err) + return + } + } //this.module.modulerank.addPagodaRankList(session, seasonPagoda, req.Report.Info.Redflist[0].Leadpos, sz, req.Report.Costtime) } diff --git a/modules/pagoda/api_getlist.go b/modules/pagoda/api_getlist.go index 1009e57b0..95b326918 100644 --- a/modules/pagoda/api_getlist.go +++ b/modules/pagoda/api_getlist.go @@ -1,10 +1,13 @@ package pagoda import ( + "context" "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/redis/pipe" "go_dreamfactory/pb" "go_dreamfactory/sys/db" + "github.com/go-redis/redis/v8" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "google.golang.org/protobuf/proto" @@ -12,7 +15,50 @@ import ( //参数校验 func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode) { + uid := session.GetUserId() + if !this.module.IsCross() { + if conn, err := db.Cross(); err == nil { + //userinfo := this.module.ModuleUser.GetUser(session.GetUserId()) + // newData := &pb.DBPagodaRecord{ + // Id: primitive.NewObjectID().Hex(), + // Uid: session.GetUserId(), + // PagodaId: 111, + // Type: 201, + // Nickname: userinfo.Name, + // Icon: "", // icon 暂无 + // Lv: userinfo.Lv, + // CostTime: 1002, + // } + //conn.Mgo.InsertOne(comm.TablePagodaRecord, newData) + var ( + pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO()) + menbers *redis.Z + ) + + menbers = &redis.Z{Score: float64(500), Member: uid} + + if cmd := pipe.ZAdd("pagodaList", menbers); cmd != nil { + this.module.Errorln(err) + + dock, err1 := cmd.Result() + this.module.Errorln(dock, err1) + } + if _, err = pipe.Exec(); err != nil { + this.module.Errorln(err) + return + } + //rd := pipe.ZRevRank("pagodaList", "dfmxf_6358f3f1375f6a340a12e2ab01234567") + rd := pipe.ZRange("pagodaList", 1, 5) + if _, err = pipe.Exec(); err != nil { + this.module.Errorln(err) + return + } + _data3 := rd.Val() + _data, err2 := rd.Result() + this.module.Errorln(_data, err2, _data3) + } + } return } diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index adc46ee79..124d89548 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -1,12 +1,17 @@ package pagoda import ( + "context" "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" + "go_dreamfactory/lego/sys/redis/pipe" "go_dreamfactory/modules" "go_dreamfactory/pb" + "go_dreamfactory/sys/db" + + "github.com/go-redis/redis/v8" ) type Pagoda struct { @@ -108,3 +113,39 @@ func (this *Pagoda) CleanSeasonPagodaData() (code pb.ErrorCode) { return } + +func (this *Pagoda) SetPagodaRank(tableName string, time int32, uid string) (err error) { + + if !this.IsCross() { + if conn, err1 := db.Cross(); err1 == nil { + var ( + pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO()) + menbers *redis.Z + ) + + menbers = &redis.Z{Score: float64(time), Member: uid} + + if cmd := pipe.ZAdd(tableName, menbers); cmd != nil { + this.Errorln(err) + + dock, err := cmd.Result() + this.Errorln(dock, err) + } + if _, err = pipe.Exec(); err != nil { + this.Errorln(err) + return + } + //rd := pipe.ZRevRank("pagodaList", "dfmxf_6358f3f1375f6a340a12e2ab01234567") + rd := pipe.ZRange("pagodaList", 1, 5) + if _, err = pipe.Exec(); err != nil { + this.Errorln(err) + return + } + _data3 := rd.Val() + _data, err2 := rd.Result() + this.Errorln(_data, err2, _data3) + return + } + } + return +} diff --git a/modules/troll/api.go b/modules/troll/api.go new file mode 100644 index 000000000..fdaa51db2 --- /dev/null +++ b/modules/troll/api.go @@ -0,0 +1,35 @@ +package troll + +import ( + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +const ( + TrollGetListResp = "getlist" + GourmetCreateOrderResp = "createorder" + GourmetSkillLvResp = "skilllv" + TrollNpcRewardResp = "npcreward" + GourmetGetRandUserResp = "getranduser" +) + +type apiComp struct { + modules.MCompGate + service core.IService + configure *configureComp + module *Troll +} + +//组件初始化接口 +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.(*Troll) + this.service = service + return +} + +func (this *apiComp) Start() (err error) { + err = this.MCompGate.Start() + + return +} diff --git a/modules/troll/api_getReward.go b/modules/troll/api_getReward.go new file mode 100644 index 000000000..1fd024f0b --- /dev/null +++ b/modules/troll/api_getReward.go @@ -0,0 +1,27 @@ +package troll + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.TrollNpcRewardReq) (code pb.ErrorCode) { + + return +} + +///美食城领取奖励 +func (this *apiComp) GetReward(session comm.IUserSession, req *pb.TrollNpcRewardReq) (code pb.ErrorCode, data proto.Message) { + code = this.GetRewardCheck(session, req) + _troll, err := this.module.modelTroll.getTrollList(session.GetUserId()) + if err != nil { + code = pb.ErrorCode_DBError + return + } + + session.SendMsg(string(this.module.GetType()), TrollNpcRewardResp, &pb.TrollNpcRewardResp{Data: _troll}) + return +} diff --git a/modules/troll/api_getlist.go b/modules/troll/api_getlist.go new file mode 100644 index 000000000..d8bed52e4 --- /dev/null +++ b/modules/troll/api_getlist.go @@ -0,0 +1,35 @@ +package troll + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + "time" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.TrollGetListReq) (code pb.ErrorCode) { + + return +} + +///获取美食城基本信息 +func (this *apiComp) GetList(session comm.IUserSession, req *pb.TrollGetListReq) (code pb.ErrorCode, data proto.Message) { + + code = this.GetListCheck(session, req) + if code != pb.ErrorCode_Success { + return // 参数校验失败直接返回 + } + _gourmet, err := this.module.modelTroll.getTrollList(session.GetUserId()) + if err != nil { + code = pb.ErrorCode_DBError + return + } + if _gourmet.Ctime == 0 { + _gourmet.Ctime = time.Now().Unix() + } + + session.SendMsg(string(this.module.GetType()), TrollGetListResp, &pb.TrollGetListResp{Data: _gourmet}) + return +} diff --git a/modules/troll/comp_configure.go b/modules/troll/comp_configure.go new file mode 100644 index 000000000..fc6543feb --- /dev/null +++ b/modules/troll/comp_configure.go @@ -0,0 +1,84 @@ +package troll + +import ( + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/modules" + "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" + "sync" +) + +const ( + game_gourmet = "game_gourmet.json" + game_gourmetskill = "game_gourmetskill.json" +) + +///配置管理基础组件 +type configureComp struct { + hlock sync.RWMutex + modules.MCompConfigure + _gourmetMap map[int64]*cfg.GameGourmetData +} + +//组件初始化接口 +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._gourmetMap = make(map[int64]*cfg.GameGourmetData, 0) + configure.RegisterConfigure(game_gourmet, cfg.NewGameGourmet, func() { + if v, err := this.GetConfigure(game_gourmet); err == nil { + if configure, ok := v.(*cfg.GameGourmet); ok { + this.hlock.Lock() + defer this.hlock.Unlock() + for _, value := range configure.GetDataList() { + this._gourmetMap[int64(value.Type<<16)+int64(value.Level)] = value + } + return + } + } + log.Errorf("get game_pagoda conf err:%v", err) + return + }) + + return +} + +// 获取美食馆配置数据 +func (this *configureComp) GetGourmetConfigData(gourmetType int32, level int32) (data *cfg.GameGourmetData) { + + return this._gourmetMap[int64(gourmetType<<16)+int64(level)] +} + +//加载多个配置文件 +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) GetGourmetSkillConfigBySkillType(skillType int32) (data []int32) { + data = make([]int32, 0) + if v, err := this.GetConfigure(game_gourmet); err == nil { + if configure, ok := v.(*cfg.GameGourmet); ok { + this.hlock.Lock() + defer this.hlock.Unlock() + for _, value := range configure.GetDataList() { + if value.SkillType == skillType && value.Initial == 1 { + data = append(data, value.Type) + } + } + return + } + } + return +} diff --git a/modules/troll/model_gourmet.go b/modules/troll/model_gourmet.go new file mode 100644 index 000000000..606e87a1f --- /dev/null +++ b/modules/troll/model_gourmet.go @@ -0,0 +1,40 @@ +package troll + +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 modelTroll struct { + modules.MCompModel + module *Troll +} + +func (this *modelTroll) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = string(comm.TableTroll) + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Troll) + // uid 创建索引 + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +func (this *modelTroll) getTrollList(uid string) (result *pb.DBTrollTrain, err error) { + result = &pb.DBTrollTrain{} + if err = this.Get(uid, result); err != nil { + + return + } + err = nil + return result, err +} +func (this *modelTroll) modifyTrollDataByObjId(uid string, data map[string]interface{}) error { + return this.Change(uid, data) +} diff --git a/modules/troll/module.go b/modules/troll/module.go new file mode 100644 index 000000000..b799045a3 --- /dev/null +++ b/modules/troll/module.go @@ -0,0 +1,50 @@ +/* +模块名:Troll +描述:巨怪商队 +开发:梅雄风 +*/ +package troll + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" +) + +type Troll struct { + modules.ModuleBase + modelTroll *modelTroll + api *apiComp + configure *configureComp +} + +func NewModule() core.IModule { + return &Troll{} +} + +func (this *Troll) GetType() core.M_Modules { + return comm.ModuleTroll +} + +func (this *Troll) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { + err = this.ModuleBase.Init(service, module, options) + + return +} + +func (this *Troll) OnInstallComp() { + this.ModuleBase.OnInstallComp() + this.api = this.RegisterComp(new(apiComp)).(*apiComp) + this.modelTroll = this.RegisterComp(new(modelTroll)).(*modelTroll) + this.configure = this.RegisterComp(new(configureComp)).(*configureComp) +} + +// 接口信息 +func (this *Troll) ModifyTrollData(uid string, data map[string]interface{}) (code pb.ErrorCode) { + err := this.modelTroll.modifyTrollDataByObjId(uid, data) + if err != nil { + code = pb.ErrorCode_DBError + } + return +} diff --git a/pb/troll_db.pb.go b/pb/troll_db.pb.go new file mode 100644 index 000000000..165a4e500 --- /dev/null +++ b/pb/troll_db.pb.go @@ -0,0 +1,261 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: troll/troll_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 DBTrollTrain 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" bson:"uid"` //用户ID + Items map[int32]int32 `protobuf:"bytes,3,rep,name=items,proto3" json:"items" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 货物 + GridNum int32 `protobuf:"varint,4,opt,name=gridNum,proto3" json:"gridNum" bson:"gridNum"` //当前使用格子数量 + TarinPos int32 `protobuf:"varint,5,opt,name=tarinPos,proto3" json:"tarinPos" bson:"tarinPos"` //火车位置 + RangeId int32 `protobuf:"varint,6,opt,name=rangeId,proto3" json:"rangeId" bson:"rangeId"` //增长幅度 + Buy int32 `protobuf:"varint,7,opt,name=buy,proto3" json:"buy"` // 挂机进货标准/千分比 + Sell int32 `protobuf:"varint,8,opt,name=sell,proto3" json:"sell"` //挂机卖出标准/千分比 + NpcLv int32 `protobuf:"varint,9,opt,name=npcLv,proto3" json:"npcLv" bson:"npcLv"` //npc 等级 + NpcReward map[int32]int32 `protobuf:"bytes,10,rep,name=npcReward,proto3" json:"npcReward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"npcReward"` //npc奖励 + TotalEarn int64 `protobuf:"varint,11,opt,name=totalEarn,proto3" json:"totalEarn" bson:"totalEarn"` //累计赚的钱 + Ctime int64 `protobuf:"varint,12,opt,name=ctime,proto3" json:"ctime"` +} + +func (x *DBTrollTrain) Reset() { + *x = DBTrollTrain{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBTrollTrain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBTrollTrain) ProtoMessage() {} + +func (x *DBTrollTrain) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_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 DBTrollTrain.ProtoReflect.Descriptor instead. +func (*DBTrollTrain) Descriptor() ([]byte, []int) { + return file_troll_troll_db_proto_rawDescGZIP(), []int{0} +} + +func (x *DBTrollTrain) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBTrollTrain) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBTrollTrain) GetItems() map[int32]int32 { + if x != nil { + return x.Items + } + return nil +} + +func (x *DBTrollTrain) GetGridNum() int32 { + if x != nil { + return x.GridNum + } + return 0 +} + +func (x *DBTrollTrain) GetTarinPos() int32 { + if x != nil { + return x.TarinPos + } + return 0 +} + +func (x *DBTrollTrain) GetRangeId() int32 { + if x != nil { + return x.RangeId + } + return 0 +} + +func (x *DBTrollTrain) GetBuy() int32 { + if x != nil { + return x.Buy + } + return 0 +} + +func (x *DBTrollTrain) GetSell() int32 { + if x != nil { + return x.Sell + } + return 0 +} + +func (x *DBTrollTrain) GetNpcLv() int32 { + if x != nil { + return x.NpcLv + } + return 0 +} + +func (x *DBTrollTrain) GetNpcReward() map[int32]int32 { + if x != nil { + return x.NpcReward + } + return nil +} + +func (x *DBTrollTrain) GetTotalEarn() int64 { + if x != nil { + return x.TotalEarn + } + return 0 +} + +func (x *DBTrollTrain) GetCtime() int64 { + if x != nil { + return x.Ctime + } + return 0 +} + +var File_troll_troll_db_proto protoreflect.FileDescriptor + +var file_troll_troll_db_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x62, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x03, 0x0a, 0x0c, 0x44, 0x42, 0x54, 0x72, 0x6f, + 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, 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, 0x2e, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, + 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x69, + 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x69, 0x64, + 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, 0x69, 0x6e, 0x50, 0x6f, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x72, 0x69, 0x6e, 0x50, 0x6f, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x75, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x75, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x65, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x65, 0x6c, 0x6c, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x70, 0x63, 0x4c, 0x76, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x6e, 0x70, 0x63, 0x4c, 0x76, 0x12, 0x3a, 0x0a, 0x09, 0x6e, 0x70, 0x63, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, + 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x2e, 0x4e, 0x70, 0x63, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x6e, 0x70, 0x63, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x63, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 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, 0x1a, + 0x3c, 0x0a, 0x0e, 0x4e, 0x70, 0x63, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 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, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_troll_troll_db_proto_rawDescOnce sync.Once + file_troll_troll_db_proto_rawDescData = file_troll_troll_db_proto_rawDesc +) + +func file_troll_troll_db_proto_rawDescGZIP() []byte { + file_troll_troll_db_proto_rawDescOnce.Do(func() { + file_troll_troll_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_troll_troll_db_proto_rawDescData) + }) + return file_troll_troll_db_proto_rawDescData +} + +var file_troll_troll_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_troll_troll_db_proto_goTypes = []interface{}{ + (*DBTrollTrain)(nil), // 0: DBTrollTrain + nil, // 1: DBTrollTrain.ItemsEntry + nil, // 2: DBTrollTrain.NpcRewardEntry +} +var file_troll_troll_db_proto_depIdxs = []int32{ + 1, // 0: DBTrollTrain.items:type_name -> DBTrollTrain.ItemsEntry + 2, // 1: DBTrollTrain.npcReward:type_name -> DBTrollTrain.NpcRewardEntry + 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_troll_troll_db_proto_init() } +func file_troll_troll_db_proto_init() { + if File_troll_troll_db_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_troll_troll_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBTrollTrain); 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_troll_troll_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_troll_troll_db_proto_goTypes, + DependencyIndexes: file_troll_troll_db_proto_depIdxs, + MessageInfos: file_troll_troll_db_proto_msgTypes, + }.Build() + File_troll_troll_db_proto = out.File + file_troll_troll_db_proto_rawDesc = nil + file_troll_troll_db_proto_goTypes = nil + file_troll_troll_db_proto_depIdxs = nil +} diff --git a/pb/troll_msg.pb.go b/pb/troll_msg.pb.go new file mode 100644 index 000000000..0a106c6c2 --- /dev/null +++ b/pb/troll_msg.pb.go @@ -0,0 +1,602 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: troll/troll_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 TrollGetListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TrollGetListReq) Reset() { + *x = TrollGetListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollGetListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollGetListReq) ProtoMessage() {} + +func (x *TrollGetListReq) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_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 TrollGetListReq.ProtoReflect.Descriptor instead. +func (*TrollGetListReq) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{0} +} + +// 返回进度信息 +type TrollGetListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBTrollTrain `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *TrollGetListResp) Reset() { + *x = TrollGetListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollGetListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollGetListResp) ProtoMessage() {} + +func (x *TrollGetListResp) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_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 TrollGetListResp.ProtoReflect.Descriptor instead. +func (*TrollGetListResp) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *TrollGetListResp) GetData() *DBTrollTrain { + if x != nil { + return x.Data + } + return nil +} + +// 买卖货物 +type TrollBuyOrSellReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items map[int32]int32 `protobuf:"bytes,1,rep,name=items,proto3" json:"items" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //买入货物的数量(负数为卖) +} + +func (x *TrollBuyOrSellReq) Reset() { + *x = TrollBuyOrSellReq{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollBuyOrSellReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollBuyOrSellReq) ProtoMessage() {} + +func (x *TrollBuyOrSellReq) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_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 TrollBuyOrSellReq.ProtoReflect.Descriptor instead. +func (*TrollBuyOrSellReq) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *TrollBuyOrSellReq) GetItems() map[int32]int32 { + if x != nil { + return x.Items + } + return nil +} + +type TrollBuyOrSellResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBTrollTrain `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *TrollBuyOrSellResp) Reset() { + *x = TrollBuyOrSellResp{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollBuyOrSellResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollBuyOrSellResp) ProtoMessage() {} + +func (x *TrollBuyOrSellResp) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_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 TrollBuyOrSellResp.ProtoReflect.Descriptor instead. +func (*TrollBuyOrSellResp) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *TrollBuyOrSellResp) GetData() *DBTrollTrain { + if x != nil { + return x.Data + } + return nil +} + +// afk 设置 +type TrollAfkSetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buy int32 `protobuf:"varint,1,opt,name=buy,proto3" json:"buy"` + Sell int32 `protobuf:"varint,2,opt,name=sell,proto3" json:"sell"` +} + +func (x *TrollAfkSetReq) Reset() { + *x = TrollAfkSetReq{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollAfkSetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollAfkSetReq) ProtoMessage() {} + +func (x *TrollAfkSetReq) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_msg_proto_msgTypes[4] + 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 TrollAfkSetReq.ProtoReflect.Descriptor instead. +func (*TrollAfkSetReq) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{4} +} + +func (x *TrollAfkSetReq) GetBuy() int32 { + if x != nil { + return x.Buy + } + return 0 +} + +func (x *TrollAfkSetReq) GetSell() int32 { + if x != nil { + return x.Sell + } + return 0 +} + +type TrollAfkSetResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBTrollTrain `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *TrollAfkSetResp) Reset() { + *x = TrollAfkSetResp{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollAfkSetResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollAfkSetResp) ProtoMessage() {} + +func (x *TrollAfkSetResp) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_msg_proto_msgTypes[5] + 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 TrollAfkSetResp.ProtoReflect.Descriptor instead. +func (*TrollAfkSetResp) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{5} +} + +func (x *TrollAfkSetResp) GetData() *DBTrollTrain { + if x != nil { + return x.Data + } + return nil +} + +// npv等级奖励 +type TrollNpcRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int32 `protobuf:"varint,1,opt,name=rewardId,proto3" json:"rewardId"` +} + +func (x *TrollNpcRewardReq) Reset() { + *x = TrollNpcRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollNpcRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollNpcRewardReq) ProtoMessage() {} + +func (x *TrollNpcRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_msg_proto_msgTypes[6] + 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 TrollNpcRewardReq.ProtoReflect.Descriptor instead. +func (*TrollNpcRewardReq) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{6} +} + +func (x *TrollNpcRewardReq) GetRewardId() int32 { + if x != nil { + return x.RewardId + } + return 0 +} + +type TrollNpcRewardResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBTrollTrain `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *TrollNpcRewardResp) Reset() { + *x = TrollNpcRewardResp{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollNpcRewardResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollNpcRewardResp) ProtoMessage() {} + +func (x *TrollNpcRewardResp) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_msg_proto_msgTypes[7] + 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 TrollNpcRewardResp.ProtoReflect.Descriptor instead. +func (*TrollNpcRewardResp) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{7} +} + +func (x *TrollNpcRewardResp) GetData() *DBTrollTrain { + if x != nil { + return x.Data + } + return nil +} + +var File_troll_troll_msg_proto protoreflect.FileDescriptor + +var file_troll_troll_msg_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x6d, 0x73, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x11, 0x0a, + 0x0f, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x22, 0x35, 0x0a, 0x10, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, + 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, + 0x6c, 0x42, 0x75, 0x79, 0x4f, 0x72, 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x54, + 0x72, 0x6f, 0x6c, 0x6c, 0x42, 0x75, 0x79, 0x4f, 0x72, 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, + 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 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, 0x37, 0x0a, 0x12, + 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x42, 0x75, 0x79, 0x4f, 0x72, 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x36, 0x0a, 0x0e, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x41, 0x66, + 0x6b, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x75, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x75, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6c, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x65, 0x6c, 0x6c, 0x22, 0x34, 0x0a, + 0x0f, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x41, 0x66, 0x6b, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x22, 0x2f, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4e, 0x70, 0x63, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x12, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4e, 0x70, 0x63, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, + 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_troll_troll_msg_proto_rawDescOnce sync.Once + file_troll_troll_msg_proto_rawDescData = file_troll_troll_msg_proto_rawDesc +) + +func file_troll_troll_msg_proto_rawDescGZIP() []byte { + file_troll_troll_msg_proto_rawDescOnce.Do(func() { + file_troll_troll_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_troll_troll_msg_proto_rawDescData) + }) + return file_troll_troll_msg_proto_rawDescData +} + +var file_troll_troll_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_troll_troll_msg_proto_goTypes = []interface{}{ + (*TrollGetListReq)(nil), // 0: TrollGetListReq + (*TrollGetListResp)(nil), // 1: TrollGetListResp + (*TrollBuyOrSellReq)(nil), // 2: TrollBuyOrSellReq + (*TrollBuyOrSellResp)(nil), // 3: TrollBuyOrSellResp + (*TrollAfkSetReq)(nil), // 4: TrollAfkSetReq + (*TrollAfkSetResp)(nil), // 5: TrollAfkSetResp + (*TrollNpcRewardReq)(nil), // 6: TrollNpcRewardReq + (*TrollNpcRewardResp)(nil), // 7: TrollNpcRewardResp + nil, // 8: TrollBuyOrSellReq.ItemsEntry + (*DBTrollTrain)(nil), // 9: DBTrollTrain +} +var file_troll_troll_msg_proto_depIdxs = []int32{ + 9, // 0: TrollGetListResp.data:type_name -> DBTrollTrain + 8, // 1: TrollBuyOrSellReq.items:type_name -> TrollBuyOrSellReq.ItemsEntry + 9, // 2: TrollBuyOrSellResp.data:type_name -> DBTrollTrain + 9, // 3: TrollAfkSetResp.data:type_name -> DBTrollTrain + 9, // 4: TrollNpcRewardResp.data:type_name -> DBTrollTrain + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_troll_troll_msg_proto_init() } +func file_troll_troll_msg_proto_init() { + if File_troll_troll_msg_proto != nil { + return + } + file_troll_troll_db_proto_init() + if !protoimpl.UnsafeEnabled { + file_troll_troll_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollGetListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollGetListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollBuyOrSellReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollBuyOrSellResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollAfkSetReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollAfkSetResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollNpcRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_troll_troll_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollNpcRewardResp); 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_troll_troll_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_troll_troll_msg_proto_goTypes, + DependencyIndexes: file_troll_troll_msg_proto_depIdxs, + MessageInfos: file_troll_troll_msg_proto_msgTypes, + }.Build() + File_troll_troll_msg_proto = out.File + file_troll_troll_msg_proto_rawDesc = nil + file_troll_troll_msg_proto_goTypes = nil + file_troll_troll_msg_proto_depIdxs = nil +} diff --git a/sys/configure/structs/Game.TrollCoefficient.go b/sys/configure/structs/Game.TrollCoefficient.go new file mode 100644 index 000000000..77f6208bf --- /dev/null +++ b/sys/configure/structs/Game.TrollCoefficient.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 GameTrollCoefficient struct { + _dataMap map[int32]*GameTrollCoefficientData + _dataList []*GameTrollCoefficientData +} + +func NewGameTrollCoefficient(_buf []map[string]interface{}) (*GameTrollCoefficient, error) { + _dataList := make([]*GameTrollCoefficientData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrollCoefficientData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTrollCoefficientData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &GameTrollCoefficient{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrollCoefficient) GetDataMap() map[int32]*GameTrollCoefficientData { + return table._dataMap +} + +func (table *GameTrollCoefficient) GetDataList() []*GameTrollCoefficientData { + return table._dataList +} + +func (table *GameTrollCoefficient) Get(key int32) *GameTrollCoefficientData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TrollCoefficientData.go b/sys/configure/structs/Game.TrollCoefficientData.go new file mode 100644 index 000000000..6546437dc --- /dev/null +++ b/sys/configure/structs/Game.TrollCoefficientData.go @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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 GameTrollCoefficientData struct { + Id int32 + Coefficient string +} + +const TypeId_GameTrollCoefficientData = -856241206 + +func (*GameTrollCoefficientData) GetTypeId() int32 { + return -856241206 +} + +func (_v *GameTrollCoefficientData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } + { var _ok_ bool; if _v.Coefficient, _ok_ = _buf["coefficient"].(string); !_ok_ { err = errors.New("coefficient error"); return } } + return +} + +func DeserializeGameTrollCoefficientData(_buf map[string]interface{}) (*GameTrollCoefficientData, error) { + v := &GameTrollCoefficientData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Game.TrollGoods.go b/sys/configure/structs/Game.TrollGoods.go new file mode 100644 index 000000000..0457d81d7 --- /dev/null +++ b/sys/configure/structs/Game.TrollGoods.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 GameTrollGoods struct { + _dataMap map[int32]*GameTrollGoodsData + _dataList []*GameTrollGoodsData +} + +func NewGameTrollGoods(_buf []map[string]interface{}) (*GameTrollGoods, error) { + _dataList := make([]*GameTrollGoodsData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrollGoodsData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTrollGoodsData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &GameTrollGoods{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrollGoods) GetDataMap() map[int32]*GameTrollGoodsData { + return table._dataMap +} + +func (table *GameTrollGoods) GetDataList() []*GameTrollGoodsData { + return table._dataList +} + +func (table *GameTrollGoods) Get(key int32) *GameTrollGoodsData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TrollGoodsData.go b/sys/configure/structs/Game.TrollGoodsData.go new file mode 100644 index 000000000..856d2d27a --- /dev/null +++ b/sys/configure/structs/Game.TrollGoodsData.go @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// 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 GameTrollGoodsData struct { + Id int32 + Goodsname string + Goodsfor int32 + Goodsinfor string + Goodsicon string + Goodsprice int32 + StarMoney int32 + Uptext string + Suptext string + Max int32 +} + +const TypeId_GameTrollGoodsData = 1425823147 + +func (*GameTrollGoodsData) GetTypeId() int32 { + return 1425823147 +} + +func (_v *GameTrollGoodsData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } + { var _ok_ bool; if _v.Goodsname, _ok_ = _buf["goodsname"].(string); !_ok_ { err = errors.New("goodsname error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["goodsfor"].(float64); !_ok_ { err = errors.New("goodsfor error"); return }; _v.Goodsfor = int32(_tempNum_) } + { var _ok_ bool; if _v.Goodsinfor, _ok_ = _buf["goodsinfor"].(string); !_ok_ { err = errors.New("goodsinfor error"); return } } + { var _ok_ bool; if _v.Goodsicon, _ok_ = _buf["goodsicon"].(string); !_ok_ { err = errors.New("goodsicon error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["goodsprice"].(float64); !_ok_ { err = errors.New("goodsprice error"); return }; _v.Goodsprice = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star_money"].(float64); !_ok_ { err = errors.New("star_money error"); return }; _v.StarMoney = int32(_tempNum_) } + { var _ok_ bool; if _v.Uptext, _ok_ = _buf["uptext"].(string); !_ok_ { err = errors.New("uptext error"); return } } + { var _ok_ bool; if _v.Suptext, _ok_ = _buf["suptext"].(string); !_ok_ { err = errors.New("suptext error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["max"].(float64); !_ok_ { err = errors.New("max error"); return }; _v.Max = int32(_tempNum_) } + return +} + +func DeserializeGameTrollGoodsData(_buf map[string]interface{}) (*GameTrollGoodsData, error) { + v := &GameTrollGoodsData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Game.TrollLv.go b/sys/configure/structs/Game.TrollLv.go new file mode 100644 index 000000000..87430936c --- /dev/null +++ b/sys/configure/structs/Game.TrollLv.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 GameTrollLv struct { + _dataMap map[int32]*GameTrollLvData + _dataList []*GameTrollLvData +} + +func NewGameTrollLv(_buf []map[string]interface{}) (*GameTrollLv, error) { + _dataList := make([]*GameTrollLvData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrollLvData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTrollLvData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Lv] = _v + } + } + return &GameTrollLv{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrollLv) GetDataMap() map[int32]*GameTrollLvData { + return table._dataMap +} + +func (table *GameTrollLv) GetDataList() []*GameTrollLvData { + return table._dataList +} + +func (table *GameTrollLv) Get(key int32) *GameTrollLvData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TrollLvData.go b/sys/configure/structs/Game.TrollLvData.go new file mode 100644 index 000000000..29998d541 --- /dev/null +++ b/sys/configure/structs/Game.TrollLvData.go @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// +// 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 GameTrollLvData struct { + Lv int32 + Money int32 + Reword []*Gameatn + Model []string +} + +const TypeId_GameTrollLvData = -595686743 + +func (*GameTrollLvData) GetTypeId() int32 { + return -595686743 +} + +func (_v *GameTrollLvData)Deserialize(_buf map[string]interface{}) (err error) { + { 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["money"].(float64); !_ok_ { err = errors.New("money error"); return }; _v.Money = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["reword"].([]interface{}); !_ok_ { err = errors.New("reword error"); return } + + _v.Reword = 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.Reword = append(_v.Reword, _list_v_) + } + } + + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["model"].([]interface{}); !_ok_ { err = errors.New("model error"); return } + + _v.Model = make([]string, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ string + { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } + _v.Model = append(_v.Model, _list_v_) + } + } + + return +} + +func DeserializeGameTrollLvData(_buf map[string]interface{}) (*GameTrollLvData, error) { + v := &GameTrollLvData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Game.TrollRule.go b/sys/configure/structs/Game.TrollRule.go new file mode 100644 index 000000000..8ce8e3c5a --- /dev/null +++ b/sys/configure/structs/Game.TrollRule.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 GameTrollRule struct { + _dataMap map[int32]*GameTrollRuleData + _dataList []*GameTrollRuleData +} + +func NewGameTrollRule(_buf []map[string]interface{}) (*GameTrollRule, error) { + _dataList := make([]*GameTrollRuleData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrollRuleData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTrollRuleData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &GameTrollRule{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrollRule) GetDataMap() map[int32]*GameTrollRuleData { + return table._dataMap +} + +func (table *GameTrollRule) GetDataList() []*GameTrollRuleData { + return table._dataList +} + +func (table *GameTrollRule) Get(key int32) *GameTrollRuleData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TrollRuleData.go b/sys/configure/structs/Game.TrollRuleData.go new file mode 100644 index 000000000..97e8d6c3b --- /dev/null +++ b/sys/configure/structs/Game.TrollRuleData.go @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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 GameTrollRuleData struct { + Id int32 + Quantity string +} + +const TypeId_GameTrollRuleData = 902547931 + +func (*GameTrollRuleData) GetTypeId() int32 { + return 902547931 +} + +func (_v *GameTrollRuleData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } + { var _ok_ bool; if _v.Quantity, _ok_ = _buf["quantity"].(string); !_ok_ { err = errors.New("quantity error"); return } } + return +} + +func DeserializeGameTrollRuleData(_buf map[string]interface{}) (*GameTrollRuleData, error) { + v := &GameTrollRuleData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Game.TrollTrain.go b/sys/configure/structs/Game.TrollTrain.go new file mode 100644 index 000000000..0a1d9feb9 --- /dev/null +++ b/sys/configure/structs/Game.TrollTrain.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 GameTrollTrain struct { + _dataMap map[int32]*GameTrollTrainData + _dataList []*GameTrollTrainData +} + +func NewGameTrollTrain(_buf []map[string]interface{}) (*GameTrollTrain, error) { + _dataList := make([]*GameTrollTrainData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrollTrainData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameTrollTrainData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &GameTrollTrain{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrollTrain) GetDataMap() map[int32]*GameTrollTrainData { + return table._dataMap +} + +func (table *GameTrollTrain) GetDataList() []*GameTrollTrainData { + return table._dataList +} + +func (table *GameTrollTrain) Get(key int32) *GameTrollTrainData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.TrollTrainData.go b/sys/configure/structs/Game.TrollTrainData.go new file mode 100644 index 000000000..354d7c864 --- /dev/null +++ b/sys/configure/structs/Game.TrollTrainData.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 GameTrollTrainData struct { + Id int32 + Name string + Information string + Ico string + Time int32 +} + +const TypeId_GameTrollTrainData = 935593821 + +func (*GameTrollTrainData) GetTypeId() int32 { + return 935593821 +} + +func (_v *GameTrollTrainData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } + { var _ok_ bool; if _v.Name, _ok_ = _buf["name"].(string); !_ok_ { err = errors.New("name error"); return } } + { var _ok_ bool; if _v.Information, _ok_ = _buf["information"].(string); !_ok_ { err = errors.New("information error"); return } } + { var _ok_ bool; if _v.Ico, _ok_ = _buf["ico"].(string); !_ok_ { err = errors.New("ico error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time"].(float64); !_ok_ { err = errors.New("time error"); return }; _v.Time = int32(_tempNum_) } + return +} + +func DeserializeGameTrollTrainData(_buf map[string]interface{}) (*GameTrollTrainData, error) { + v := &GameTrollTrainData{} + 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 d6ed1c66b..0e98b2430 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -115,6 +115,11 @@ type Tables struct { HeroTalent *GameHeroTalent TalentSkill *GameTalentSkill ItemBox *GameItemBox + TrollRule *GameTrollRule + TrollGoods *GameTrollGoods + TrollTrain *GameTrollTrain + TrollLv *GameTrollLv + TrollCoefficient *GameTrollCoefficient } func NewTables(loader JsonLoader) (*Tables, error) { @@ -746,6 +751,35 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.ItemBox, err = NewGameItemBox(buf); err != nil { return nil, err } - + if buf, err = loader("game_trollrule"); err != nil { + return nil, err + } + if tables.TrollRule, err = NewGameTrollRule(buf); err != nil { + return nil, err + } + if buf, err = loader("game_trollgoods"); err != nil { + return nil, err + } + if tables.TrollGoods, err = NewGameTrollGoods(buf); err != nil { + return nil, err + } + if buf, err = loader("game_trolltrain"); err != nil { + return nil, err + } + if tables.TrollTrain, err = NewGameTrollTrain(buf); err != nil { + return nil, err + } + if buf, err = loader("game_trolllv"); err != nil { + return nil, err + } + if tables.TrollLv, err = NewGameTrollLv(buf); err != nil { + return nil, err + } + if buf, err = loader("game_trollcoefficient"); err != nil { + return nil, err + } + if tables.TrollCoefficient, err = NewGameTrollCoefficient(buf); err != nil { + return nil, err + } return tables, nil }