diff --git a/comm/const.go b/comm/const.go index e91b49ac0..b22a56a30 100644 --- a/comm/const.go +++ b/comm/const.go @@ -126,6 +126,7 @@ const ( ModuleMoonlv core.M_Modules = "moonlv" //护月等级 ModuleWhackamole core.M_Modules = "whackamole" //大豚鼠 ModuleMonkey core.M_Modules = "monkey" //猴拳 + ModuleIntegral core.M_Modules = "integral" // 积分boss ) // 数据表名定义处 @@ -430,6 +431,9 @@ const ( TableWhackamole = "whackamole" // 猴拳 TableMonkey = "monkey" + + // 积分boss + TableIntegral = "integral" ) // RPC服务接口定义处 diff --git a/modules/integral/api.go b/modules/integral/api.go index fa57a2369..9e0732ac1 100644 --- a/modules/integral/api.go +++ b/modules/integral/api.go @@ -6,21 +6,11 @@ import ( "go_dreamfactory/modules" ) -const ( - EnchantGetListResp = "getlist" - EnchantChallengeResp = "challenge" - EnchantChallengeOverResp = "challengeover" - EnchantSkillLvResp = "skilllv" - EnchantGetRewardResp = "getreward" - EnchantBuyResp = "buy" - EnchantRankListResp = "ranklist" -) - type apiComp struct { modules.MCompGate service core.IService configure *configureComp - module *Enchant + module *Integral friend comm.IFriend chat comm.IChat } @@ -28,7 +18,7 @@ type apiComp struct { //组件初始化接口 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.(*Enchant) + this.module = module.(*Integral) this.service = service return diff --git a/modules/integral/api_challenge.go b/modules/integral/api_challenge.go index c396ab520..576ff45c7 100644 --- a/modules/integral/api_challenge.go +++ b/modules/integral/api_challenge.go @@ -3,12 +3,11 @@ package integral import ( "go_dreamfactory/comm" "go_dreamfactory/pb" - cfg "go_dreamfactory/sys/configure/structs" ) // 参数校验 -func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.EnchantChallengeReq) (errdata *pb.ErrorData) { - if req.BossType <= 0 || req.Battle == nil { +func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.IntegralChallengeReq) (errdata *pb.ErrorData) { + if req.Nandu <= 0 || req.Battle == nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, Title: pb.ErrorCode_ReqParameterError.ToString(), @@ -19,13 +18,13 @@ func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.EnchantCh } // /挑战主线关卡 -func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallengeReq) (errdata *pb.ErrorData) { +func (this *apiComp) Challenge(session comm.IUserSession, req *pb.IntegralChallengeReq) (errdata *pb.ErrorData) { errdata = this.ChallengeCheck(session, req) if errdata != nil { return // 参数校验失败直接返回 } - enchant, err := this.module.modelEnchant.getEnchantList(session.GetUserId()) + list, err := this.module.modelIntegral.getIntegralList(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_PagodaNotFound, // 道具数量不足 @@ -34,7 +33,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen return } - cfgData, err := this.module.configure.GetEnchantBossConfigData(req.BossType) + cfgData, err := this.module.configure.GetStageBoss(list.Hid, req.Nandu) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, // 道具数量不足 @@ -43,57 +42,30 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen } return } - if len(cfgData) <= 0 { /// 启动前校验 - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ConfigNoFound, // 道具数量不足 - Title: pb.ErrorCode_ConfigNoFound.ToString(), - } - return - } - if errdata = this.module.CheckRes(session, cfgData[0].PsConsume); errdata != nil { - return - } - _, ok := enchant.Boss[req.BossType] - if !ok { // 类型校验 - enchant.Boss[req.BossType] = 0 - } - // 获取分数 - var score int32 - var format []int32 - var battleconf *cfg.GameEnchantBossData - score = int32(enchant.Boss[req.BossType]) - for _, v := range cfgData { - if v.ScoreLow <= score && v.ScoreUp >= score { - format = v.Boss - battleconf = v - } - } errdata, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ - Rulesid: battleconf.BattleReadyID, + Rulesid: cfgData.BattleReadyID, Ptype: pb.PlayType_enchant, Title: "", Format: req.Battle, - Mformat: format, + Mformat: cfgData.Boss, }) if errdata != nil { return } - session.SendMsg(string(this.module.GetType()), EnchantChallengeResp, &pb.EnchantChallengeResp{ - Info: &pb.BattleInfo{ - Id: record.Id, + session.SendMsg(string(this.module.GetType()), "challenge", &pb.IntegralChallengeResp{ + Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, - Rulesid: battleconf.BattleReadyID, + Rulesid: cfgData.BattleReadyID, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist, - Tasks: record.Tasks, - }, - BossType: req.BossType, + Tasks: record.Tasks}, + Nandu: req.Nandu, }) return diff --git a/modules/integral/api_challengeover.go b/modules/integral/api_challengeover.go index 60e2a7174..0cd601cd3 100644 --- a/modules/integral/api_challengeover.go +++ b/modules/integral/api_challengeover.go @@ -7,8 +7,8 @@ import ( ) //参数校验 -func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.EnchantChallengeOverReq) (errdata *pb.ErrorData) { - if req.BossType <= 0 { +func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.IntegralChallengeOverReq) (errdata *pb.ErrorData) { + if req.Nandu <= 0 { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, Title: pb.ErrorCode_ReqParameterError.ToString(), @@ -19,11 +19,9 @@ func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.Encha } ///挑战主线关卡 -func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantChallengeOverReq) (errdata *pb.ErrorData) { +func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralChallengeOverReq) (errdata *pb.ErrorData) { var ( mapData map[string]interface{} - bWin bool // 战斗是否胜利 - score int32 // 通关获得分数 res []*cfg.Gameatn ) mapData = make(map[string]interface{}, 0) @@ -33,7 +31,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha return // 参数校验失败直接返回 } - enchant, err := this.module.modelEnchant.getEnchantList(session.GetUserId()) + list, err := this.module.modelIntegral.getIntegralList(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_PagodaNotFound, @@ -42,7 +40,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha return } - cfgEnchant, err := this.module.configure.GetEnchantBossConfigData(req.BossType) + cfgData, err := this.module.configure.GetStageBoss(list.Hid, req.Nandu) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, // 道具数量不足 @@ -53,27 +51,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha } // check - errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report) + errdata, _ = this.module.battle.CheckBattleReport(session, req.Report) if errdata != nil { return } - if !bWin { // 战斗失败了 直接返回 - if errdata = this.module.ConsumeRes(session, cfgEnchant[0].PsMg, true); errdata != nil { - return - } - session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant}) - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EnchantChallengeOverReq", cfgEnchant[0].PsMg) - }) - return - } - if errdata = this.module.ConsumeRes(session, cfgEnchant[0].PsConsume, true); errdata != nil { - return - } - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EnchantChallengeOverReq", cfgEnchant[0].PsConsume) - }) userinfo, err := this.module.ModuleUser.GetUser(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ @@ -83,42 +65,28 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha } return } - key := req.BossType - if enchant.BossTime[key] > req.Report.Costtime || enchant.BossTime[key] == 0 { - enchant.BossTime[key] = req.Report.Costtime - mapData["bossTime"] = enchant.BossTime // 更新时间 - this.module.CheckRank(session.GetUserId(), req.BossType, req.Report, userinfo, req.Score) - } - - enchant.Boss[req.BossType] = req.Score // 获得的积分 // 发放通关随机奖励 - for _, v := range cfgEnchant { - if score >= v.ScoreLow && score <= v.ScoreUp { - for _, v1 := range v.RewardDrop { - reward := this.module.ModuleTools.GetGroupDataByLottery(v1, userinfo.Vip, userinfo.Lv) - res = append(res, reward...) - } - } + for _, v := range cfgData.Firstprize { + res = append(res, v) } + reward := this.module.ModuleTools.GetGroupDataByLottery(cfgData.Drop, userinfo.Vip, userinfo.Lv) + res = append(res, reward...) + if len(res) > 0 { if errdata = this.module.DispenseRes(session, res, true); errdata != nil { return } go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "EnchantChallengeOverReq", res) + this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "IntegralChallengeOverReq", res) }) } - mapData["bossTime"] = enchant.BossTime - mapData["boss"] = enchant.Boss - errdata = this.module.ModifyEnchantData(session.GetUserId(), mapData) - if session.GetUserId() != "" { // 恢复时间 - if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { - enchant.RecoveryTime = userexpand.Recovertimeunifiedticket - } - } - session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant}) + errdata = this.module.ModifyIntegralData(session.GetUserId(), mapData) + + session.SendMsg(string(this.module.GetType()), "challengeover", &pb.IntegralChallengeOverResp{ + Data: list, + }) return } diff --git a/modules/integral/api_getlist.go b/modules/integral/api_getlist.go index 787631bba..edc8c9f06 100644 --- a/modules/integral/api_getlist.go +++ b/modules/integral/api_getlist.go @@ -9,34 +9,27 @@ import ( ) //参数校验 -func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.EnchantGetListReq) (errdata *pb.ErrorData) { +func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.IntegralGetListReq) (errdata *pb.ErrorData) { return } -func (this *apiComp) GetList(session comm.IUserSession, req *pb.EnchantGetListReq) (errdata *pb.ErrorData) { +func (this *apiComp) GetList(session comm.IUserSession, req *pb.IntegralGetListReq) (errdata *pb.ErrorData) { - // 刷新挑战卷 - if errdata = this.module.ModuleItems.RecoverTicket(session); errdata != nil { - return - } - - list, err := this.module.modelEnchant.getEnchantList(session.GetUserId()) + list, err := this.module.modelIntegral.getIntegralList(session.GetUserId()) if mgo.MongodbNil == err { list.Id = primitive.NewObjectID().Hex() list.Uid = session.GetUserId() - list.Boss = make(map[int32]int64) - list.BossTime = make(map[int32]int32) - this.module.modelEnchant.Add(session.GetUserId(), list) - } - if session.GetUserId() != "" { // 恢复时间 - if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { - list.RecoveryTime = userexpand.Recovertimeunifiedticket - } + this.module.modelIntegral.Add(session.GetUserId(), list) } + // if session.GetUserId() != "" { // 恢复时间 + // if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { + // list.RecoveryTime = userexpand.Recovertimeunifiedticket + // } + // } - session.SendMsg(string(this.module.GetType()), EnchantGetListResp, &pb.EnchantGetListResp{Data: list}) + session.SendMsg(string(this.module.GetType()), "getlist", &pb.IntegralGetListResp{Data: list}) return } diff --git a/modules/integral/model_enchant.go b/modules/integral/model_integral.go similarity index 51% rename from modules/integral/model_enchant.go rename to modules/integral/model_integral.go index 61e36656b..08bc44079 100644 --- a/modules/integral/model_enchant.go +++ b/modules/integral/model_integral.go @@ -11,15 +11,15 @@ import ( "go.mongodb.org/mongo-driver/x/bsonx" ) -type modelEnchant struct { +type modelIntegral struct { modules.MCompModel - module *Enchant + module *Integral } -func (this *modelEnchant) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - this.TableName = string(comm.TableEnchant) +func (this *modelIntegral) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = string(comm.TableIntegral) err = this.MCompModel.Init(service, module, comp, options) - this.module = module.(*Enchant) + this.module = module.(*Integral) // uid 创建索引 this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, @@ -27,17 +27,17 @@ func (this *modelEnchant) Init(service core.IService, module core.IModule, comp return } -func (this *modelEnchant) modifyEnchantDataByObjId(uid string, data map[string]interface{}) error { +func (this *modelIntegral) modifyIntegralDataByObjId(uid string, data map[string]interface{}) error { return this.Change(uid, data) } // 获取列表信息 -func (this *modelEnchant) getEnchantList(uid string) (result *pb.DBEnchant, err error) { - result = &pb.DBEnchant{ - Id: primitive.NewObjectID().Hex(), - Uid: uid, - Boss: make(map[int32]int64), - BossTime: make(map[int32]int32), +func (this *modelIntegral) getIntegralList(uid string) (result *pb.DBIntegralBoss, err error) { + result = &pb.DBIntegralBoss{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Buff: map[int32]int32{}, + Score: map[int32]int32{}, } if err = this.Get(uid, result); err != nil { return diff --git a/modules/integral/module.go b/modules/integral/module.go index 14e560e20..aee395922 100644 --- a/modules/integral/module.go +++ b/modules/integral/module.go @@ -7,25 +7,25 @@ import ( "go_dreamfactory/pb" ) -type Enchant struct { +type Integral struct { modules.ModuleBase - modelEnchant *modelEnchant - api *apiComp - configure *configureComp + modelIntegral *modelIntegral + api *apiComp + configure *configureComp battle comm.IBattle service core.IService } func NewModule() core.IModule { - return &Enchant{} + return &Integral{} } -func (this *Enchant) GetType() core.M_Modules { - return comm.ModuleEnchant +func (this *Integral) GetType() core.M_Modules { + return comm.ModuleIntegral } -func (this *Enchant) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { +func (this *Integral) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { if err = this.ModuleBase.Init(service, module, options); err != nil { return } @@ -33,7 +33,7 @@ func (this *Enchant) Init(service core.IService, module core.IModule, options co return } -func (this *Enchant) Start() (err error) { +func (this *Integral) Start() (err error) { if err = this.ModuleBase.Start(); err != nil { return } @@ -46,16 +46,16 @@ func (this *Enchant) Start() (err error) { return } -func (this *Enchant) OnInstallComp() { +func (this *Integral) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api = this.RegisterComp(new(apiComp)).(*apiComp) - this.modelEnchant = this.RegisterComp(new(modelEnchant)).(*modelEnchant) + this.modelIntegral = this.RegisterComp(new(modelIntegral)).(*modelIntegral) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) } // 接口信息 -func (this *Enchant) ModifyEnchantData(uid string, data map[string]interface{}) (errdata *pb.ErrorData) { - err := this.modelEnchant.modifyEnchantDataByObjId(uid, data) +func (this *Integral) ModifyIntegralData(uid string, data map[string]interface{}) (errdata *pb.ErrorData) { + err := this.modelIntegral.modifyIntegralDataByObjId(uid, data) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, @@ -66,6 +66,6 @@ func (this *Enchant) ModifyEnchantData(uid string, data map[string]interface{}) return } -func (this *Enchant) CheckRank(uid string, boosID int32, report *pb.BattleReport, userinfo *pb.DBUser, score int64) { +func (this *Integral) CheckRank(uid string, boosID int32, report *pb.BattleReport, userinfo *pb.DBUser, score int64) { } diff --git a/pb/integral_db.pb.go b/pb/integral_db.pb.go index 75543dbd6..f4f738216 100644 --- a/pb/integral_db.pb.go +++ b/pb/integral_db.pb.go @@ -25,18 +25,20 @@ type DBIntegralBoss struct { 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 - Itype int32 `protobuf:"varint,3,opt,name=itype,proto3" json:"itype"` // boss 类型 1 难度模式 2 事件模式 - Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count"` // 今日挑战次数 - CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` //修改时间 - Etime int64 `protobuf:"varint,6,opt,name=etime,proto3" json:"etime"` // 活动结束时间 - Hid int32 `protobuf:"varint,7,opt,name=hid,proto3" json:"hid"` // 活动id - Maxscore int64 `protobuf:"varint,8,opt,name=maxscore,proto3" json:"maxscore"` // 最大积分 - Totalscore int64 `protobuf:"varint,9,opt,name=totalscore,proto3" json:"totalscore"` // 累计积分 - Reward1 int32 `protobuf:"varint,10,opt,name=reward1,proto3" json:"reward1"` // 类型1 奖励( Integralreward cid ) - Reward2 int32 `protobuf:"varint,11,opt,name=reward2,proto3" json:"reward2"` // 类型2 奖励( Integralreward cid ) - Buff map[int32]int32 `protobuf:"bytes,12,rep,name=buff,proto3" json:"buff" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 激活的buff (key Integralcondition value :0 未激活) + 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 + Itype int32 `protobuf:"varint,3,opt,name=itype,proto3" json:"itype"` // boss 类型 1 难度模式 2 事件模式 + Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count"` // 今日挑战次数 + CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` //修改时间 + Etime int64 `protobuf:"varint,6,opt,name=etime,proto3" json:"etime"` // 活动结束时间 + Hid int32 `protobuf:"varint,7,opt,name=hid,proto3" json:"hid"` // 活动id + Maxscore int64 `protobuf:"varint,8,opt,name=maxscore,proto3" json:"maxscore"` // 最大积分 + Totalscore int64 `protobuf:"varint,9,opt,name=totalscore,proto3" json:"totalscore"` // 累计积分 + Reward1 int32 `protobuf:"varint,10,opt,name=reward1,proto3" json:"reward1"` // 类型1 奖励( Integralreward cid ) + Reward2 int32 `protobuf:"varint,11,opt,name=reward2,proto3" json:"reward2"` // 类型2 奖励( Integralreward cid ) + Buff map[int32]int32 `protobuf:"bytes,12,rep,name=buff,proto3" json:"buff" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 激活的buff (key Integralcondition value :0 未激活) 注:事件类型 才有值 + Nandu int32 `protobuf:"varint,13,opt,name=nandu,proto3" json:"nandu"` // 已经解锁的难度 + Score map[int32]int32 `protobuf:"bytes,14,rep,name=score,proto3" json:"score" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 难度 value 积分 } func (x *DBIntegralBoss) Reset() { @@ -155,11 +157,25 @@ func (x *DBIntegralBoss) GetBuff() map[int32]int32 { return nil } +func (x *DBIntegralBoss) GetNandu() int32 { + if x != nil { + return x.Nandu + } + return 0 +} + +func (x *DBIntegralBoss) GetScore() map[int32]int32 { + if x != nil { + return x.Score + } + return nil +} + var File_integral_integral_db_proto protoreflect.FileDescriptor var file_integral_integral_db_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf4, 0x02, 0x0a, + 0x72, 0x61, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x0e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 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, @@ -179,12 +195,20 @@ var file_integral_integral_db_proto_rawDesc = []byte{ 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x32, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x75, 0x66, 0x66, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x2e, 0x42, 0x75, 0x66, 0x66, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x62, 0x75, 0x66, 0x66, 0x1a, 0x37, 0x0a, 0x09, 0x42, 0x75, - 0x66, 0x66, 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, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x62, 0x75, 0x66, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, + 0x6e, 0x64, 0x75, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, + 0x12, 0x30, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, + 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x63, 0x6f, + 0x72, 0x65, 0x1a, 0x37, 0x0a, 0x09, 0x42, 0x75, 0x66, 0x66, 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, 0x38, 0x0a, 0x0a, 0x53, + 0x63, 0x6f, 0x72, 0x65, 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 ( @@ -199,18 +223,20 @@ func file_integral_integral_db_proto_rawDescGZIP() []byte { return file_integral_integral_db_proto_rawDescData } -var file_integral_integral_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_integral_integral_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_integral_integral_db_proto_goTypes = []interface{}{ (*DBIntegralBoss)(nil), // 0: DBIntegralBoss nil, // 1: DBIntegralBoss.BuffEntry + nil, // 2: DBIntegralBoss.ScoreEntry } var file_integral_integral_db_proto_depIdxs = []int32{ 1, // 0: DBIntegralBoss.buff:type_name -> DBIntegralBoss.BuffEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 1: DBIntegralBoss.score:type_name -> DBIntegralBoss.ScoreEntry + 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_integral_integral_db_proto_init() } @@ -238,7 +264,7 @@ func file_integral_integral_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_integral_integral_db_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/integral_msg.pb.go b/pb/integral_msg.pb.go index 6659683ca..41f62cf46 100644 --- a/pb/integral_msg.pb.go +++ b/pb/integral_msg.pb.go @@ -111,8 +111,8 @@ type IntegralChallengeReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BossType int32 `protobuf:"varint,1,opt,name=bossType,proto3" json:"bossType"` // boos 类型 - Battle *BattleFormation `protobuf:"bytes,2,opt,name=battle,proto3" json:"battle"` + Nandu int32 `protobuf:"varint,1,opt,name=nandu,proto3" json:"nandu"` // boos 难度 + Battle *BattleFormation `protobuf:"bytes,2,opt,name=battle,proto3" json:"battle"` } func (x *IntegralChallengeReq) Reset() { @@ -147,9 +147,9 @@ func (*IntegralChallengeReq) Descriptor() ([]byte, []int) { return file_integral_integral_msg_proto_rawDescGZIP(), []int{2} } -func (x *IntegralChallengeReq) GetBossType() int32 { +func (x *IntegralChallengeReq) GetNandu() int32 { if x != nil { - return x.BossType + return x.Nandu } return 0 } @@ -166,8 +166,8 @@ type IntegralChallengeResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` - BossType int32 `protobuf:"varint,2,opt,name=bossType,proto3" json:"bossType"` // boos 类型 + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + Nandu int32 `protobuf:"varint,2,opt,name=nandu,proto3" json:"nandu"` // boos 类型 } func (x *IntegralChallengeResp) Reset() { @@ -209,9 +209,9 @@ func (x *IntegralChallengeResp) GetInfo() *BattleInfo { return nil } -func (x *IntegralChallengeResp) GetBossType() int32 { +func (x *IntegralChallengeResp) GetNandu() int32 { if x != nil { - return x.BossType + return x.Nandu } return 0 } @@ -221,9 +221,9 @@ type IntegralChallengeOverReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BossType int32 `protobuf:"varint,1,opt,name=bossType,proto3" json:"bossType"` // boos 类型 - Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报 - Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` //获得积分 或伤害 + Nandu int32 `protobuf:"varint,1,opt,name=nandu,proto3" json:"nandu"` // boos 难度 + Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报 + Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` //获得积分 或伤害 } func (x *IntegralChallengeOverReq) Reset() { @@ -258,9 +258,9 @@ func (*IntegralChallengeOverReq) Descriptor() ([]byte, []int) { return file_integral_integral_msg_proto_rawDescGZIP(), []int{4} } -func (x *IntegralChallengeOverReq) GetBossType() int32 { +func (x *IntegralChallengeOverReq) GetNandu() int32 { if x != nil { - return x.BossType + return x.Nandu } return 0 } @@ -340,30 +340,29 @@ var file_integral_integral_msg_proto_rawDesc = []byte{ 0x67, 0x72, 0x61, 0x6c, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x22, 0x5c, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, - 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, - 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x22, 0x54, 0x0a, 0x15, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, - 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, - 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, 0x73, 0x0a, 0x18, 0x49, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, - 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x40, 0x0a, - 0x19, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, - 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x56, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, + 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, + 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, + 0x64, 0x75, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x22, 0x4e, 0x0a, 0x15, + 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x22, 0x6d, 0x0a, 0x18, + 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x64, + 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x12, 0x25, + 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x40, 0x0a, 0x19, 0x49, + 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, + 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x6c, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (