From d66836edb76782133e8db9fd679708656b6261c4 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 9 Nov 2022 15:24:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=9C=8D=E5=8A=A1?= =?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/battle/modelBattle.go | 10 ++-- modules/battle/module.go | 4 -- pb/equipment_db.pb.go | 100 +++++++++++++++++++--------------- 4 files changed, 60 insertions(+), 56 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index fe62e6a9d..ad6aa9541 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -181,8 +181,6 @@ type ( //战斗系统 IBattle interface { - //创建怪物阵营 - CreateMasterRoles(wheel int, fid int32) (captain int32, roles []*pb.BattleRole, code pb.ErrorCode) //创建eve战斗 CreateEveBattle(session IUserSession, req *pb.BattleEVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///创建pve战斗 diff --git a/modules/battle/modelBattle.go b/modules/battle/modelBattle.go index ee8a61c7d..d8ad98115 100644 --- a/modules/battle/modelBattle.go +++ b/modules/battle/modelBattle.go @@ -61,7 +61,7 @@ func (this *modelBattleComp) createeve(session comm.IUserSession, conn *db.DBCon masters []*pb.BattleRole ) for i, v := range req.Redformat { - if captain, masters, code = this.createMasterRoles(i, v); code != pb.ErrorCode_Success { + if captain, masters, code = this.createMasterRoles(100, i, v); code != pb.ErrorCode_Success { return } record.Redflist[i] = &pb.DBBattleFormt{ @@ -70,7 +70,7 @@ func (this *modelBattleComp) createeve(session comm.IUserSession, conn *db.DBCon } } for i, v := range req.Buleformat { - if captain, masters, code = this.createMasterRoles(i, v); code != pb.ErrorCode_Success { + if captain, masters, code = this.createMasterRoles(200, i, v); code != pb.ErrorCode_Success { return } record.Buleflist[i] = &pb.DBBattleFormt{ @@ -153,7 +153,7 @@ func (this *modelBattleComp) createpve(session comm.IUserSession, conn *db.DBCon masters []*pb.BattleRole ) for i, v := range req.Mformat { - if captain, masters, code = this.createMasterRoles(i, v); code != pb.ErrorCode_Success { + if captain, masters, code = this.createMasterRoles(200, i, v); code != pb.ErrorCode_Success { return } record.Buleflist[i] = &pb.DBBattleFormt{ @@ -261,7 +261,7 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, tid, pos int) (ro } //创建怪物阵营 -func (this *modelBattleComp) createMasterRoles(wheel int, fid int32) (captain int32, roles []*pb.BattleRole, code pb.ErrorCode) { +func (this *modelBattleComp) createMasterRoles(comp, wheel int, fid int32) (captain int32, roles []*pb.BattleRole, code pb.ErrorCode) { var ( result []*cfg.GameMonsterFormatData err error @@ -286,7 +286,7 @@ func (this *modelBattleComp) createMasterRoles(wheel int, fid int32) (captain in return } else { roles[i] = &pb.BattleRole{ - Tid: int32(200 + wheel*10 + i), + Tid: int32(comp + wheel*10 + i), Oid: hero.Id, HeroID: hero.HeroID, Pos: int32(i), diff --git a/modules/battle/module.go b/modules/battle/module.go index ffa5e714f..0c377a019 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -72,10 +72,6 @@ func (this *Battle) QueryBattleRecord(oid string) (code pb.ErrorCode, record *pb return } -func (this *Battle) CreateMasterRoles(wheel int, fid int32) (captain int32, roles []*pb.BattleRole, code pb.ErrorCode) { - return this.modelBattle.createMasterRoles(wheel, fid) -} - //创建pve战斗 func (this *Battle) CreateEveBattle(session comm.IUserSession, req *pb.BattleEVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) { var ( diff --git a/pb/equipment_db.pb.go b/pb/equipment_db.pb.go index 3bf0d1e75..39a71ae52 100644 --- a/pb/equipment_db.pb.go +++ b/pb/equipment_db.pb.go @@ -32,6 +32,7 @@ type EquipmentAttributeEntry struct { Lv int32 `protobuf:"varint,4,opt,name=Lv,proto3" json:"Lv"` //属性等级 Value int32 `protobuf:"varint,5,opt,name=Value,proto3" json:"Value"` //属性值 BaseValue int32 `protobuf:"varint,6,opt,name=BaseValue,proto3" json:"BaseValue"` //基础属性 + EnchValue int32 `protobuf:"varint,7,opt,name=EnchValue,proto3" json:"EnchValue"` //附魔属性 } func (x *EquipmentAttributeEntry) Reset() { @@ -108,6 +109,13 @@ func (x *EquipmentAttributeEntry) GetBaseValue() int32 { return 0 } +func (x *EquipmentAttributeEntry) GetEnchValue() int32 { + if x != nil { + return x.EnchValue + } + return 0 +} + //装备技能词条 特殊装备/武器or饰品 type EquipmentSkillEntry struct { state protoimpl.MessageState @@ -336,7 +344,7 @@ var File_equipment_equipment_db_proto protoreflect.FileDescriptor var file_equipment_equipment_db_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x65, 0x71, 0x75, 0x69, - 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x69, @@ -347,50 +355,52 @@ var file_equipment_equipment_db_proto_rawDesc = []byte{ 0x52, 0x02, 0x4c, 0x76, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x42, - 0x61, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x13, 0x45, 0x71, 0x75, - 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x69, 0x64, 0x12, 0x1a, - 0x0a, 0x08, 0x41, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x41, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x6b, - 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x53, 0x6b, 0x69, - 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x4c, 0x76, 0x22, 0x92, 0x04, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, - 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, - 0x6f, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, - 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, - 0x76, 0x12, 0x20, 0x0a, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x75, 0x6d, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x61, 0x69, 0x6c, - 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, - 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0b, 0x61, - 0x64, 0x76, 0x65, 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x76, 0x65, - 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x68, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x44, 0x42, 0x5f, - 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x68, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x68, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, - 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, - 0x4e, 0x75, 0x6d, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x49, - 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, - 0x73, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x6c, - 0x6f, 0x63, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x64, 0x76, 0x65, 0x72, 0x62, 0x73, 0x6b, 0x69, - 0x6c, 0x6c, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, - 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, - 0x61, 0x64, 0x76, 0x65, 0x72, 0x62, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x1a, 0x3c, 0x0a, 0x0e, 0x45, - 0x6e, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x68, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x45, 0x6e, 0x63, + 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x13, 0x45, 0x71, 0x75, 0x69, 0x70, + 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, + 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x41, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x41, 0x74, 0x74, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x53, 0x6b, 0x69, 0x6c, 0x6c, + 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x4c, 0x76, 0x22, 0x92, 0x04, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x63, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, + 0x20, 0x0a, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x75, 0x6d, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x75, + 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, + 0x6d, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x64, 0x76, + 0x65, 0x72, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x76, 0x65, 0x72, 0x62, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x68, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x4e, 0x75, + 0x6d, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x64, 0x76, 0x65, 0x72, 0x62, 0x73, 0x6b, 0x69, 0x6c, 0x6c, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, + 0x76, 0x65, 0x72, 0x62, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x1a, 0x3c, 0x0a, 0x0e, 0x45, 0x6e, 0x63, + 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 985b30f3a29ac8a09f4eeba9e17e52864c2fa866 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 9 Nov 2022 15:41:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A5=96=E5=8A=B1?= =?UTF-8?q?=E9=A2=86=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/academy/{api_reward.go => api_receive.go} | 6 +++--- .../{api_teachingreward.go => api_teachingreceive.go} | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) rename modules/academy/{api_reward.go => api_receive.go} (79%) rename modules/academy/{api_teachingreward.go => api_teachingreceive.go} (73%) diff --git a/modules/academy/api_reward.go b/modules/academy/api_receive.go similarity index 79% rename from modules/academy/api_reward.go rename to modules/academy/api_receive.go index 70632af23..7d0c62478 100644 --- a/modules/academy/api_reward.go +++ b/modules/academy/api_receive.go @@ -9,13 +9,13 @@ import ( ) //参数校验 -func (this *apiComp) RewardCheck(session comm.IUserSession, req *pb.AcademyReceiveReq) (code pb.ErrorCode) { +func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.AcademyReceiveReq) (code pb.ErrorCode) { return } ///奖励领取 -func (this *apiComp) Reward(session comm.IUserSession, req *pb.AcademyReceiveReq) (code pb.ErrorCode, data proto.Message) { +func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveReq) (code pb.ErrorCode, data proto.Message) { var ( iswin bool level *cfg.GameTeachingData @@ -23,7 +23,7 @@ func (this *apiComp) Reward(session comm.IUserSession, req *pb.AcademyReceiveReq // group []*cfg.GameTeachingData err error ) - if code = this.RewardCheck(session, req); code != pb.ErrorCode_Success { + if code = this.ReceiveCheck(session, req); code != pb.ErrorCode_Success { return } if code, iswin = this.module.battle.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success { diff --git a/modules/academy/api_teachingreward.go b/modules/academy/api_teachingreceive.go similarity index 73% rename from modules/academy/api_teachingreward.go rename to modules/academy/api_teachingreceive.go index e8f0200bc..52401584c 100644 --- a/modules/academy/api_teachingreward.go +++ b/modules/academy/api_teachingreceive.go @@ -9,13 +9,13 @@ import ( ) //参数校验 -func (this *apiComp) TeachingRewardCheck(session comm.IUserSession, req *pb.AcademyTeachingReceiveReq) (code pb.ErrorCode) { +func (this *apiComp) TeachingReceiveCheck(session comm.IUserSession, req *pb.AcademyTeachingReceiveReq) (code pb.ErrorCode) { return } ///奖励领取 -func (this *apiComp) TeachingReward(session comm.IUserSession, req *pb.AcademyTeachingReceiveReq) (code pb.ErrorCode, data proto.Message) { +func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyTeachingReceiveReq) (code pb.ErrorCode, data proto.Message) { var ( iswin bool level *cfg.GameHeroStrategyData @@ -23,7 +23,7 @@ func (this *apiComp) TeachingReward(session comm.IUserSession, req *pb.AcademyTe // group []*cfg.GameTeachingData err error ) - if code = this.TeachingRewardCheck(session, req); code != pb.ErrorCode_Success { + if code = this.TeachingReceiveCheck(session, req); code != pb.ErrorCode_Success { return } if code, iswin = this.module.battle.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success { From 1883467116343e0f4453782abded184c2b06731e Mon Sep 17 00:00:00 2001 From: liwei Date: Wed, 9 Nov 2022 15:55:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=95=99=E5=AD=A6?= =?UTF-8?q?=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/academy/api_receive.go | 2 +- modules/academy/api_teachingreceive.go | 2 +- modules/academy/modelAcademy.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/academy/api_receive.go b/modules/academy/api_receive.go index 7d0c62478..3e14d121f 100644 --- a/modules/academy/api_receive.go +++ b/modules/academy/api_receive.go @@ -56,6 +56,6 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe // } this.module.DispenseRes(session, level.Award, true) } - + session.SendMsg(string(this.module.GetType()), "receive", &pb.AcademyReceiveResp{Issucc: true}) return } diff --git a/modules/academy/api_teachingreceive.go b/modules/academy/api_teachingreceive.go index 52401584c..b15ec9937 100644 --- a/modules/academy/api_teachingreceive.go +++ b/modules/academy/api_teachingreceive.go @@ -47,6 +47,6 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT } this.module.DispenseRes(session, level.Award, true) } - + session.SendMsg(string(this.module.GetType()), "teachingreceive", &pb.AcademyTeachingReceiveResp{Issucc: true}) return } diff --git a/modules/academy/modelAcademy.go b/modules/academy/modelAcademy.go index 92eaac081..5667a13af 100644 --- a/modules/academy/modelAcademy.go +++ b/modules/academy/modelAcademy.go @@ -32,6 +32,7 @@ func (this *modelAcademyComp) queryInfo(uId string) (result *pb.DBAcademy, err e result = &pb.DBAcademy{ Uid: uId, Level: make(map[int32]bool), + Hero: make(map[string]bool), } if err = this.Get(uId, result); err != nil && err != mgo.MongodbNil { this.module.Errorln(err) From 15a53a403c5dba0a630469aa598ea80044f784f8 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 9 Nov 2022 16:30:36 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=88=98=E6=96=97?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/academy/api_challenge.go | 1 + modules/academy/api_receive.go | 22 ++++++------- modules/academy/api_teaching.go | 1 + modules/academy/api_teachingreceive.go | 12 ++++--- pb/battle_msg.pb.go | 44 +++++++++++++++++++------- 5 files changed, 51 insertions(+), 29 deletions(-) diff --git a/modules/academy/api_challenge.go b/modules/academy/api_challenge.go index 1423d53b8..143c9f6f9 100644 --- a/modules/academy/api_challenge.go +++ b/modules/academy/api_challenge.go @@ -33,6 +33,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.AcademyChallen Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist, + Tasks: level.Task, }}) } else { session.SendMsg(string(this.module.GetType()), "challenge", &pb.AcademyChallengeResp{Code: cd, Info: nil}) diff --git a/modules/academy/api_receive.go b/modules/academy/api_receive.go index 3e14d121f..ba01d7bfc 100644 --- a/modules/academy/api_receive.go +++ b/modules/academy/api_receive.go @@ -34,6 +34,14 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe code = pb.ErrorCode_DBError return } + if level, err = this.module.configure.getGameTeaching(req.Level); err != nil { + code = pb.ErrorCode_DBError + return + } + if req.Report.Completetask == nil || len(req.Report.Completetask) != len(level.Task) { + return + } + if !info.Level[req.Level] { info.Level[req.Level] = true } @@ -41,19 +49,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe code = pb.ErrorCode_DBError return } - if level, err = this.module.configure.getGameTeaching(req.Level); err != nil { - code = pb.ErrorCode_DBError - return - } - // if group, err = this.module.configure.getGameTeachingByGroup(req.Group); err != nil { - // code = pb.ErrorCode_ConfigNoFound - // return - // } - // for _, v := range group { - // if !info.Level[v.Id] { - // return - // } - // } + this.module.DispenseRes(session, level.Award, true) } session.SendMsg(string(this.module.GetType()), "receive", &pb.AcademyReceiveResp{Issucc: true}) diff --git a/modules/academy/api_teaching.go b/modules/academy/api_teaching.go index f5e6585f3..397e1ea4b 100644 --- a/modules/academy/api_teaching.go +++ b/modules/academy/api_teaching.go @@ -33,6 +33,7 @@ func (this *apiComp) Teaching(session comm.IUserSession, req *pb.AcademyTeaching Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist, + Tasks: level.Task, }}) } else { session.SendMsg(string(this.module.GetType()), "teaching", &pb.AcademyTeachingResp{Code: cd, Info: nil}) diff --git a/modules/academy/api_teachingreceive.go b/modules/academy/api_teachingreceive.go index b15ec9937..96a562cde 100644 --- a/modules/academy/api_teachingreceive.go +++ b/modules/academy/api_teachingreceive.go @@ -34,6 +34,13 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT code = pb.ErrorCode_DBError return } + if level, err = this.module.configure.getGameHeroTeaching(req.HeroId); err != nil { + code = pb.ErrorCode_DBError + return + } + if req.Report.Completetask == nil || len(req.Report.Completetask) != len(level.Task) { + return + } if !info.Hero[req.HeroId] { info.Hero[req.HeroId] = true } @@ -41,10 +48,7 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT code = pb.ErrorCode_DBError return } - if level, err = this.module.configure.getGameHeroTeaching(req.HeroId); err != nil { - code = pb.ErrorCode_DBError - return - } + this.module.DispenseRes(session, level.Award, true) } session.SendMsg(string(this.module.GetType()), "teachingreceive", &pb.AcademyTeachingReceiveResp{Issucc: true}) diff --git a/pb/battle_msg.pb.go b/pb/battle_msg.pb.go index 64bdc3f3e..8c6d531a3 100644 --- a/pb/battle_msg.pb.go +++ b/pb/battle_msg.pb.go @@ -441,6 +441,7 @@ type BattleInfo struct { Redflist []*DBBattleFormt `protobuf:"bytes,6,rep,name=redflist,proto3" json:"redflist"` //红方阵型列表 BlueCompId string `protobuf:"bytes,7,opt,name=blueCompId,proto3" json:"blueCompId"` //蓝方阵营id Buleflist []*DBBattleFormt `protobuf:"bytes,8,rep,name=buleflist,proto3" json:"buleflist"` //红方阵型列表 + Tasks []int32 `protobuf:"varint,9,rep,packed,name=tasks,proto3" json:"tasks"` //任务列表 } func (x *BattleInfo) Reset() { @@ -531,15 +532,23 @@ func (x *BattleInfo) GetBuleflist() []*DBBattleFormt { return nil } +func (x *BattleInfo) GetTasks() []int32 { + if x != nil { + return x.Tasks + } + return nil +} + //战报数据 type BattleReport struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` - Costtime int32 `protobuf:"varint,2,opt,name=Costtime,proto3" json:"Costtime"` //战斗时长 单位ms - Process []byte `protobuf:"bytes,3,opt,name=process,proto3" json:"process"` //战斗过程数据 + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + Costtime int32 `protobuf:"varint,2,opt,name=Costtime,proto3" json:"Costtime"` //战斗时长 单位ms + Process []byte `protobuf:"bytes,3,opt,name=process,proto3" json:"process"` //战斗过程数据 + Completetask []int32 `protobuf:"varint,4,rep,packed,name=completetask,proto3" json:"completetask"` //完成任务 } func (x *BattleReport) Reset() { @@ -595,6 +604,13 @@ func (x *BattleReport) GetProcess() []byte { return nil } +func (x *BattleReport) GetCompletetask() []int32 { + if x != nil { + return x.Completetask + } + return nil +} + var File_battle_battle_msg_proto protoreflect.FileDescriptor var file_battle_battle_msg_proto_rawDesc = []byte{ @@ -646,7 +662,7 @@ var file_battle_battle_msg_proto_rawDesc = []byte{ 0x61, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x50, 0x56, 0x50, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x22, 0x8e, 0x02, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x74, 0x22, 0xa4, 0x02, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x62, 0x74, 0x79, 0x70, 0x65, 0x18, @@ -663,14 +679,18 @@ var file_battle_battle_msg_proto_rawDesc = []byte{ 0x6d, 0x70, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x09, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x52, 0x09, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6c, 0x69, - 0x73, 0x74, 0x22, 0x65, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x43, 0x6f, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x0c, 0x42, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, + 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x43, 0x6f, + 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x74, 0x61, 0x73, 0x6b, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x74, 0x61, 0x73, 0x6b, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var (