From c361042acfb2a4e0eac1498b6f28d0b6461cfa4e Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 24 May 2023 18:52:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=A7=E6=97=B6=E5=85=89?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/combat/api_challengereceive.go | 10 ++- modules/combat/api_drop.go | 9 +- modules/combat/module.go | 14 ++-- modules/mline/module.go | 1 - modules/oldtimes/api_getall.go | 50 ++++++----- modules/oldtimes/module.go | 7 +- pb/combat_msg.pb.go | 111 +++++++++++++------------ pb/oldtimes_db.pb.go | 20 +++-- 9 files changed, 128 insertions(+), 96 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index e13c8592f..9f1e4e06f 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -494,7 +494,7 @@ type ( // 关卡编辑器 ICombat interface { // 获取关卡状态 - GetLevelStatus(uid string, levelId int32) bool + GetLevels(uid string) (levels map[int32]*pb.DBCombatLevel) } ICaravan interface { diff --git a/modules/combat/api_challengereceive.go b/modules/combat/api_challengereceive.go index 0456a91b7..86b50a909 100644 --- a/modules/combat/api_challengereceive.go +++ b/modules/combat/api_challengereceive.go @@ -25,6 +25,14 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC ok bool err error ) + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Code: code, Level: req.Level, Manster: req.Manster, Atns: atns, Progress: lv.Progress}) + } else { + session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Code: code, Level: req.Level, Manster: req.Manster}) + } + }() + if code = this.ChallengeReceiveCheck(session, req); code != pb.ErrorCode_Success { return } @@ -76,9 +84,7 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC code = pb.ErrorCode_DBError return } - } - session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Issucc: true, Level: req.Level, Manster: req.Manster, Atns: atns, Progress: lv.Progress}) return } diff --git a/modules/combat/api_drop.go b/modules/combat/api_drop.go index a8ea9be40..1fbd59248 100644 --- a/modules/combat/api_drop.go +++ b/modules/combat/api_drop.go @@ -23,6 +23,13 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod ok bool err error ) + defer func() { + if code == pb.ErrorCode_Success { + session.SendMsg(string(this.module.GetType()), "drop", &pb.CombatDropResp{Code: code, Atns: atns, Progress: lv.Progress}) + } else { + session.SendMsg(string(this.module.GetType()), "drop", &pb.CombatDropResp{Code: code}) + } + }() if code = this.DropCheck(session, req); code != pb.ErrorCode_Success { return } @@ -74,6 +81,6 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod code = pb.ErrorCode_DBError return } - session.SendMsg(string(this.module.GetType()), "drop", &pb.CombatDropResp{Code: code, Atns: atns, Progress: lv.Progress}) + return } diff --git a/modules/combat/module.go b/modules/combat/module.go index 88576e493..90c2ce458 100644 --- a/modules/combat/module.go +++ b/modules/combat/module.go @@ -64,16 +64,12 @@ func (this *Combat) EventUserOffline(uid, sessionid string) { this.modelCombat.delInfo(uid) } -func (this *Combat) GetLevelStatus(uid string, levelId int32) bool { +func (this *Combat) GetLevelStatus(uid string) (levels map[int32]*pb.DBCombatLevel) { combat := &pb.DBCombatUser{} + levels = make(map[int32]*pb.DBCombatLevel) if err := this.modelCombat.Get(uid, combat); err != nil { - return false + return } - - if combat != nil { - if v, ok := combat.Level[levelId]; ok { - return v.Pass == 1 - } - } - return false + levels = combat.Level + return } diff --git a/modules/mline/module.go b/modules/mline/module.go index 44c3db016..0034d8084 100644 --- a/modules/mline/module.go +++ b/modules/mline/module.go @@ -45,7 +45,6 @@ func (this *Mline) Start() (err error) { if module, err = this.service.GetModule(comm.ModuleBattle); err != nil { return } - this.battle = module.(comm.IBattle) return } diff --git a/modules/oldtimes/api_getall.go b/modules/oldtimes/api_getall.go index 4d8799668..63619382c 100644 --- a/modules/oldtimes/api_getall.go +++ b/modules/oldtimes/api_getall.go @@ -19,28 +19,36 @@ func (this *apiComp) Getall(session comm.IUserSession, req *pb.OldtimesGetallReq // 解锁的关卡 var unlockLevelIds []int32 // 更新关卡状态 - if imodule, err := this.service.GetModule(comm.ModuleCombat); err == nil { - if combat, ok := imodule.(comm.ICombat); ok { - for _, chapter := range d.Chapters { - if chapter.Status == int32(finish) { - continue - } - for _, level := range chapter.Levels { - if level.Status == int32(finish) { - unlockLevelIds = append(unlockLevelIds, level.Lid) - continue - } - conf := this.module.configure.getMaintaskCfgBy(level.Lid) - if conf != nil { - if combat.GetLevelStatus(uid, conf.Stageid) { - level.Status = int32(finish) - if err := this.module.modelOldtimes.updateOldtimes(uid, d); err != nil { - this.module.Error("oldtime更新失败", - log.Field{Key: "uid", Value: uid}) - continue - } - unlockLevelIds = append(unlockLevelIds, level.Lid) + levels := this.module.combat.GetLevels(uid) + for _, chapter := range d.Chapters { + if chapter.Status == int32(lock) { + continue + } + for _, level := range chapter.Levels { + if level.Status == int32(finish) { + unlockLevelIds = append(unlockLevelIds, level.Lid) + continue + } + conf := this.module.configure.getMaintaskCfgBy(level.Lid) + if conf != nil { + if v, ok := levels[conf.Stageid]; ok { + if v.Pass == 1 || v.Pass == 2 { + level.Status = int32(finish) + level.Progress = v.Progress + if err := this.module.modelOldtimes.updateOldtimes(uid, d); err != nil { + this.module.Error("oldtime更新失败", + log.Field{Key: "uid", Value: uid}) + continue } + unlockLevelIds = append(unlockLevelIds, level.Lid) + } else if v.Pass == 0 { + level.Progress = v.Progress + if err := this.module.modelOldtimes.updateOldtimes(uid, d); err != nil { + this.module.Error("oldtime更新失败", + log.Field{Key: "uid", Value: uid}) + continue + } + unlockLevelIds = append(unlockLevelIds, level.Lid) } } } diff --git a/modules/oldtimes/module.go b/modules/oldtimes/module.go index 156ebdfa6..7cb9bc659 100644 --- a/modules/oldtimes/module.go +++ b/modules/oldtimes/module.go @@ -7,9 +7,9 @@ import ( "go_dreamfactory/modules" ) - type Oldtimes struct { modules.ModuleBase + combat comm.ICombat api *apiComp service base.IRPCXService configure *configureComp @@ -39,5 +39,10 @@ func (this *Oldtimes) GetType() core.M_Modules { func (this *Oldtimes) Start() (err error) { err = this.ModuleBase.Start() + var module core.IModule + if module, err = this.service.GetModule(comm.ModuleCombat); err != nil { + return + } + this.combat = module.(comm.ICombat) return } diff --git a/pb/combat_msg.pb.go b/pb/combat_msg.pb.go index 3a77a5c92..0aca71733 100644 --- a/pb/combat_msg.pb.go +++ b/pb/combat_msg.pb.go @@ -432,8 +432,8 @@ type CombatChallengeReceiveResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` - Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level"` //管卡id + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level"` //管卡id Manster int32 `protobuf:"varint,3,opt,name=manster,proto3" json:"manster"` Atns []*UserAssets `protobuf:"bytes,4,rep,name=atns,proto3" json:"atns"` //获取物品 Progress int32 `protobuf:"varint,5,opt,name=progress,proto3" json:"progress"` //进度 @@ -471,11 +471,11 @@ func (*CombatChallengeReceiveResp) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{7} } -func (x *CombatChallengeReceiveResp) GetIssucc() bool { +func (x *CombatChallengeReceiveResp) GetCode() ErrorCode { if x != nil { - return x.Issucc + return x.Code } - return false + return ErrorCode_Success } func (x *CombatChallengeReceiveResp) GetLevel() int32 { @@ -821,47 +821,47 @@ var file_combat_combat_msg_proto_rawDesc = []byte{ 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 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, 0x22, 0xa1, 0x01, 0x0a, 0x1a, 0x43, 0x6f, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0xa9, 0x01, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, - 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x1f, 0x0a, 0x04, 0x61, 0x74, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x04, 0x61, 0x74, 0x6e, - 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x39, 0x0a, - 0x0d, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x12, 0x14, - 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x22, 0x83, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, - 0x62, 0x61, 0x74, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x61, - 0x74, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x04, 0x61, 0x74, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x28, - 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x41, 0x73, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x52, - 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xd7, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6d, - 0x62, 0x61, 0x74, 0x41, 0x73, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, - 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x61, 0x73, 0x73, 0x6d, 0x61, 0x69, 0x6e, - 0x74, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0c, 0x70, 0x61, 0x73, 0x73, - 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, - 0x70, 0x65, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, - 0x61, 0x73, 0x73, 0x70, 0x65, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, 0x12, 0x29, - 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x09, - 0x6d, 0x61, 0x69, 0x6e, 0x61, 0x77, 0x61, 0x72, 0x64, 0x12, 0x27, 0x0a, 0x08, 0x70, 0x65, 0x72, - 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x08, 0x70, 0x65, 0x72, 0x61, 0x77, 0x61, - 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x04, 0x61, 0x74, 0x6e, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x73, 0x52, 0x04, 0x61, 0x74, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x39, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x44, + 0x72, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x72, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x64, 0x72, 0x6f, 0x70, + 0x22, 0x83, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x44, 0x72, 0x6f, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x61, 0x74, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x04, + 0x61, 0x74, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x28, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, + 0x41, 0x73, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x22, 0xd7, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x41, 0x73, 0x6b, 0x50, 0x61, + 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0c, + 0x70, 0x61, 0x73, 0x73, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x0c, 0x70, 0x61, 0x73, 0x73, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, + 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x70, 0x65, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x70, 0x65, 0x72, 0x74, 0x61, + 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, 0x12, 0x29, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x61, 0x77, + 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x61, 0x77, 0x61, 0x72, + 0x64, 0x12, 0x27, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x52, 0x08, 0x70, 0x65, 0x72, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -905,16 +905,17 @@ var file_combat_combat_msg_proto_depIdxs = []int32{ 15, // 3: CombatChallengeResp.code:type_name -> ErrorCode 16, // 4: CombatChallengeResp.info:type_name -> BattleInfo 17, // 5: CombatChallengeReceiveReq.report:type_name -> BattleReport - 18, // 6: CombatChallengeReceiveResp.atns:type_name -> UserAssets - 15, // 7: CombatDropResp.code:type_name -> ErrorCode - 18, // 8: CombatDropResp.atns:type_name -> UserAssets - 18, // 9: CombatAskPassResp.mainaward:type_name -> UserAssets - 18, // 10: CombatAskPassResp.peraward:type_name -> UserAssets - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 15, // 6: CombatChallengeReceiveResp.code:type_name -> ErrorCode + 18, // 7: CombatChallengeReceiveResp.atns:type_name -> UserAssets + 15, // 8: CombatDropResp.code:type_name -> ErrorCode + 18, // 9: CombatDropResp.atns:type_name -> UserAssets + 18, // 10: CombatAskPassResp.mainaward:type_name -> UserAssets + 18, // 11: CombatAskPassResp.peraward:type_name -> UserAssets + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_combat_combat_msg_proto_init() } diff --git a/pb/oldtimes_db.pb.go b/pb/oldtimes_db.pb.go index 863a8ce73..a69aef7da 100644 --- a/pb/oldtimes_db.pb.go +++ b/pb/oldtimes_db.pb.go @@ -151,8 +151,9 @@ type Level struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Lid int32 `protobuf:"varint,1,opt,name=lid,proto3" json:"lid" bson:"lid"` //关卡ID - Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status" bson:"status"` //状态 0锁定 1已解锁 2进行中 3已完成 + Lid int32 `protobuf:"varint,1,opt,name=lid,proto3" json:"lid" bson:"lid"` //关卡ID + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status" bson:"status"` //状态 0锁定 1已解锁 2进行中 3已完成 + Progress int32 `protobuf:"varint,3,opt,name=progress,proto3" json:"progress" bson:"progress"` //进度值 物品数量 } func (x *Level) Reset() { @@ -201,6 +202,13 @@ func (x *Level) GetStatus() int32 { return 0 } +func (x *Level) GetProgress() int32 { + if x != nil { + return x.Progress + } + return 0 +} + var File_oldtimes_oldtimes_db_proto protoreflect.FileDescriptor var file_oldtimes_oldtimes_db_proto_rawDesc = []byte{ @@ -217,11 +225,13 @@ var file_oldtimes_oldtimes_db_proto_rawDesc = []byte{ 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x06, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x73, 0x22, 0x31, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, + 0x65, 0x6c, 0x73, 0x22, 0x4d, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var (