diff --git a/modules/combat/api_challenge.go b/modules/combat/api_challenge.go index 272fdaf47..f8430b785 100644 --- a/modules/combat/api_challenge.go +++ b/modules/combat/api_challenge.go @@ -24,7 +24,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.CombatChalleng ) defer func() { if cd == pb.ErrorCode_Success { - session.SendMsg(string(this.module.GetType()), "challenge", &pb.CombatChallengeResp{Code: cd, Manster: req.Manster, Info: &pb.BattleInfo{ + session.SendMsg(string(this.module.GetType()), "challenge", &pb.CombatChallengeResp{Code: cd, Manster: req.Manster, Level: req.Level, Info: &pb.BattleInfo{ Id: record.Id, Title: record.Title, Btype: record.Btype, diff --git a/modules/combat/api_challengereceive.go b/modules/combat/api_challengereceive.go index bb92d6547..f0c9d3458 100644 --- a/modules/combat/api_challengereceive.go +++ b/modules/combat/api_challengereceive.go @@ -19,11 +19,12 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC var ( iswin bool info *pb.DBCombatUser + lv *pb.DBCombatLevel level *cfg.GameCombatLevelData manster *cfg.GameCombatMansterData pass bool - // group []*cfg.GameTeachingData - err error + ok bool + err error ) if code = this.ChallengeReceiveCheck(session, req); code != pb.ErrorCode_Success { return @@ -36,7 +37,12 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC code = pb.ErrorCode_DBError return } - if level, err = this.module.configure.getCombatLevel(info.Currlevel); err != nil { + if lv, ok = info.Level[req.Level]; !ok { + code = pb.ErrorCode_ReqParameterError + this.module.Errorf("no in Level:%s", req.Level) + return + } + if level, err = this.module.configure.getCombatLevel(req.Level); err != nil { code = pb.ErrorCode_ConfigNoFound return } @@ -44,14 +50,14 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC code = pb.ErrorCode_ConfigNoFound return } - for _, v := range info.Passmanster { + for _, v := range lv.Passmanster { if v == req.Manster { code = pb.ErrorCode_ReqParameterError return } } - info.Passmanster = append(info.Passmanster, req.Manster) + lv.Passmanster = append(lv.Passmanster, req.Manster) if err = this.module.modelCombat.updateInfo(info); err != nil { code = pb.ErrorCode_DBError return @@ -61,7 +67,7 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC pass = true for _, v := range level.Passdroplist { ispass := false - for _, v1 := range info.Passdrop { + for _, v1 := range lv.Passdrop { if v == v1 { ispass = true } @@ -73,7 +79,7 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC } for _, v := range level.PassformatList { ispass := false - for _, v1 := range info.Passmanster { + for _, v1 := range lv.Passmanster { if v == v1 { ispass = true } @@ -84,13 +90,15 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC } } if pass { - if err = this.module.modelCombat.delInfo(session.GetUserId()); err != nil { - code = pb.ErrorCode_DBError - return - } + lv.Pass = true this.module.DispenseRes(session, level.Award, true) this.module.ModuleRtask.SendToRtask(session, comm.Rtype140, 1, level.Id) } + lv.Progress = int32((float64(len(lv.Passmanster)+len(lv.Passdrop)) / float64(len(level.Passdroplist)+len(level.PassformatList))) * float64(100)) + if err = this.module.modelCombat.updateInfo(info); err != nil { + code = pb.ErrorCode_DBError + return + } } session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Issucc: true, Pass: pass}) diff --git a/modules/combat/api_drop.go b/modules/combat/api_drop.go index ed9ec4f3e..cdde94f0f 100644 --- a/modules/combat/api_drop.go +++ b/modules/combat/api_drop.go @@ -18,9 +18,11 @@ func (this *apiComp) DropCheck(session comm.IUserSession, req *pb.CombatDropReq) func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (code pb.ErrorCode, data proto.Message) { var ( info *pb.DBCombatUser + lv *pb.DBCombatLevel level *cfg.GameCombatLevelData box *cfg.GameCombatBoxData atns []*pb.UserAssets + ok bool err error ) if code = this.DropCheck(session, req); code != pb.ErrorCode_Success { @@ -31,7 +33,13 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod code = pb.ErrorCode_DBError return } - if level, err = this.module.configure.getCombatLevel(info.Currlevel); err != nil { + if lv, ok = info.Level[req.Level]; !ok { + code = pb.ErrorCode_ReqParameterError + this.module.Errorf("no in Level:%s", req.Level) + return + } + + if level, err = this.module.configure.getCombatLevel(req.Level); err != nil { code = pb.ErrorCode_DBError return } @@ -39,14 +47,14 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod code = pb.ErrorCode_DBError return } - for _, v := range info.Passdrop { + for _, v := range lv.Passdrop { if v == req.Drop { code = pb.ErrorCode_ReqParameterError return } } - info.Passdrop = append(info.Passdrop, req.Drop) + lv.Passdrop = append(lv.Passdrop, req.Drop) if err = this.module.modelCombat.updateInfo(info); err != nil { code = pb.ErrorCode_DBError return @@ -66,7 +74,7 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod pass := true for _, v := range level.Passdroplist { ispass := false - for _, v1 := range info.Passdrop { + for _, v1 := range lv.Passdrop { if v == v1 { ispass = true } @@ -78,7 +86,7 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod } for _, v := range level.PassformatList { ispass := false - for _, v1 := range info.Passmanster { + for _, v1 := range lv.Passmanster { if v == v1 { ispass = true } @@ -88,15 +96,17 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (cod break } } + if pass { - if err = this.module.modelCombat.delInfo(session.GetUserId()); err != nil { - code = pb.ErrorCode_DBError - return - } + lv.Pass = true this.module.DispenseRes(session, level.Award, true) this.module.ModuleRtask.SendToRtask(session, comm.Rtype140, 1, level.Id) } - + lv.Progress = int32((float64(len(lv.Passmanster)+len(lv.Passdrop)) / float64(len(level.Passdroplist)+len(level.PassformatList))) * float64(100)) + if err = this.module.modelCombat.updateInfo(info); err != nil { + code = pb.ErrorCode_DBError + return + } session.SendMsg(string(this.module.GetType()), "drop", &pb.CombatDropResp{Code: code, Atns: atns, Pass: pass}) return } diff --git a/modules/combat/api_in.go b/modules/combat/api_in.go index 410428fe0..1e48a606c 100644 --- a/modules/combat/api_in.go +++ b/modules/combat/api_in.go @@ -16,8 +16,10 @@ func (this *apiComp) InCheck(session comm.IUserSession, req *pb.CombatInReq) (co ///获取自己的排行榜信息 func (this *apiComp) In(session comm.IUserSession, req *pb.CombatInReq) (code pb.ErrorCode, data proto.Message) { var ( - info *pb.DBCombatUser - err error + info *pb.DBCombatUser + level *pb.DBCombatLevel + ok bool + err error ) if code = this.InCheck(session, req); code != pb.ErrorCode_Success { return @@ -26,16 +28,19 @@ func (this *apiComp) In(session comm.IUserSession, req *pb.CombatInReq) (code pb code = pb.ErrorCode_DBError return } - // if info.Currlevel != 0 { - // code = pb.ErrorCode_ReqParameterError - // return - // } - info.Currlevel = req.Id - if err = this.module.modelCombat.updateInfo(info); err != nil { - code = pb.ErrorCode_DBError - return + if level, ok = info.Level[req.Id]; !ok { + level = &pb.DBCombatLevel{ + Id: req.Id, + Passmanster: make([]int32, 0), + Passdrop: make([]int32, 0), + Progress: 0, + } + info.Level[req.Id] = level + if err = this.module.modelCombat.updateInfo(info); err != nil { + code = pb.ErrorCode_DBError + return + } } - - session.SendMsg(string(this.module.GetType()), "in", &pb.CombatInReq{Id: req.Id}) + session.SendMsg(string(this.module.GetType()), "in", &pb.CombatInResp{Level: level}) return } diff --git a/modules/combat/api_out.go b/modules/combat/api_out.go deleted file mode 100644 index 3a66e1516..000000000 --- a/modules/combat/api_out.go +++ /dev/null @@ -1,30 +0,0 @@ -package combat - -import ( - "go_dreamfactory/comm" - "go_dreamfactory/pb" - - "google.golang.org/protobuf/proto" -) - -//参数校验 -func (this *apiComp) OutCheck(session comm.IUserSession, req *pb.CombatOutReq) (code pb.ErrorCode) { - - return -} - -///获取自己的排行榜信息 -func (this *apiComp) Out(session comm.IUserSession, req *pb.CombatOutReq) (code pb.ErrorCode, data proto.Message) { - var ( - err error - ) - if code = this.OutCheck(session, req); code != pb.ErrorCode_Success { - return - } - if err = this.module.modelCombat.delInfo(session.GetUserId()); err != nil { - code = pb.ErrorCode_DBError - return - } - session.SendMsg(string(this.module.GetType()), "out", &pb.CombatOutResp{Id: req.Id}) - return -} diff --git a/modules/combat/api_updatepos.go b/modules/combat/api_updatepos.go new file mode 100644 index 000000000..0fba0f646 --- /dev/null +++ b/modules/combat/api_updatepos.go @@ -0,0 +1,43 @@ +package combat + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) UpdatePosCheck(session comm.IUserSession, req *pb.CombatUpdatePosReq) (code pb.ErrorCode) { + + return +} + +///获取自己的排行榜信息 +func (this *apiComp) UpdatePos(session comm.IUserSession, req *pb.CombatUpdatePosReq) (code pb.ErrorCode, data proto.Message) { + var ( + info *pb.DBCombatUser + level *pb.DBCombatLevel + ok bool + err error + ) + if code = this.UpdatePosCheck(session, req); code != pb.ErrorCode_Success { + return + } + if info, err = this.module.modelCombat.queryInfo(session.GetUserId()); err != nil { + code = pb.ErrorCode_DBError + return + } + if level, ok = info.Level[req.Level]; !ok { + code = pb.ErrorCode_ReqParameterError + this.module.Errorf("no in Level:%s", req.Level) + return + } + level.Pos = req.Pos + if err = this.module.modelCombat.updateInfo(info); err != nil { + code = pb.ErrorCode_DBError + return + } + session.SendMsg(string(this.module.GetType()), "updatepos", &pb.CombatInResp{Level: level}) + return +} diff --git a/modules/combat/modelCombat.go b/modules/combat/modelCombat.go index c579bedfb..4f5388a21 100644 --- a/modules/combat/modelCombat.go +++ b/modules/combat/modelCombat.go @@ -31,10 +31,8 @@ func (this *modelCombatComp) Init(service core.IService, module core.IModule, co //查询用户装备数据 func (this *modelCombatComp) queryInfo(uId string) (result *pb.DBCombatUser, err error) { result = &pb.DBCombatUser{ - Uid: uId, - Currlevel: 0, - Passmanster: make([]int32, 0), - Passdrop: make([]int32, 0), + Uid: uId, + Level: make(map[int32]*pb.DBCombatLevel), } if err = this.Get(uId, result, db.SetDBMgoLog(false)); err != nil && err != mgo.MongodbNil { this.module.Errorln(err) @@ -49,9 +47,7 @@ func (this *modelCombatComp) queryInfo(uId string) (result *pb.DBCombatUser, err ///保存用户竞技场信息 func (this *modelCombatComp) updateInfo(info *pb.DBCombatUser) (err error) { if err = this.Change(info.Uid, map[string]interface{}{ - "currlevel": info.Currlevel, - "passmanster": info.Passmanster, - "passdrop": info.Passdrop, + "level": info.Level, }, db.SetDBMgoLog(false)); err != nil { this.module.Errorln(err) return diff --git a/pb/combat_db.pb.go b/pb/combat_db.pb.go index 490b48cea..f32125d63 100644 --- a/pb/combat_db.pb.go +++ b/pb/combat_db.pb.go @@ -25,10 +25,8 @@ type DBCombatUser struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //uid - Currlevel int32 `protobuf:"varint,2,opt,name=currlevel,proto3" json:"currlevel"` //当前所在关卡 - Passmanster []int32 `protobuf:"varint,3,rep,packed,name=passmanster,proto3" json:"passmanster"` //通关怪物列表 - Passdrop []int32 `protobuf:"varint,4,rep,packed,name=passdrop,proto3" json:"passdrop"` //通关宝箱列表 + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //uid + Level map[int32]*DBCombatLevel `protobuf:"bytes,2,rep,name=level,proto3" json:"level" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //关卡信息 } func (x *DBCombatUser) Reset() { @@ -70,41 +68,192 @@ func (x *DBCombatUser) GetUid() string { return "" } -func (x *DBCombatUser) GetCurrlevel() int32 { +func (x *DBCombatUser) GetLevel() map[int32]*DBCombatLevel { if x != nil { - return x.Currlevel + return x.Level + } + return nil +} + +type Pos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X float32 `protobuf:"fixed32,1,opt,name=x,proto3" json:"x"` + Y float32 `protobuf:"fixed32,2,opt,name=y,proto3" json:"y"` + Z float32 `protobuf:"fixed32,3,opt,name=z,proto3" json:"z"` +} + +func (x *Pos) Reset() { + *x = Pos{} + if protoimpl.UnsafeEnabled { + mi := &file_combat_combat_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pos) ProtoMessage() {} + +func (x *Pos) ProtoReflect() protoreflect.Message { + mi := &file_combat_combat_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 Pos.ProtoReflect.Descriptor instead. +func (*Pos) Descriptor() ([]byte, []int) { + return file_combat_combat_db_proto_rawDescGZIP(), []int{1} +} + +func (x *Pos) GetX() float32 { + if x != nil { + return x.X } return 0 } -func (x *DBCombatUser) GetPassmanster() []int32 { +func (x *Pos) GetY() float32 { + if x != nil { + return x.Y + } + return 0 +} + +func (x *Pos) GetZ() float32 { + if x != nil { + return x.Z + } + return 0 +} + +type DBCombatLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + Pos *Pos `protobuf:"bytes,2,opt,name=pos,proto3" json:"pos"` //坐标 + Passmanster []int32 `protobuf:"varint,3,rep,packed,name=passmanster,proto3" json:"passmanster"` //通关怪物列表 + Passdrop []int32 `protobuf:"varint,4,rep,packed,name=passdrop,proto3" json:"passdrop"` //通关宝箱列表 + Pass bool `protobuf:"varint,5,opt,name=pass,proto3" json:"pass"` //是否通关 + Progress int32 `protobuf:"varint,6,opt,name=progress,proto3" json:"progress"` //进度 +} + +func (x *DBCombatLevel) Reset() { + *x = DBCombatLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_combat_combat_db_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBCombatLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBCombatLevel) ProtoMessage() {} + +func (x *DBCombatLevel) ProtoReflect() protoreflect.Message { + mi := &file_combat_combat_db_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DBCombatLevel.ProtoReflect.Descriptor instead. +func (*DBCombatLevel) Descriptor() ([]byte, []int) { + return file_combat_combat_db_proto_rawDescGZIP(), []int{2} +} + +func (x *DBCombatLevel) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DBCombatLevel) GetPos() *Pos { + if x != nil { + return x.Pos + } + return nil +} + +func (x *DBCombatLevel) GetPassmanster() []int32 { if x != nil { return x.Passmanster } return nil } -func (x *DBCombatUser) GetPassdrop() []int32 { +func (x *DBCombatLevel) GetPassdrop() []int32 { if x != nil { return x.Passdrop } return nil } +func (x *DBCombatLevel) GetPass() bool { + if x != nil { + return x.Pass + } + return false +} + +func (x *DBCombatLevel) GetProgress() int32 { + if x != nil { + return x.Progress + } + return 0 +} + var File_combat_combat_db_proto protoreflect.FileDescriptor var file_combat_combat_db_proto_rawDesc = []byte{ 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x5f, - 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x0c, 0x44, 0x42, 0x43, 0x6f, - 0x6d, 0x62, 0x61, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, - 0x72, 0x72, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, - 0x75, 0x72, 0x72, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, - 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, - 0x61, 0x73, 0x73, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x64, 0x72, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x64, 0x72, 0x6f, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x43, + 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x43, + 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x48, 0x0a, 0x0a, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x43, + 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2f, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x0c, 0x0a, 0x01, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x7a, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x01, 0x7a, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x43, 0x6f, 0x6d, + 0x62, 0x61, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x50, 0x6f, 0x73, 0x52, 0x03, 0x70, 0x6f, 0x73, + 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x6d, 0x61, 0x6e, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x64, 0x72, 0x6f, 0x70, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x64, 0x72, 0x6f, 0x70, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, + 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x06, + 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 ( @@ -119,16 +268,22 @@ func file_combat_combat_db_proto_rawDescGZIP() []byte { return file_combat_combat_db_proto_rawDescData } -var file_combat_combat_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_combat_combat_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_combat_combat_db_proto_goTypes = []interface{}{ - (*DBCombatUser)(nil), // 0: DBCombatUser + (*DBCombatUser)(nil), // 0: DBCombatUser + (*Pos)(nil), // 1: Pos + (*DBCombatLevel)(nil), // 2: DBCombatLevel + nil, // 3: DBCombatUser.LevelEntry } var file_combat_combat_db_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 3, // 0: DBCombatUser.level:type_name -> DBCombatUser.LevelEntry + 1, // 1: DBCombatLevel.pos:type_name -> Pos + 2, // 2: DBCombatUser.LevelEntry.value:type_name -> DBCombatLevel + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_combat_combat_db_proto_init() } @@ -149,6 +304,30 @@ func file_combat_combat_db_proto_init() { return nil } } + file_combat_combat_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_combat_combat_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBCombatLevel); 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{ @@ -156,7 +335,7 @@ func file_combat_combat_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_combat_combat_db_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/combat_msg.pb.go b/pb/combat_msg.pb.go index 6d7c662d6..50d693637 100644 --- a/pb/combat_msg.pb.go +++ b/pb/combat_msg.pb.go @@ -74,7 +74,7 @@ type CombatInResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //关卡id + Level *DBCombatLevel `protobuf:"bytes,2,opt,name=level,proto3" json:"level"` //管卡信息 } func (x *CombatInResp) Reset() { @@ -109,24 +109,24 @@ func (*CombatInResp) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{1} } -func (x *CombatInResp) GetId() int32 { +func (x *CombatInResp) GetLevel() *DBCombatLevel { if x != nil { - return x.Id + return x.Level } - return 0 + return nil } -//关卡离开请求 -type CombatOutReq struct { +type CombatUpdatePosReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //关卡id + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` //管卡id + Pos *Pos `protobuf:"bytes,2,opt,name=pos,proto3" json:"pos"` //坐标 } -func (x *CombatOutReq) Reset() { - *x = CombatOutReq{} +func (x *CombatUpdatePosReq) Reset() { + *x = CombatUpdatePosReq{} if protoimpl.UnsafeEnabled { mi := &file_combat_combat_msg_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -134,13 +134,13 @@ func (x *CombatOutReq) Reset() { } } -func (x *CombatOutReq) String() string { +func (x *CombatUpdatePosReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CombatOutReq) ProtoMessage() {} +func (*CombatUpdatePosReq) ProtoMessage() {} -func (x *CombatOutReq) ProtoReflect() protoreflect.Message { +func (x *CombatUpdatePosReq) ProtoReflect() protoreflect.Message { mi := &file_combat_combat_msg_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -152,29 +152,36 @@ func (x *CombatOutReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CombatOutReq.ProtoReflect.Descriptor instead. -func (*CombatOutReq) Descriptor() ([]byte, []int) { +// Deprecated: Use CombatUpdatePosReq.ProtoReflect.Descriptor instead. +func (*CombatUpdatePosReq) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{2} } -func (x *CombatOutReq) GetId() int32 { +func (x *CombatUpdatePosReq) GetLevel() int32 { if x != nil { - return x.Id + return x.Level } return 0 } -//关卡离开请求 回应 -type CombatOutResp struct { +func (x *CombatUpdatePosReq) GetPos() *Pos { + if x != nil { + return x.Pos + } + return nil +} + +type CombatUpdatePosResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //关卡id + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` //管卡id + Pos *Pos `protobuf:"bytes,2,opt,name=pos,proto3" json:"pos"` //坐标 } -func (x *CombatOutResp) Reset() { - *x = CombatOutResp{} +func (x *CombatUpdatePosResp) Reset() { + *x = CombatUpdatePosResp{} if protoimpl.UnsafeEnabled { mi := &file_combat_combat_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -182,13 +189,13 @@ func (x *CombatOutResp) Reset() { } } -func (x *CombatOutResp) String() string { +func (x *CombatUpdatePosResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CombatOutResp) ProtoMessage() {} +func (*CombatUpdatePosResp) ProtoMessage() {} -func (x *CombatOutResp) ProtoReflect() protoreflect.Message { +func (x *CombatUpdatePosResp) ProtoReflect() protoreflect.Message { mi := &file_combat_combat_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -200,26 +207,34 @@ func (x *CombatOutResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CombatOutResp.ProtoReflect.Descriptor instead. -func (*CombatOutResp) Descriptor() ([]byte, []int) { +// Deprecated: Use CombatUpdatePosResp.ProtoReflect.Descriptor instead. +func (*CombatUpdatePosResp) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{3} } -func (x *CombatOutResp) GetId() int32 { +func (x *CombatUpdatePosResp) GetLevel() int32 { if x != nil { - return x.Id + return x.Level } return 0 } +func (x *CombatUpdatePosResp) GetPos() *Pos { + if x != nil { + return x.Pos + } + return nil +} + //战斗请求 type CombatChallengeReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Manster int32 `protobuf:"varint,1,opt,name=manster,proto3" json:"manster"` //怪物id - Battle *BattleFormation `protobuf:"bytes,2,opt,name=battle,proto3" json:"battle"` //布阵信息 + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` //管卡id + Manster int32 `protobuf:"varint,2,opt,name=manster,proto3" json:"manster"` //怪物id + Battle *BattleFormation `protobuf:"bytes,3,opt,name=battle,proto3" json:"battle"` //布阵信息 } func (x *CombatChallengeReq) Reset() { @@ -254,6 +269,13 @@ func (*CombatChallengeReq) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{4} } +func (x *CombatChallengeReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *CombatChallengeReq) GetManster() int32 { if x != nil { return x.Manster @@ -275,8 +297,9 @@ type CombatChallengeResp struct { unknownFields protoimpl.UnknownFields Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 - Manster int32 `protobuf:"varint,2,opt,name=manster,proto3" json:"manster"` - Info *BattleInfo `protobuf:"bytes,3,opt,name=info,proto3" json:"info"` + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level"` //管卡id + Manster int32 `protobuf:"varint,3,opt,name=manster,proto3" json:"manster"` + Info *BattleInfo `protobuf:"bytes,4,opt,name=info,proto3" json:"info"` } func (x *CombatChallengeResp) Reset() { @@ -318,6 +341,13 @@ func (x *CombatChallengeResp) GetCode() ErrorCode { return ErrorCode_Success } +func (x *CombatChallengeResp) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *CombatChallengeResp) GetManster() int32 { if x != nil { return x.Manster @@ -338,8 +368,9 @@ type CombatChallengeReceiveReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Manster int32 `protobuf:"varint,1,opt,name=manster,proto3" json:"manster"` - Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报 + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` //管卡id + Manster int32 `protobuf:"varint,2,opt,name=manster,proto3" json:"manster"` + Report *BattleReport `protobuf:"bytes,3,opt,name=report,proto3" json:"report"` //战报 } func (x *CombatChallengeReceiveReq) Reset() { @@ -374,6 +405,13 @@ func (*CombatChallengeReceiveReq) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{6} } +func (x *CombatChallengeReceiveReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *CombatChallengeReceiveReq) GetManster() int32 { if x != nil { return x.Manster @@ -394,8 +432,9 @@ type CombatChallengeReceiveResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` - Pass bool `protobuf:"varint,2,opt,name=pass,proto3" json:"pass"` //是否通关 + Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level"` //管卡id + Pass bool `protobuf:"varint,3,opt,name=pass,proto3" json:"pass"` //是否通关 } func (x *CombatChallengeReceiveResp) Reset() { @@ -437,6 +476,13 @@ func (x *CombatChallengeReceiveResp) GetIssucc() bool { return false } +func (x *CombatChallengeReceiveResp) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *CombatChallengeReceiveResp) GetPass() bool { if x != nil { return x.Pass @@ -450,7 +496,8 @@ type CombatDropReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Drop int32 `protobuf:"varint,1,opt,name=drop,proto3" json:"drop"` //宝箱id + Level int32 `protobuf:"varint,1,opt,name=level,proto3" json:"level"` //管卡id + Drop int32 `protobuf:"varint,2,opt,name=drop,proto3" json:"drop"` //宝箱id } func (x *CombatDropReq) Reset() { @@ -485,6 +532,13 @@ func (*CombatDropReq) Descriptor() ([]byte, []int) { return file_combat_combat_msg_proto_rawDescGZIP(), []int{8} } +func (x *CombatDropReq) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *CombatDropReq) GetDrop() int32 { if x != nil { return x.Drop @@ -498,9 +552,10 @@ type CombatDropResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 - Atns []*UserAssets `protobuf:"bytes,2,rep,name=atns,proto3" json:"atns"` //获取物品 - Pass bool `protobuf:"varint,3,opt,name=pass,proto3" json:"pass"` //是否通关 + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 + Atns []*UserAssets `protobuf:"bytes,2,rep,name=atns,proto3" json:"atns"` //获取物品 + Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level"` //管卡id + Pass bool `protobuf:"varint,4,opt,name=pass,proto3" json:"pass"` //是否通关 } func (x *CombatDropResp) Reset() { @@ -549,6 +604,13 @@ func (x *CombatDropResp) GetAtns() []*UserAssets { return nil } +func (x *CombatDropResp) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *CombatDropResp) GetPass() bool { if x != nil { return x.Pass @@ -562,49 +624,65 @@ var file_combat_combat_msg_proto_rawDesc = []byte{ 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x1d, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1e, - 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1e, - 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1f, - 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x58, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 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, 0x70, 0x0a, 0x13, 0x43, 0x6f, 0x6d, - 0x62, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 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, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x5c, 0x0a, 0x19, 0x43, - 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, - 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, - 0x65, 0x72, 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, 0x22, 0x48, 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, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, - 0x61, 0x73, 0x73, 0x22, 0x23, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x44, 0x72, 0x6f, - 0x70, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x22, 0x65, 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, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x2f, 0x63, + 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1d, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x62, 0x61, + 0x74, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, + 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x42, 0x0a, 0x12, + 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 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, 0x12, 0x16, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x50, 0x6f, 0x73, 0x52, 0x03, 0x70, 0x6f, 0x73, + 0x22, 0x43, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x6f, 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, 0x16, 0x0a, + 0x03, 0x70, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x50, 0x6f, 0x73, + 0x52, 0x03, 0x70, 0x6f, 0x73, 0x22, 0x6e, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x06, 0x62, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 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, 0x86, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, + 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 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, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x72, + 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 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, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x73, 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, 0x5e, 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, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, + 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, 0x7b, 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, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x61, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -623,32 +701,37 @@ var file_combat_combat_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_combat_combat_msg_proto_goTypes = []interface{}{ (*CombatInReq)(nil), // 0: CombatInReq (*CombatInResp)(nil), // 1: CombatInResp - (*CombatOutReq)(nil), // 2: CombatOutReq - (*CombatOutResp)(nil), // 3: CombatOutResp + (*CombatUpdatePosReq)(nil), // 2: CombatUpdatePosReq + (*CombatUpdatePosResp)(nil), // 3: CombatUpdatePosResp (*CombatChallengeReq)(nil), // 4: CombatChallengeReq (*CombatChallengeResp)(nil), // 5: CombatChallengeResp (*CombatChallengeReceiveReq)(nil), // 6: CombatChallengeReceiveReq (*CombatChallengeReceiveResp)(nil), // 7: CombatChallengeReceiveResp (*CombatDropReq)(nil), // 8: CombatDropReq (*CombatDropResp)(nil), // 9: CombatDropResp - (*BattleFormation)(nil), // 10: BattleFormation - (ErrorCode)(0), // 11: ErrorCode - (*BattleInfo)(nil), // 12: BattleInfo - (*BattleReport)(nil), // 13: BattleReport - (*UserAssets)(nil), // 14: UserAssets + (*DBCombatLevel)(nil), // 10: DBCombatLevel + (*Pos)(nil), // 11: Pos + (*BattleFormation)(nil), // 12: BattleFormation + (ErrorCode)(0), // 13: ErrorCode + (*BattleInfo)(nil), // 14: BattleInfo + (*BattleReport)(nil), // 15: BattleReport + (*UserAssets)(nil), // 16: UserAssets } var file_combat_combat_msg_proto_depIdxs = []int32{ - 10, // 0: CombatChallengeReq.battle:type_name -> BattleFormation - 11, // 1: CombatChallengeResp.code:type_name -> ErrorCode - 12, // 2: CombatChallengeResp.info:type_name -> BattleInfo - 13, // 3: CombatChallengeReceiveReq.report:type_name -> BattleReport - 11, // 4: CombatDropResp.code:type_name -> ErrorCode - 14, // 5: CombatDropResp.atns:type_name -> UserAssets - 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 + 10, // 0: CombatInResp.level:type_name -> DBCombatLevel + 11, // 1: CombatUpdatePosReq.pos:type_name -> Pos + 11, // 2: CombatUpdatePosResp.pos:type_name -> Pos + 12, // 3: CombatChallengeReq.battle:type_name -> BattleFormation + 13, // 4: CombatChallengeResp.code:type_name -> ErrorCode + 14, // 5: CombatChallengeResp.info:type_name -> BattleInfo + 15, // 6: CombatChallengeReceiveReq.report:type_name -> BattleReport + 13, // 7: CombatDropResp.code:type_name -> ErrorCode + 16, // 8: CombatDropResp.atns:type_name -> UserAssets + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_combat_combat_msg_proto_init() } @@ -658,6 +741,7 @@ func file_combat_combat_msg_proto_init() { } file_errorcode_proto_init() file_comm_proto_init() + file_combat_combat_db_proto_init() file_battle_battle_msg_proto_init() if !protoimpl.UnsafeEnabled { file_combat_combat_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -685,7 +769,7 @@ func file_combat_combat_msg_proto_init() { } } file_combat_combat_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CombatOutReq); i { + switch v := v.(*CombatUpdatePosReq); i { case 0: return &v.state case 1: @@ -697,7 +781,7 @@ func file_combat_combat_msg_proto_init() { } } file_combat_combat_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CombatOutResp); i { + switch v := v.(*CombatUpdatePosResp); i { case 0: return &v.state case 1: