From 7505c586fbf07dacb64eb46770fd82fd5f7fbcf0 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 27 Oct 2022 14:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=98=B5=E8=90=A5=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/arena/api_challengereward.go | 70 +++++- modules/arena/api_delreward.go | 4 + modules/arena/modelarena.go | 1 + pb/arena_db.pb.go | 319 ++++++++++++++++++--------- 4 files changed, 282 insertions(+), 112 deletions(-) diff --git a/modules/arena/api_challengereward.go b/modules/arena/api_challengereward.go index b21230b98..27b9dcccb 100644 --- a/modules/arena/api_challengereward.go +++ b/modules/arena/api_challengereward.go @@ -52,28 +52,28 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha } if req.Revengeid != "" { redstate = pb.BattleRecordState_RevengeSucceeded - bulestate = pb.BattleRecordState_RevengeEnd + bulestate = pb.BattleRecordState_DefendLost for _, v := range info.Record { if v.Bid == req.Revengeid { v.State = pb.BattleRecordState_RevengeEnd } } } else { - redstate = pb.BattleRecordState_RevengeSucceeded - bulestate = pb.BattleRecordState_WaitingRevenge + redstate = pb.BattleRecordState_AttackWin + bulestate = pb.BattleRecordState_DefendLost } } else { if req.Revengeid != "" { redstate = pb.BattleRecordState_RevengeFailed - bulestate = pb.BattleRecordState_RevengeEnd + bulestate = pb.BattleRecordState_DefendkWin for _, v := range info.Record { if v.Bid == req.Revengeid { v.State = pb.BattleRecordState_RevengeEnd } } } else { - redstate = pb.BattleRecordState_RevengeFailed - bulestate = pb.BattleRecordState_RevengeSucceeded + redstate = pb.BattleRecordState_AttackLost + bulestate = pb.BattleRecordState_DefendkWin } } session.SendMsg(string(this.module.GetType()), "challengereward", &pb.ArenaChallengeRewardResp{Issucc: true}) @@ -126,30 +126,60 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha if err = this.module.modelArena.updateArenaUserInfo(rival); err != nil { code = pb.ErrorCode_DBError } - info.Record = append(info.Record, &pb.DBArenaBattleRecord{ + redrecord := &pb.DBArenaBattleRecord{ Bid: req.Report.Info.Id, Time: time.Now().Unix(), Iswin: req.Iswin, Isdefend: false, Rivalid: bule.Uid, Rivalname: bule.Name, + Leadpos: rival.Attack.Leadpos, + Formt: make([]*pb.DBHeroBase, len(rival.Attack.Formt)), Addintegral: red.Changeintegral, State: redstate, - }) + } + for i, v := range rival.Attack.Formt { + if v != nil { + redrecord.Formt[i] = &pb.DBHeroBase{ + Oid: v.Id, + Cid: v.HeroID, + Star: v.Star, + Lv: v.Lv, + } + } else { + redrecord.Formt[i] = nil + } + } + info.Record = append(info.Record, redrecord) if err = this.module.modelArena.Change(red.Uid, map[string]interface{}{"record": info.Record}); err != nil { code = pb.ErrorCode_DBError return } - rival.Record = append(rival.Record, &pb.DBArenaBattleRecord{ + buleRecord := &pb.DBArenaBattleRecord{ Bid: req.Report.Info.Id, Time: time.Now().Unix(), Iswin: !req.Iswin, Isdefend: true, Rivalid: red.Uid, Rivalname: red.Name, + Leadpos: info.Attack.Leadpos, Addintegral: bule.Changeintegral, + Formt: make([]*pb.DBHeroBase, len(info.Attack.Formt)), State: bulestate, - }) + } + for i, v := range info.Attack.Formt { + if v != nil { + redrecord.Formt[i] = &pb.DBHeroBase{ + Oid: v.Id, + Cid: v.HeroID, + Star: v.Star, + Lv: v.Lv, + } + } else { + redrecord.Formt[i] = nil + } + } + rival.Record = append(rival.Record, buleRecord) if err = this.module.modelArena.Change(rival.Uid, map[string]interface{}{"record": rival.Record}); err != nil { code = pb.ErrorCode_DBError return @@ -161,15 +191,31 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha if err = this.module.modelArena.updateArenaUserInfo(info); err != nil { code = pb.ErrorCode_DBError } - info.Record = append(info.Record, &pb.DBArenaBattleRecord{ + redrecord := &pb.DBArenaBattleRecord{ Bid: req.Report.Info.Id, Time: time.Now().Unix(), Iswin: req.Iswin, Isdefend: false, Rivalid: bule.Uid, Rivalname: bule.Name, + Leadpos: req.Report.Info.Buleflist[0].Leadpos, + Formt: make([]*pb.DBHeroBase, len(req.Report.Info.Buleflist[0].Team)), Addintegral: red.Changeintegral, - }) + State: redstate, + } + for i, v := range req.Report.Info.Buleflist[0].Team { + if v != nil { + redrecord.Formt[i] = &pb.DBHeroBase{ + Oid: v.Oid, + Cid: v.HeroID, + Star: v.Star, + Lv: v.Lv, + } + } else { + redrecord.Formt[i] = nil + } + } + info.Record = append(info.Record, redrecord) if err = this.module.modelArena.Change(red.Uid, map[string]interface{}{"record": info.Record}); err != nil { code = pb.ErrorCode_DBError return diff --git a/modules/arena/api_delreward.go b/modules/arena/api_delreward.go index f8e345933..15111fad4 100644 --- a/modules/arena/api_delreward.go +++ b/modules/arena/api_delreward.go @@ -37,6 +37,10 @@ func (this *apiComp) DelReward(session comm.IUserSession, req *pb.ArenaDelReward } } } + if err = this.module.modelArena.updateArenaUserInfo(info); err != nil { + code = pb.ErrorCode_DBError + return + } session.SendMsg(string(this.module.GetType()), "delreward", &pb.ArenaDelRewardResp{Issucc: true, Bid: req.Bid}) return } diff --git a/modules/arena/modelarena.go b/modules/arena/modelarena.go index 870b996fc..e0f828312 100644 --- a/modules/arena/modelarena.go +++ b/modules/arena/modelarena.go @@ -114,6 +114,7 @@ func (this *modelArena) updateArenaUserInfo(info *pb.DBArenaUser) (err error) { "attack": info.Attack, "defend": info.Defend, "streak": info.Streak, + "record": info.Record, }) return } diff --git a/pb/arena_db.pb.go b/pb/arena_db.pb.go index 7142cecb8..631452865 100644 --- a/pb/arena_db.pb.go +++ b/pb/arena_db.pb.go @@ -23,31 +23,37 @@ const ( type BattleRecordState int32 const ( - BattleRecordState_Win BattleRecordState = 0 - BattleRecordState_Lost BattleRecordState = 1 - BattleRecordState_WaitingRevenge BattleRecordState = 2 - BattleRecordState_RevengeFailed BattleRecordState = 3 - BattleRecordState_RevengeSucceeded BattleRecordState = 4 - BattleRecordState_RevengeEnd BattleRecordState = 5 + BattleRecordState_AttackWin BattleRecordState = 0 + BattleRecordState_AttackLost BattleRecordState = 1 + BattleRecordState_DefendkWin BattleRecordState = 2 + BattleRecordState_DefendLost BattleRecordState = 3 + BattleRecordState_WaitingRevenge BattleRecordState = 4 + BattleRecordState_RevengeFailed BattleRecordState = 5 + BattleRecordState_RevengeSucceeded BattleRecordState = 6 + BattleRecordState_RevengeEnd BattleRecordState = 7 ) // Enum value maps for BattleRecordState. var ( BattleRecordState_name = map[int32]string{ - 0: "Win", - 1: "Lost", - 2: "WaitingRevenge", - 3: "RevengeFailed", - 4: "RevengeSucceeded", - 5: "RevengeEnd", + 0: "AttackWin", + 1: "AttackLost", + 2: "DefendkWin", + 3: "DefendLost", + 4: "WaitingRevenge", + 5: "RevengeFailed", + 6: "RevengeSucceeded", + 7: "RevengeEnd", } BattleRecordState_value = map[string]int32{ - "Win": 0, - "Lost": 1, - "WaitingRevenge": 2, - "RevengeFailed": 3, - "RevengeSucceeded": 4, - "RevengeEnd": 5, + "AttackWin": 0, + "AttackLost": 1, + "DefendkWin": 2, + "DefendLost": 3, + "WaitingRevenge": 4, + "RevengeFailed": 5, + "RevengeSucceeded": 6, + "RevengeEnd": 7, } ) @@ -262,26 +268,99 @@ func (x *ArenaPlayer) GetChangeintegral() int32 { return 0 } +type DBHeroBase struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid"` //英雄的唯一id + Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid"` //英雄配置id + Star int32 `protobuf:"varint,3,opt,name=star,proto3" json:"star"` //英雄星级 + Lv int32 `protobuf:"varint,4,opt,name=lv,proto3" json:"lv"` //英雄等级 +} + +func (x *DBHeroBase) Reset() { + *x = DBHeroBase{} + if protoimpl.UnsafeEnabled { + mi := &file_arena_arena_db_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBHeroBase) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBHeroBase) ProtoMessage() {} + +func (x *DBHeroBase) ProtoReflect() protoreflect.Message { + mi := &file_arena_arena_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 DBHeroBase.ProtoReflect.Descriptor instead. +func (*DBHeroBase) Descriptor() ([]byte, []int) { + return file_arena_arena_db_proto_rawDescGZIP(), []int{2} +} + +func (x *DBHeroBase) GetOid() string { + if x != nil { + return x.Oid + } + return "" +} + +func (x *DBHeroBase) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *DBHeroBase) GetStar() int32 { + if x != nil { + return x.Star + } + return 0 +} + +func (x *DBHeroBase) GetLv() int32 { + if x != nil { + return x.Lv + } + return 0 +} + //战斗记录 type DBArenaBattleRecord struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Bid string `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid"` //战斗id - Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time"` //战斗时间 - Iswin bool `protobuf:"varint,3,opt,name=iswin,proto3" json:"iswin"` //是否胜利 - Isdefend bool `protobuf:"varint,4,opt,name=isdefend,proto3" json:"isdefend"` //是否防守 - Rivalid string `protobuf:"bytes,5,opt,name=rivalid,proto3" json:"rivalid"` //对手id - Rivalname string `protobuf:"bytes,6,opt,name=rivalname,proto3" json:"rivalname"` //对手名称 - Addintegral int32 `protobuf:"varint,7,opt,name=addintegral,proto3" json:"addintegral"` //积分变化 - State BattleRecordState `protobuf:"varint,8,opt,name=State,proto3,enum=BattleRecordState" json:"State"` //记录状态 + Bid string `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid"` //战斗id + Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time"` //战斗时间 + Iswin bool `protobuf:"varint,3,opt,name=iswin,proto3" json:"iswin"` //是否胜利 + Isdefend bool `protobuf:"varint,4,opt,name=isdefend,proto3" json:"isdefend"` //是否防守 + Rivalid string `protobuf:"bytes,5,opt,name=rivalid,proto3" json:"rivalid"` //对手id + Rivalname string `protobuf:"bytes,6,opt,name=rivalname,proto3" json:"rivalname"` //对手名称 + Leadpos int32 `protobuf:"varint,7,opt,name=leadpos,proto3" json:"leadpos"` //队长位置 + Formt []*DBHeroBase `protobuf:"bytes,8,rep,name=formt,proto3" json:"formt"` //阵营 + Addintegral int32 `protobuf:"varint,9,opt,name=addintegral,proto3" json:"addintegral"` //积分变化 + State BattleRecordState `protobuf:"varint,10,opt,name=State,proto3,enum=BattleRecordState" json:"State"` //记录状态 } func (x *DBArenaBattleRecord) Reset() { *x = DBArenaBattleRecord{} if protoimpl.UnsafeEnabled { - mi := &file_arena_arena_db_proto_msgTypes[2] + mi := &file_arena_arena_db_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -294,7 +373,7 @@ func (x *DBArenaBattleRecord) String() string { func (*DBArenaBattleRecord) ProtoMessage() {} func (x *DBArenaBattleRecord) ProtoReflect() protoreflect.Message { - mi := &file_arena_arena_db_proto_msgTypes[2] + mi := &file_arena_arena_db_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -307,7 +386,7 @@ func (x *DBArenaBattleRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use DBArenaBattleRecord.ProtoReflect.Descriptor instead. func (*DBArenaBattleRecord) Descriptor() ([]byte, []int) { - return file_arena_arena_db_proto_rawDescGZIP(), []int{2} + return file_arena_arena_db_proto_rawDescGZIP(), []int{3} } func (x *DBArenaBattleRecord) GetBid() string { @@ -352,6 +431,20 @@ func (x *DBArenaBattleRecord) GetRivalname() string { return "" } +func (x *DBArenaBattleRecord) GetLeadpos() int32 { + if x != nil { + return x.Leadpos + } + return 0 +} + +func (x *DBArenaBattleRecord) GetFormt() []*DBHeroBase { + if x != nil { + return x.Formt + } + return nil +} + func (x *DBArenaBattleRecord) GetAddintegral() int32 { if x != nil { return x.Addintegral @@ -363,7 +456,7 @@ func (x *DBArenaBattleRecord) GetState() BattleRecordState { if x != nil { return x.State } - return BattleRecordState_Win + return BattleRecordState_AttackWin } //竞技场用户数据 @@ -393,7 +486,7 @@ type DBArenaUser struct { func (x *DBArenaUser) Reset() { *x = DBArenaUser{} if protoimpl.UnsafeEnabled { - mi := &file_arena_arena_db_proto_msgTypes[3] + mi := &file_arena_arena_db_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -406,7 +499,7 @@ func (x *DBArenaUser) String() string { func (*DBArenaUser) ProtoMessage() {} func (x *DBArenaUser) ProtoReflect() protoreflect.Message { - mi := &file_arena_arena_db_proto_msgTypes[3] + mi := &file_arena_arena_db_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -419,7 +512,7 @@ func (x *DBArenaUser) ProtoReflect() protoreflect.Message { // Deprecated: Use DBArenaUser.ProtoReflect.Descriptor instead. func (*DBArenaUser) Descriptor() ([]byte, []int) { - return file_arena_arena_db_proto_rawDescGZIP(), []int{3} + return file_arena_arena_db_proto_rawDescGZIP(), []int{4} } func (x *DBArenaUser) GetUid() string { @@ -563,59 +656,71 @@ var file_arena_arena_db_proto_rawDesc = []byte{ 0x09, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, - 0x61, 0x6c, 0x22, 0xf1, 0x01, 0x0a, 0x13, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, - 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, - 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x72, 0x69, 0x76, 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x64, - 0x64, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0b, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x28, 0x0a, 0x05, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0xd9, 0x03, 0x0a, 0x0b, 0x44, 0x42, 0x41, 0x72, 0x65, - 0x6e, 0x61, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, - 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x6e, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x50, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, - 0x52, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, - 0x6e, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x52, 0x06, - 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6b, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6b, 0x12, 0x1e, - 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1e, - 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, - 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x41, + 0x61, 0x6c, 0x22, 0x54, 0x0a, 0x0a, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x42, 0x61, 0x73, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, + 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0xae, 0x02, 0x0a, 0x13, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, - 0x72, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x74, 0x69, - 0x6d, 0x65, 0x2a, 0x73, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x57, 0x69, 0x6e, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x6f, 0x73, 0x74, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x57, 0x61, - 0x69, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x76, 0x65, 0x6e, 0x67, 0x65, 0x10, 0x02, 0x12, 0x11, + 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x69, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x66, 0x6f, + 0x72, 0x6d, 0x74, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x48, 0x65, + 0x72, 0x6f, 0x42, 0x61, 0x73, 0x65, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x6d, 0x74, 0x12, 0x20, 0x0a, + 0x0b, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, + 0x28, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, + 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0xd9, 0x03, 0x0a, 0x0b, 0x44, 0x42, + 0x41, 0x72, 0x65, 0x6e, 0x61, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, + 0x61, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x6e, 0x12, 0x2c, 0x0a, + 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x44, 0x42, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, + 0x72, 0x6d, 0x74, 0x52, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x2c, 0x0a, 0x06, 0x64, + 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, + 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, + 0x74, 0x52, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6b, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x72, 0x61, 0x74, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x72, 0x61, 0x74, + 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x72, 0x61, 0x74, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x12, 0x2c, 0x0a, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, + 0x61, 0x73, 0x74, 0x72, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x74, 0x69, 0x63, 0x6b, 0x65, + 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x9f, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x6b, 0x57, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x6b, 0x4c, 0x6f, 0x73, 0x74, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x65, + 0x66, 0x65, 0x6e, 0x64, 0x6b, 0x57, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x65, + 0x66, 0x65, 0x6e, 0x64, 0x4c, 0x6f, 0x73, 0x74, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x57, 0x61, + 0x69, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x76, 0x65, 0x6e, 0x67, 0x65, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x65, 0x76, 0x65, 0x6e, 0x67, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, - 0x03, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x65, 0x76, 0x65, 0x6e, 0x67, 0x65, 0x53, 0x75, 0x63, 0x63, - 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x65, 0x76, 0x65, 0x6e, - 0x67, 0x65, 0x45, 0x6e, 0x64, 0x10, 0x05, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, + 0x05, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x65, 0x76, 0x65, 0x6e, 0x67, 0x65, 0x53, 0x75, 0x63, 0x63, + 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x65, 0x76, 0x65, 0x6e, + 0x67, 0x65, 0x45, 0x6e, 0x64, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -632,27 +737,29 @@ func file_arena_arena_db_proto_rawDescGZIP() []byte { } var file_arena_arena_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_arena_arena_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_arena_arena_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_arena_arena_db_proto_goTypes = []interface{}{ (BattleRecordState)(0), // 0: BattleRecordState (*DBPlayerBattleFormt)(nil), // 1: DBPlayerBattleFormt (*ArenaPlayer)(nil), // 2: ArenaPlayer - (*DBArenaBattleRecord)(nil), // 3: DBArenaBattleRecord - (*DBArenaUser)(nil), // 4: DBArenaUser - (*DBHero)(nil), // 5: DBHero + (*DBHeroBase)(nil), // 3: DBHeroBase + (*DBArenaBattleRecord)(nil), // 4: DBArenaBattleRecord + (*DBArenaUser)(nil), // 5: DBArenaUser + (*DBHero)(nil), // 6: DBHero } var file_arena_arena_db_proto_depIdxs = []int32{ - 5, // 0: DBPlayerBattleFormt.formt:type_name -> DBHero + 6, // 0: DBPlayerBattleFormt.formt:type_name -> DBHero 1, // 1: ArenaPlayer.defend:type_name -> DBPlayerBattleFormt - 0, // 2: DBArenaBattleRecord.State:type_name -> BattleRecordState - 1, // 3: DBArenaUser.attack:type_name -> DBPlayerBattleFormt - 1, // 4: DBArenaUser.defend:type_name -> DBPlayerBattleFormt - 3, // 5: DBArenaUser.record:type_name -> DBArenaBattleRecord - 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 + 3, // 2: DBArenaBattleRecord.formt:type_name -> DBHeroBase + 0, // 3: DBArenaBattleRecord.State:type_name -> BattleRecordState + 1, // 4: DBArenaUser.attack:type_name -> DBPlayerBattleFormt + 1, // 5: DBArenaUser.defend:type_name -> DBPlayerBattleFormt + 4, // 6: DBArenaUser.record:type_name -> DBArenaBattleRecord + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_arena_arena_db_proto_init() } @@ -687,7 +794,7 @@ func file_arena_arena_db_proto_init() { } } file_arena_arena_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DBArenaBattleRecord); i { + switch v := v.(*DBHeroBase); i { case 0: return &v.state case 1: @@ -699,6 +806,18 @@ func file_arena_arena_db_proto_init() { } } file_arena_arena_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBArenaBattleRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_arena_arena_db_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBArenaUser); i { case 0: return &v.state @@ -717,7 +836,7 @@ func file_arena_arena_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_arena_arena_db_proto_rawDesc, NumEnums: 1, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 0, },