From f2fd4ebb639c9a4e3aac01208ec83f63eeec439d Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 10 Oct 2023 11:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E9=98=9F=E6=8E=92=E8=A1=8C=E6=94=B9?= =?UTF-8?q?=E8=B7=A8=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 + modules/caravan/api_buyorsell.go | 1 + modules/caravan/api_ranklist.go | 3 +- modules/caravan/comp_configure.go | 2 +- modules/caravan/model_rank.go | 137 ++++++++++++++++++ modules/caravan/module.go | 77 ++++++----- modules/user/model_user.go | 4 + modules/viking/model_seasonrank.go | 57 -------- modules/viking/module.go | 14 +- pb/caravan_db.pb.go | 214 ++++++++++++++++++++++++----- 10 files changed, 375 insertions(+), 136 deletions(-) create mode 100644 modules/caravan/model_rank.go delete mode 100644 modules/viking/model_seasonrank.go diff --git a/comm/const.go b/comm/const.go index 275fb31d9..59a2113d1 100644 --- a/comm/const.go +++ b/comm/const.go @@ -378,6 +378,8 @@ const ( TableVentureSign = "venturesign" TableVentureLv = "venturelv" + + TableCaravanRank = "caravansrank" ) // RPC服务接口定义处 diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index 7b763b3c9..0d09e4e87 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -237,6 +237,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe Data: caravan, }) + this.module.rank.SetUsrRankList(session.GetUserId()) // 任务统计 var tasks []*pb.BuriedParam diff --git a/modules/caravan/api_ranklist.go b/modules/caravan/api_ranklist.go index 392ff845d..49fd9b527 100644 --- a/modules/caravan/api_ranklist.go +++ b/modules/caravan/api_ranklist.go @@ -20,7 +20,8 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.CaravanRankList if errdata = this.RankListCheck(session, req); errdata != nil { return // 参数校验失败直接返回 } - resp.List, rankid = this.module.modelCaravan.GetRankListData(comm.MaxRankList, session.GetUserId()) + //resp.List, rankid = this.module.modelCaravan.GetRankListData(comm.MaxRankList, session.GetUserId()) + resp.List, rankid = this.module.rank.getRankList(session.GetUserId()) // 2023.10.10 改跨服 userinfo, err := this.module.ModuleUser.GetUser(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ diff --git a/modules/caravan/comp_configure.go b/modules/caravan/comp_configure.go index c79f1777a..20f0050c3 100644 --- a/modules/caravan/comp_configure.go +++ b/modules/caravan/comp_configure.go @@ -229,7 +229,7 @@ func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanReward ) if v, err = this.GetConfigure(game_caravan_reward); err == nil { if configure, ok := v.(*cfg.GameCaravanReward); ok { - if reward = configure.Get(this.overflow); err != nil { + if reward = configure.Get(this.overflow); err == nil { return } } diff --git a/modules/caravan/model_rank.go b/modules/caravan/model_rank.go new file mode 100644 index 000000000..f5c15e8df --- /dev/null +++ b/modules/caravan/model_rank.go @@ -0,0 +1,137 @@ +package caravan + +import ( + "context" + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/mgo" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + "go_dreamfactory/sys/db" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "go.mongodb.org/mongo-driver/x/bsonx" +) + +type ModelRank struct { + modules.MCompModel + module *Caravan +} + +func (this *ModelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = comm.TableCaravanRank + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Caravan) + //创建uid索引 + this.DB.CreateIndex(core.SqlTable(comm.TableCaravanRank), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +func (this *ModelRank) SetUsrRankList(uid string) (result *pb.DBCaravanRank, err error) { + conn_, err := db.Cross() // 获取跨服数据库对象 + if err != nil { + return + } + user, err1 := this.module.ModuleUser.GetUser(uid) + if err1 != nil { + err = err1 + return + } + model := db.NewDBModelByExpired(comm.TableCaravanRank, conn_) + if model == nil { + return + } + result = &pb.DBCaravanRank{} + if err = model.Get(uid, result); err != nil { + if mgo.MongodbNil == err { + + result = &pb.DBCaravanRank{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Name: user.Name, + Userlv: user.Lv, + Avatar: user.Avatar, + + Merchantmoney: user.Merchantmoney, + CaravanLv: user.Caravanlv, + Title: user.Curtitle, + } + err = nil + model.Add(uid, result) + } + return + } + data := make(map[string]interface{}, 0) + data["merchantmoney"] = user.Merchantmoney + data["caravanLv"] = user.Caravanlv + if err = model.Change(uid, data); err != nil { + return + } + return result, err +} + +func (this *ModelRank) ChangeRankList(uId string, data map[string]interface{}) (err error) { + conn_, err := db.Cross() // 获取跨服数据库对象 + if err != nil { + return + } + + model := db.NewDBModelByExpired(comm.TableCaravanRank, conn_) + if model == nil { + return + } + if err = model.Change(uId, data); err != nil { + return + } + return +} + +// 获取排行榜数据 +func (this *ModelRank) getRankList(uid string) (list []*pb.CaravanRankInfo, rankid int32) { + var ipos int32 + min := this.module.ModuleTools.GetGlobalConf().BusinessRankmoney + conn_, err := db.Cross() // 获取跨服数据库对象 + if err != nil { + return + } + + model := db.NewDBModelByExpired(comm.TableCaravanRank, conn_) + if model == nil { + return + } + + if _data, err := model.DB.Find(comm.TableCaravanRank, bson.M{"merchantmoney": bson.M{"$gte": min}}, options.Find().SetSort(bson.M{"merchantmoney": -1}).SetLimit(int64(comm.MaxRankNum))); err == nil { + for _data.Next(context.TODO()) { + temp := &pb.DBUser{} + if err = _data.Decode(temp); err == nil { + if temp.Name == "" { // 容错处理 防止没有创号的玩家入榜 + continue + } + ipos++ + list = append(list, &pb.CaravanRankInfo{ + Uid: temp.Uid, + Name: temp.Name, + Userlv: temp.Lv, + Avatar: temp.Avatar, + Rank: ipos, + Merchantmoney: temp.Merchantmoney, + CaravanLv: temp.Caravanlv, + Title: temp.Curtitle, + }) + + if temp.Uid == uid { + rankid = ipos + } + } + } + } else { + this.module.Errorln(err) + return + } + return +} diff --git a/modules/caravan/module.go b/modules/caravan/module.go index e6efb1352..acbdf9416 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -10,6 +10,7 @@ import ( "go_dreamfactory/pb" "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/sys/db" "go_dreamfactory/utils" "math" "strconv" @@ -26,6 +27,7 @@ type Caravan struct { configure *configureComp service base.IRPCXService mail comm.Imail + rank *ModelRank } func NewModule() core.IModule { @@ -62,6 +64,7 @@ func (this *Caravan) OnInstallComp() { this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.modelCaravan = this.RegisterComp(new(modelCaravan)).(*modelCaravan) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) + this.rank = this.RegisterComp(new(ModelRank)).(*ModelRank) } // 接口信息 修改数据 @@ -438,18 +441,17 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E ) go func() { sTime := time.Now() - var rankIndex int32 - if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": 0}}, options.Find().SetSort(bson.M{"merchantmoney": -1}).SetLimit(comm.MaxRankList)); err == nil { - for _data.Next(context.TODO()) { - rankIndex++ - temp := &pb.DBUser{} - if err = _data.Decode(temp); err == nil { - c, err := this.configure.GetCaravanRank(rankIndex) - if err == nil { - this.mail.SendMailByUID(temp.Uid, "CaravanRank", c.Reward, []string{strconv.Itoa(int(rankIndex))}) - } - } - } + var ( + rankIndex int32 + stag string + ) + conn_, err := db.Cross() // 获取跨服数据库对象 + if err != nil { + return + } + model := db.NewDBModelByExpired(comm.TableCaravanRank, conn_) + if model == nil { + return } var maxKey int32 for _, v := range this.configure.GetCaravanReward() { @@ -461,31 +463,44 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E if err != nil { return } - // 发送虚拟币奖励 - if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": comm.CaravanMerchantmoney}}); err == nil { + min := this.ModuleTools.GetGlobalConf().BusinessRankmoney + if _data, err := model.DB.Find(comm.TableCaravanRank, bson.M{"merchantmoney": bson.M{"$gte": min}}, options.Find().SetSort(bson.M{"merchantmoney": -1}).SetLimit(int64(comm.MaxRankNum))); err == nil { + //if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": 0}}, options.Find().SetSort(bson.M{"merchantmoney": -1}).SetLimit(comm.MaxRankList)); err == nil { for _data.Next(context.TODO()) { - temp := &pb.DBUser{} - + rankIndex++ + temp := &pb.DBCaravanRank{} if err = _data.Decode(temp); err == nil { - - if maxKey <= temp.Merchantmoney { - var res []*cfg.Gameatn - for _, v := range moreReard.Reward { - if v.N == 0 { - continue - } - atn := &cfg.Gameatn{ - A: v.A, - T: v.T, - N: v.N * (temp.Merchantmoney - maxKey), - } - res = append(res, atn) - } - this.mail.SendMailByUID(temp.Uid, "CaravanRewards", res, []string{}) + if stag, err = comm.UidToSTag(temp.Uid); err != nil { + return } + if this.service.GetTag() == stag { + if carConf, err := this.configure.GetCaravanRank(rankIndex); err == nil { + this.mail.SendMailByUID(temp.Uid, "CaravanRank", carConf.Reward, []string{strconv.Itoa(int(rankIndex))}) + } + if maxKey < temp.Merchantmoney { // 超过部分转换其他奖励发送 + var res []*cfg.Gameatn + for _, v := range moreReard.Reward { + if v.N == 0 { + continue + } + atn := &cfg.Gameatn{ + A: v.A, + T: v.T, + N: v.N * (temp.Merchantmoney - maxKey), + } + res = append(res, atn) + } + + this.mail.SendMailByUID(temp.Uid, "CaravanRewards", res, []string{}) + } + } + model.DB.UpdateOne(comm.TableCaravanRank, bson.M{"_id": temp.Id}, bson.M{"$set": bson.M{ + "merchantmoney": 0, + }}) } } } + Query := bson.M{} Query["merchantmoney"] = 0 _, err = this.modelCaravan.DB.UpdateMany(core.SqlTable(comm.TableUser), bson.M{"merchantmoney": bson.M{"$gt": 0}}, bson.M{"$set": Query}, options.MergeUpdateOptions().SetUpsert(true)) //, new(options.UpdateOptions).SetUpsert(true) diff --git a/modules/user/model_user.go b/modules/user/model_user.go index eaa217134..c85c8383e 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -294,6 +294,10 @@ func (this *ModelUser) CleanUserMerchantmoney(session comm.IUserSession) (err er update = make(map[string]interface{}, 0) update["profit"] = 0 update["merchantmoney"] = 0 + if user.Caravanlv == 0 { // 默认1级 + user.Caravanlv = 1 + update["caravanlv"] = user.Caravanlv + } if db.IsCross() { if model, err = this.module.GetDBModelByUid(uid, this.TableName); err == nil { if err := this.Get(uid, user); err != nil { diff --git a/modules/viking/model_seasonrank.go b/modules/viking/model_seasonrank.go deleted file mode 100644 index 6d038decd..000000000 --- a/modules/viking/model_seasonrank.go +++ /dev/null @@ -1,57 +0,0 @@ -package viking - -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 ModelSeasonRank struct { - modules.MCompModel - moduleViking *Viking -} - -func (this *ModelSeasonRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - this.TableName = comm.TableVikingSRank - err = this.MCompModel.Init(service, module, comp, options) - this.moduleViking = module.(*Viking) - //创建uid索引 - this.DB.CreateIndex(core.SqlTable(comm.TableVikingSRank), mongo.IndexModel{ - Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, - }) - return -} -func (this *ModelSeasonRank) AddSeasonRankList(uId string, id string, data *pb.DBVSeasonRank) (err error) { - if err = this.AddList(uId, id, data); err != nil { - return - } - return nil -} - -// 获取排行榜数据 -func (this *ModelSeasonRank) getVikingSeasonRankList(uid string) []*pb.DBVSeasonRank { - ranks := make([]*pb.DBVSeasonRank, 0) - err := this.GetList(uid, &ranks) - if err != nil { - return nil - } - return ranks -} - -func (this *ModelSeasonRank) getVikingSeasonRankListByBossType(uid string, bossType int32) *pb.DBVSeasonRank { - ranks := make([]*pb.DBVSeasonRank, 0) - err := this.GetList(uid, &ranks) - if err != nil { - return nil - } - for _, v := range ranks { - if v.Bosstype == bossType { - return v - } - } - return nil -} diff --git a/modules/viking/module.go b/modules/viking/module.go index a6ca6f023..141ee314a 100644 --- a/modules/viking/module.go +++ b/modules/viking/module.go @@ -26,13 +26,12 @@ import ( type Viking struct { modules.ModuleBase - modelViking *modelViking - api *apiComp - configure *configureComp - modulerank *ModelRank - moduleseasonrank *ModelSeasonRank - battle comm.IBattle - service base.IRPCXService + modelViking *modelViking + api *apiComp + configure *configureComp + modulerank *ModelRank + battle comm.IBattle + service base.IRPCXService } const ( @@ -61,7 +60,6 @@ func (this *Viking) OnInstallComp() { this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.modelViking = this.RegisterComp(new(modelViking)).(*modelViking) this.modulerank = this.RegisterComp(new(ModelRank)).(*ModelRank) - this.moduleseasonrank = this.RegisterComp(new(ModelSeasonRank)).(*ModelSeasonRank) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) } diff --git a/pb/caravan_db.pb.go b/pb/caravan_db.pb.go index 389189409..e410d89a8 100644 --- a/pb/caravan_db.pb.go +++ b/pb/caravan_db.pb.go @@ -455,6 +455,117 @@ func (x *GoodsInfo) GetGoods() map[string]int32 { return nil } +type DBCaravanRank 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"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"` + Userlv int32 `protobuf:"varint,4,opt,name=userlv,proto3" json:"userlv"` + Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar" bson:"avatar"` //头像 + Rank int32 `protobuf:"varint,6,opt,name=rank,proto3" json:"rank"` //排名 + Merchantmoney int32 `protobuf:"varint,7,opt,name=merchantmoney,proto3" json:"merchantmoney"` // 虚拟币 + CaravanLv int32 `protobuf:"varint,8,opt,name=caravanLv,proto3" json:"caravanLv"` // 商队等级 + Title string `protobuf:"bytes,9,opt,name=title,proto3" json:"title"` +} + +func (x *DBCaravanRank) Reset() { + *x = DBCaravanRank{} + if protoimpl.UnsafeEnabled { + mi := &file_caravan_caravan_db_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBCaravanRank) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBCaravanRank) ProtoMessage() {} + +func (x *DBCaravanRank) ProtoReflect() protoreflect.Message { + mi := &file_caravan_caravan_db_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 DBCaravanRank.ProtoReflect.Descriptor instead. +func (*DBCaravanRank) Descriptor() ([]byte, []int) { + return file_caravan_caravan_db_proto_rawDescGZIP(), []int{5} +} + +func (x *DBCaravanRank) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBCaravanRank) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBCaravanRank) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DBCaravanRank) GetUserlv() int32 { + if x != nil { + return x.Userlv + } + return 0 +} + +func (x *DBCaravanRank) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *DBCaravanRank) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *DBCaravanRank) GetMerchantmoney() int32 { + if x != nil { + return x.Merchantmoney + } + return 0 +} + +func (x *DBCaravanRank) GetCaravanLv() int32 { + if x != nil { + return x.CaravanLv + } + return 0 +} + +func (x *DBCaravanRank) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + type CaravanRankInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -473,7 +584,7 @@ type CaravanRankInfo struct { func (x *CaravanRankInfo) Reset() { *x = CaravanRankInfo{} if protoimpl.UnsafeEnabled { - mi := &file_caravan_caravan_db_proto_msgTypes[5] + mi := &file_caravan_caravan_db_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -486,7 +597,7 @@ func (x *CaravanRankInfo) String() string { func (*CaravanRankInfo) ProtoMessage() {} func (x *CaravanRankInfo) ProtoReflect() protoreflect.Message { - mi := &file_caravan_caravan_db_proto_msgTypes[5] + mi := &file_caravan_caravan_db_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -499,7 +610,7 @@ func (x *CaravanRankInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CaravanRankInfo.ProtoReflect.Descriptor instead. func (*CaravanRankInfo) Descriptor() ([]byte, []int) { - return file_caravan_caravan_db_proto_rawDescGZIP(), []int{5} + return file_caravan_caravan_db_proto_rawDescGZIP(), []int{6} } func (x *CaravanRankInfo) GetUid() string { @@ -658,22 +769,36 @@ var file_caravan_caravan_db_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x64, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x47, 0x6f, 0x6f, 0x64, 0x73, 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, 0x22, 0xd5, - 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x76, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x24, 0x0a, 0x0d, - 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x6d, 0x6f, 0x6e, - 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x4c, 0x76, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x4c, 0x76, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe3, + 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x61, 0x6e, 0x6b, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x76, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x76, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x65, + 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x6d, 0x6f, 0x6e, 0x65, 0x79, + 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x4c, 0x76, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x4c, 0x76, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, + 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x6c, 0x76, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, + 0x6e, 0x6b, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x74, 0x6d, 0x6f, + 0x6e, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x68, + 0x61, 0x6e, 0x74, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x61, + 0x76, 0x61, 0x6e, 0x4c, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x61, 0x72, + 0x61, 0x76, 0x61, 0x6e, 0x4c, 0x76, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -688,32 +813,33 @@ func file_caravan_caravan_db_proto_rawDescGZIP() []byte { return file_caravan_caravan_db_proto_rawDescData } -var file_caravan_caravan_db_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_caravan_caravan_db_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_caravan_caravan_db_proto_goTypes = []interface{}{ (*CityInfo)(nil), // 0: CityInfo (*BagInfo)(nil), // 1: BagInfo (*DBCaravan)(nil), // 2: DBCaravan (*GoodPeriod)(nil), // 3: GoodPeriod (*GoodsInfo)(nil), // 4: GoodsInfo - (*CaravanRankInfo)(nil), // 5: CaravanRankInfo - nil, // 6: CityInfo.CountEntry - nil, // 7: DBCaravan.ItemsEntry - nil, // 8: DBCaravan.CityEntry - nil, // 9: DBCaravan.GroupEntry - nil, // 10: DBCaravan.RewardEntry - nil, // 11: DBCaravan.AllgoodsEntry - nil, // 12: DBCaravan.PeriodEntry - nil, // 13: GoodsInfo.GoodsEntry + (*DBCaravanRank)(nil), // 5: DBCaravanRank + (*CaravanRankInfo)(nil), // 6: CaravanRankInfo + nil, // 7: CityInfo.CountEntry + nil, // 8: DBCaravan.ItemsEntry + nil, // 9: DBCaravan.CityEntry + nil, // 10: DBCaravan.GroupEntry + nil, // 11: DBCaravan.RewardEntry + nil, // 12: DBCaravan.AllgoodsEntry + nil, // 13: DBCaravan.PeriodEntry + nil, // 14: GoodsInfo.GoodsEntry } var file_caravan_caravan_db_proto_depIdxs = []int32{ - 6, // 0: CityInfo.count:type_name -> CityInfo.CountEntry - 7, // 1: DBCaravan.items:type_name -> DBCaravan.ItemsEntry - 8, // 2: DBCaravan.city:type_name -> DBCaravan.CityEntry - 9, // 3: DBCaravan.group:type_name -> DBCaravan.GroupEntry - 10, // 4: DBCaravan.reward:type_name -> DBCaravan.RewardEntry - 11, // 5: DBCaravan.allgoods:type_name -> DBCaravan.AllgoodsEntry - 12, // 6: DBCaravan.period:type_name -> DBCaravan.PeriodEntry - 13, // 7: GoodsInfo.goods:type_name -> GoodsInfo.GoodsEntry + 7, // 0: CityInfo.count:type_name -> CityInfo.CountEntry + 8, // 1: DBCaravan.items:type_name -> DBCaravan.ItemsEntry + 9, // 2: DBCaravan.city:type_name -> DBCaravan.CityEntry + 10, // 3: DBCaravan.group:type_name -> DBCaravan.GroupEntry + 11, // 4: DBCaravan.reward:type_name -> DBCaravan.RewardEntry + 12, // 5: DBCaravan.allgoods:type_name -> DBCaravan.AllgoodsEntry + 13, // 6: DBCaravan.period:type_name -> DBCaravan.PeriodEntry + 14, // 7: GoodsInfo.goods:type_name -> GoodsInfo.GoodsEntry 1, // 8: DBCaravan.ItemsEntry.value:type_name -> BagInfo 0, // 9: DBCaravan.CityEntry.value:type_name -> CityInfo 4, // 10: DBCaravan.AllgoodsEntry.value:type_name -> GoodsInfo @@ -792,6 +918,18 @@ func file_caravan_caravan_db_proto_init() { } } file_caravan_caravan_db_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBCaravanRank); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caravan_caravan_db_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CaravanRankInfo); i { case 0: return &v.state @@ -810,7 +948,7 @@ func file_caravan_caravan_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_caravan_caravan_db_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 0, },