diff --git a/comm/const.go b/comm/const.go index d36e3df75..53a0fae05 100644 --- a/comm/const.go +++ b/comm/const.go @@ -23,7 +23,7 @@ const ( ) const ( - RDS_SESSION = "online" + RDS_SESSION = "online" ) //ERR @@ -178,6 +178,9 @@ const ( ///充值数据表 TablePay = "pay" + + // 巨怪列车收益记录 + TableTrollRecord = "trollrecord" ) //RPC服务接口定义处 diff --git a/modules/troll/api.go b/modules/troll/api.go index 44499c8a6..39cde8023 100644 --- a/modules/troll/api.go +++ b/modules/troll/api.go @@ -13,6 +13,7 @@ const ( TrollNpcRewardResp = "npcreward" GourmetGetRandUserResp = "getranduser" TrollRankListResp = "ranklist" + TrollRecordListResp = "recordlist" ) type apiComp struct { diff --git a/modules/troll/api_recordlist.go b/modules/troll/api_recordlist.go new file mode 100644 index 000000000..dd83c6f6c --- /dev/null +++ b/modules/troll/api_recordlist.go @@ -0,0 +1,22 @@ +package troll + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +func (this *apiComp) RecordListCheck(session comm.IUserSession, req *pb.TrollRecordListReq) (code pb.ErrorCode) { + return +} + +func (this *apiComp) RecordList(session comm.IUserSession, req *pb.TrollRecordListReq) (code pb.ErrorCode, data proto.Message) { + + if list, err := this.module.record.GetTrollRecord(session.GetUserId()); err == nil { + session.SendMsg(string(this.module.GetType()), TrollRecordListResp, &pb.TrollRecordListResp{ + Data: list, + }) + } + return +} diff --git a/modules/troll/model_record.go b/modules/troll/model_record.go new file mode 100644 index 000000000..2a8b8ad2c --- /dev/null +++ b/modules/troll/model_record.go @@ -0,0 +1,48 @@ +package troll + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + "time" + + "go.mongodb.org/mongo-driver/bson/primitive" +) + +type ModelRecord struct { + modules.MCompModel + module *Troll +} + +func (this *ModelRecord) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = comm.TableTrollRecord + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Troll) + return +} + +// 获取列表信息 +func (this *ModelRecord) GetTrollRecord(uid string) (result []*pb.DBTrollRecord, err error) { + result = make([]*pb.DBTrollRecord, 0) + if err = this.GetList(uid, &result); err != nil { + return + } + err = nil + return result, err +} + +// 添加收益列表 +func (this *ModelRecord) AddTrollRecord(uid string, gold int32) (err error) { + troll := &pb.DBTrollRecord{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Gold: gold, + Time: time.Now().Unix(), + } + if err = this.AddList(uid, troll.Id, troll); err != nil { + this.module.Errorf("%v", err) + return + } + return +} diff --git a/modules/troll/model_gourmet.go b/modules/troll/model_troll.go similarity index 100% rename from modules/troll/model_gourmet.go rename to modules/troll/model_troll.go diff --git a/modules/troll/module.go b/modules/troll/module.go index 36c292d57..09d94a953 100644 --- a/modules/troll/module.go +++ b/modules/troll/module.go @@ -23,6 +23,7 @@ type Troll struct { modelTroll *modelTroll api *apiComp configure *configureComp + record *ModelRecord } func NewModule() core.IModule { @@ -44,6 +45,7 @@ func (this *Troll) OnInstallComp() { this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.modelTroll = this.RegisterComp(new(modelTroll)).(*modelTroll) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) + this.record = this.RegisterComp(new(ModelRecord)).(*ModelRecord) } // 接口信息 @@ -89,10 +91,9 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai index := int32(index) % trainNum troll.RefreshTime += int64(sz[index]) if now >= troll.RefreshTime { - troll.TarinPos++ - troll.RangeId++ troll.RangeId = (troll.RangeId % maxCoefficient) + 1 troll.TarinPos = (troll.TarinPos % trainNum) + 1 + coefficient := this.configure.GetTrollCoefficient(troll.RangeId) // 获取当前级别的涨幅数据 if coefficient == nil { return @@ -105,13 +106,19 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai } // 出售之前算成本 if len(troll.Items) > 0 { - sellGold := this.SellAllItem(troll, sellPrice) + sellGold := this.SellAllItem(session.GetUserId(), troll, sellPrice) + if sellGold != 0 { + if code = this.ModuleUser.AddAttributeValue(session, comm.ResGold, sellGold, true); code != pb.ErrorCode_Success { + this.Errorf("玩家 uid:%s 金币不足,获得金币%d", session.GetUserId(), sellGold) + } // 一次交易完成做一次结算 + } totalGold += sellGold // 计算本次出售赚的金币 if sellGold-preGold > 0 { troll.TotalEarn += int64(sellGold - preGold) } this.SeTrollRankList(troll.TotalEarn, session.GetUserId()) // 设置排行数据 + troll.AiCount++ if troll.AiCount > aiCount { //达到最大交易次数 break @@ -122,7 +129,15 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai sellPrice[v.Id] = v.Goodsprice * coefficient.Coefficient / 1000 } troll.Shop = make(map[int32]int32) // 买之前清除购买上限 - totalGold += this.BuyAllItem(session.GetUserId(), troll, sellPrice) + buyGold := this.BuyAllItem(session.GetUserId(), troll, sellPrice) + if buyGold != 0 { + if code = this.ModuleUser.AddAttributeValue(session, comm.ResGold, buyGold, true); code != pb.ErrorCode_Success { + this.Errorf("玩家 uid:%s 金币不足,获得金币%d", session.GetUserId(), buyGold) + } + } + + totalGold += buyGold + } } else { // 超过当前时间 troll.RefreshTime -= int64(sz[index]) @@ -133,7 +148,7 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai break } } - this.ModuleUser.AddAttributeValue(session, comm.ResGold, totalGold, true) + update["refreshTime"] = troll.RefreshTime update["tarinPos"] = troll.TarinPos update["rangeId"] = troll.RangeId @@ -149,7 +164,7 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai } // 出售所有货物 -func (this *Troll) SellAllItem(troll *pb.DBTrollTrain, price map[int32]int32) (gold int32) { +func (this *Troll) SellAllItem(uid string, troll *pb.DBTrollTrain, price map[int32]int32) (gold int32) { for k, v := range troll.Items { if _, ok := price[k]; ok { gold += price[k] * v @@ -158,6 +173,11 @@ func (this *Troll) SellAllItem(troll *pb.DBTrollTrain, price map[int32]int32) (g } troll.Price = make(map[int32]int32, 0) // 原来的价格也清除 troll.GridNum = 0 // 清空格子 + // 写统计 + if gold > 0 { + this.record.AddTrollRecord(uid, gold) + } + return } @@ -167,6 +187,7 @@ func (this *Troll) BuyAllItem(uid string, troll *pb.DBTrollTrain, price map[int3 box map[int32]int32 // 盒子 存放可购买的物品 leftGirdNum int32 // 剩余可购买格子数量 costGold int32 + buyBox map[int32]int32 // 盒子 存放可购买的物品 ) maxGirdNum := this.configure.GetTrollRule(comm.TrollGridCount) // 获取背包最大格子数量 @@ -174,6 +195,7 @@ func (this *Troll) BuyAllItem(uid string, troll *pb.DBTrollTrain, price map[int3 leftGirdNum = maxGirdNum - troll.GridNum box = make(map[int32]int32, 0) + buyBox = make(map[int32]int32, 0) goods := this.configure.GetTrollAllGoods() for _, v := range goods { for { @@ -209,9 +231,15 @@ func (this *Troll) BuyAllItem(uid string, troll *pb.DBTrollTrain, price map[int3 costGold += price[k] // 返还之前扣的 break } + buyBox[k]++ } } - troll.Items = box + if len(buyBox) == 0 { + return // 没有可购买的直接返回 + } + for _, v := range goods { + troll.Items[v.Id] += buyBox[v.Id] + } gold = costGold // 统计格子 troll.GridNum = 0 @@ -220,7 +248,10 @@ func (this *Troll) BuyAllItem(uid string, troll *pb.DBTrollTrain, price map[int3 troll.GridNum += int32(math.Ceil(float64(v) / float64(maxgoods))) } } - + // 写统计 + if gold != 0 { + this.record.AddTrollRecord(uid, gold) + } return } @@ -244,7 +275,6 @@ func (this *Troll) SeTrollRankList(gold int64, uid string) { this.Errorln(err) return } - } func (this *Troll) QueryRankList() (ranks []string, gold []int64, err error) { var ( diff --git a/pb/troll_db.pb.go b/pb/troll_db.pb.go index b9a80dfbf..4057b98a7 100644 --- a/pb/troll_db.pb.go +++ b/pb/troll_db.pb.go @@ -220,6 +220,78 @@ func (x *DBTrollTrain) GetResetTime() int64 { return 0 } +// 收益记录 +type DBTrollRecord 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 + Gold int32 `protobuf:"varint,3,opt,name=gold,proto3" json:"gold"` // 收益 + Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time"` // 交易时间 +} + +func (x *DBTrollRecord) Reset() { + *x = DBTrollRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBTrollRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBTrollRecord) ProtoMessage() {} + +func (x *DBTrollRecord) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_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 DBTrollRecord.ProtoReflect.Descriptor instead. +func (*DBTrollRecord) Descriptor() ([]byte, []int) { + return file_troll_troll_db_proto_rawDescGZIP(), []int{1} +} + +func (x *DBTrollRecord) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBTrollRecord) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBTrollRecord) GetGold() int32 { + if x != nil { + return x.Gold + } + return 0 +} + +func (x *DBTrollRecord) GetTime() int64 { + if x != nil { + return x.Time + } + return 0 +} + var File_troll_troll_db_proto protoreflect.FileDescriptor var file_troll_troll_db_proto_rawDesc = []byte{ @@ -283,8 +355,14 @@ var file_troll_troll_db_proto_rawDesc = []byte{ 0x53, 0x75, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x49, 0x44, 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, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x59, 0x0a, 0x0d, 0x44, + 0x42, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 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, 0x12, + 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, + 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -299,21 +377,22 @@ func file_troll_troll_db_proto_rawDescGZIP() []byte { return file_troll_troll_db_proto_rawDescData } -var file_troll_troll_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_troll_troll_db_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_troll_troll_db_proto_goTypes = []interface{}{ - (*DBTrollTrain)(nil), // 0: DBTrollTrain - nil, // 1: DBTrollTrain.ItemsEntry - nil, // 2: DBTrollTrain.PriceEntry - nil, // 3: DBTrollTrain.NpcRewardEntry - nil, // 4: DBTrollTrain.ShopEntry - nil, // 5: DBTrollTrain.SurpriseIDEntry + (*DBTrollTrain)(nil), // 0: DBTrollTrain + (*DBTrollRecord)(nil), // 1: DBTrollRecord + nil, // 2: DBTrollTrain.ItemsEntry + nil, // 3: DBTrollTrain.PriceEntry + nil, // 4: DBTrollTrain.NpcRewardEntry + nil, // 5: DBTrollTrain.ShopEntry + nil, // 6: DBTrollTrain.SurpriseIDEntry } var file_troll_troll_db_proto_depIdxs = []int32{ - 1, // 0: DBTrollTrain.items:type_name -> DBTrollTrain.ItemsEntry - 2, // 1: DBTrollTrain.price:type_name -> DBTrollTrain.PriceEntry - 3, // 2: DBTrollTrain.npcReward:type_name -> DBTrollTrain.NpcRewardEntry - 4, // 3: DBTrollTrain.shop:type_name -> DBTrollTrain.ShopEntry - 5, // 4: DBTrollTrain.surpriseID:type_name -> DBTrollTrain.SurpriseIDEntry + 2, // 0: DBTrollTrain.items:type_name -> DBTrollTrain.ItemsEntry + 3, // 1: DBTrollTrain.price:type_name -> DBTrollTrain.PriceEntry + 4, // 2: DBTrollTrain.npcReward:type_name -> DBTrollTrain.NpcRewardEntry + 5, // 3: DBTrollTrain.shop:type_name -> DBTrollTrain.ShopEntry + 6, // 4: DBTrollTrain.surpriseID:type_name -> DBTrollTrain.SurpriseIDEntry 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 @@ -339,6 +418,18 @@ func file_troll_troll_db_proto_init() { return nil } } + file_troll_troll_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBTrollRecord); 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{ @@ -346,7 +437,7 @@ func file_troll_troll_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_troll_troll_db_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/troll_msg.pb.go b/pb/troll_msg.pb.go index 9ce4d85f4..4abeac200 100644 --- a/pb/troll_msg.pb.go +++ b/pb/troll_msg.pb.go @@ -581,6 +581,92 @@ func (x *TrollRankListResp) GetData() []*RankData { return nil } +// 获取收益明细 +type TrollRecordListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TrollRecordListReq) Reset() { + *x = TrollRecordListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollRecordListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollRecordListReq) ProtoMessage() {} + +func (x *TrollRecordListReq) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_msg_proto_msgTypes[11] + 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 TrollRecordListReq.ProtoReflect.Descriptor instead. +func (*TrollRecordListReq) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{11} +} + +type TrollRecordListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*DBTrollRecord `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` +} + +func (x *TrollRecordListResp) Reset() { + *x = TrollRecordListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_troll_troll_msg_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrollRecordListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrollRecordListResp) ProtoMessage() {} + +func (x *TrollRecordListResp) ProtoReflect() protoreflect.Message { + mi := &file_troll_troll_msg_proto_msgTypes[12] + 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 TrollRecordListResp.ProtoReflect.Descriptor instead. +func (*TrollRecordListResp) Descriptor() ([]byte, []int) { + return file_troll_troll_msg_proto_rawDescGZIP(), []int{12} +} + +func (x *TrollRecordListResp) GetData() []*DBTrollRecord { + if x != nil { + return x.Data + } + return nil +} + var File_troll_troll_msg_proto protoreflect.FileDescriptor var file_troll_troll_msg_proto_rawDesc = []byte{ @@ -631,8 +717,13 @@ var file_troll_troll_msg_proto_rawDesc = []byte{ 0x69, 0x74, 0x6c, 0x65, 0x22, 0x32, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x14, 0x0a, 0x12, 0x54, 0x72, 0x6f, 0x6c, + 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x39, + 0x0a, 0x13, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -647,34 +738,38 @@ func file_troll_troll_msg_proto_rawDescGZIP() []byte { return file_troll_troll_msg_proto_rawDescData } -var file_troll_troll_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_troll_troll_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 14) 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 - (*TrollRankListReq)(nil), // 8: TrollRankListReq - (*RankData)(nil), // 9: RankData - (*TrollRankListResp)(nil), // 10: TrollRankListResp - nil, // 11: TrollBuyOrSellReq.ItemsEntry - (*DBTrollTrain)(nil), // 12: DBTrollTrain + (*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 + (*TrollRankListReq)(nil), // 8: TrollRankListReq + (*RankData)(nil), // 9: RankData + (*TrollRankListResp)(nil), // 10: TrollRankListResp + (*TrollRecordListReq)(nil), // 11: TrollRecordListReq + (*TrollRecordListResp)(nil), // 12: TrollRecordListResp + nil, // 13: TrollBuyOrSellReq.ItemsEntry + (*DBTrollTrain)(nil), // 14: DBTrollTrain + (*DBTrollRecord)(nil), // 15: DBTrollRecord } var file_troll_troll_msg_proto_depIdxs = []int32{ - 12, // 0: TrollGetListResp.data:type_name -> DBTrollTrain - 11, // 1: TrollBuyOrSellReq.items:type_name -> TrollBuyOrSellReq.ItemsEntry - 12, // 2: TrollBuyOrSellResp.data:type_name -> DBTrollTrain - 12, // 3: TrollAfkSetResp.data:type_name -> DBTrollTrain - 12, // 4: TrollNpcRewardResp.data:type_name -> DBTrollTrain + 14, // 0: TrollGetListResp.data:type_name -> DBTrollTrain + 13, // 1: TrollBuyOrSellReq.items:type_name -> TrollBuyOrSellReq.ItemsEntry + 14, // 2: TrollBuyOrSellResp.data:type_name -> DBTrollTrain + 14, // 3: TrollAfkSetResp.data:type_name -> DBTrollTrain + 14, // 4: TrollNpcRewardResp.data:type_name -> DBTrollTrain 9, // 5: TrollRankListResp.data:type_name -> RankData - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 15, // 6: TrollRecordListResp.data:type_name -> DBTrollRecord + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_troll_troll_msg_proto_init() } @@ -816,6 +911,30 @@ func file_troll_troll_msg_proto_init() { return nil } } + file_troll_troll_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollRecordListReq); 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[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrollRecordListResp); 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{ @@ -823,7 +942,7 @@ func file_troll_troll_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_troll_troll_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 14, NumExtensions: 0, NumServices: 0, },