From 0d9e9f86a0b92150dfc5ffd01186d9225f0c401c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 9 Aug 2023 18:07:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E4=BC=98=E5=8C=96=20+=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/uigame/api_getlattice.go | 24 +++++++++-- modules/uigame/api_getlist.go | 20 +++++++-- modules/uigame/api_latticefinish.go | 5 +-- modules/uigame/api_latticegrid.go | 55 +++++++++++++++--------- modules/uigame/api_latticereward.go | 11 +++++ modules/uigame/comp_configure.go | 3 ++ modules/uigame/model_lattice.go | 4 +- pb/uigame_db.pb.go | 65 ++++++++++++++++------------- 8 files changed, 128 insertions(+), 59 deletions(-) diff --git a/modules/uigame/api_getlattice.go b/modules/uigame/api_getlattice.go index 88fa1eb30..9286007b3 100644 --- a/modules/uigame/api_getlattice.go +++ b/modules/uigame/api_getlattice.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" + "go_dreamfactory/utils" ) //参数校验 @@ -22,6 +23,7 @@ func (this *apiComp) GetLattice(session comm.IUserSession, req *pb.UiGameGetLatt hdData *pb.DBLatticeData // 玩家的活动数据 update map[string]interface{} // ) + update = make(map[string]interface{}) curTime := configure.Now().Unix() if activity, err = this.module.ModuleActivity.GetHdInfoByHdId(req.Hdid); err != nil { // 活动不存在 errdata = &pb.ErrorData{ @@ -40,22 +42,38 @@ func (this *apiComp) GetLattice(session comm.IUserSession, req *pb.UiGameGetLatt // 获取玩家活动数据 hdData, _ = this.module.modelLattice.getLatticeList(session.GetUserId(), activity.Id) - if e, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { + if e, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { - if conf, err := this.module.configure.GetLatticeConsumConf(); err != nil { + if conf, err := this.module.configure.GetLatticeConsumConf(); err == nil { + bchange := false + // 清除每日获得的碎片数据 + if !utils.IsToday(hdData.Lasttime) { + hdData.Lasttime = configure.Now().Unix() + hdData.Val = 0 + update["val"] = hdData.Val + update["lasttime"] = hdData.Lasttime + bchange = true + } if conf.Getmax > hdData.Val { // 超过今日上限 if e.ConsumPs/conf.Usepawer >= hdData.Val { hdData.Val = e.ConsumPs / conf.Usepawer if conf.Getmax < hdData.Val { // 超过今日上限 hdData.Val = conf.Getmax update["val"] = hdData.Val - this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update) // 修改进度 + bchange = true } } } + if bchange { + this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update) + } } } + this.LatticeReward(session, &pb.UiGameLatticeRewardReq{ + Hdid: "64d4b1f7510317d189bb6ee5", + Id: 3, + }) session.SendMsg(string(this.module.GetType()), "getlattice", &pb.UiGameGetLatticeResp{Data: hdData}) return } diff --git a/modules/uigame/api_getlist.go b/modules/uigame/api_getlist.go index 5cfe4fa8b..34466a019 100644 --- a/modules/uigame/api_getlist.go +++ b/modules/uigame/api_getlist.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" + "go_dreamfactory/utils" ) //参数校验 @@ -22,6 +23,7 @@ func (this *apiComp) GetPuzzle(session comm.IUserSession, req *pb.UiGameGetPuzzl hdData *pb.DBPuzzleData // 玩家的活动数据 update map[string]interface{} // ) + update = make(map[string]interface{}) curTime := configure.Now().Unix() if activity, err = this.module.ModuleActivity.GetHdInfoByHdId(req.Hdid); err != nil { // 活动不存在 errdata = &pb.ErrorData{ @@ -40,19 +42,31 @@ func (this *apiComp) GetPuzzle(session comm.IUserSession, req *pb.UiGameGetPuzzl // 获取玩家活动数据 hdData, _ = this.module.modelPuzzle.getPuzzleList(session.GetUserId(), activity.Id) - if e, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { + if e, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { - if conf, err := this.module.configure.GetPuzzleConsumConf(); err != nil { + if conf, err := this.module.configure.GetPuzzleConsumConf(); err == nil { + bchange := false + // 清除每日获得的碎片数据 + if !utils.IsToday(hdData.Lasttime) { + hdData.Lasttime = configure.Now().Unix() + hdData.Val = 0 + update["val"] = hdData.Val + update["lasttime"] = hdData.Lasttime + bchange = true + } if conf.Getmax > hdData.Val { // 超过今日上限 if e.ConsumPs/conf.Usepawer >= hdData.Val { hdData.Val = e.ConsumPs / conf.Usepawer if conf.Getmax < hdData.Val { // 超过今日上限 hdData.Val = conf.Getmax update["val"] = hdData.Val - this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update) // 修改进度 + bchange = true } } } + if bchange { + this.module.modelPuzzle.modifyPuzzleListByObjId(session.GetUserId(), update) + } } } diff --git a/modules/uigame/api_latticefinish.go b/modules/uigame/api_latticefinish.go index 542004cb6..1f59a00a2 100644 --- a/modules/uigame/api_latticefinish.go +++ b/modules/uigame/api_latticefinish.go @@ -37,9 +37,8 @@ func (this *apiComp) LatticeFinish(session comm.IUserSession, req *pb.UiGameLatt list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid) if list.BReward { errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ActivityRepatReward, - Title: pb.ErrorCode_ActivityRepatReward.ToString(), - Message: err.Error(), + Code: pb.ErrorCode_ActivityRepatReward, + Title: pb.ErrorCode_ActivityRepatReward.ToString(), } return } diff --git a/modules/uigame/api_latticegrid.go b/modules/uigame/api_latticegrid.go index b980488c6..36cbd9b0a 100644 --- a/modules/uigame/api_latticegrid.go +++ b/modules/uigame/api_latticegrid.go @@ -24,7 +24,6 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic return // 参数校验失败直接返回 } var ( - consum *cfg.Gameatn // 获取消耗 latticeConf *cfg.GameUiGameLatticeData err error atno []*pb.UserAtno @@ -37,19 +36,32 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic session.SendMsg(string(this.module.GetType()), "latticegrid", &pb.UiGameLatticeGridResp{Data: list}) return } - // 校验消耗 - if conf, err = this.module.configure.GetLatticeConsumConf(); err != nil { - consum = &cfg.Gameatn{ - A: conf.Itemget.A, - T: conf.Itemget.T, - N: 1, + if v1, ok := list.Lattice[list.Floor]; ok { + if _, ok := v1.Data[req.Grid]; ok { + errdata = &pb.ErrorData{ // 重复领取 + Code: pb.ErrorCode_ActivityRepatReward, + Title: pb.ErrorCode_ActivityRepatReward.ToString(), + } + return + } + list.Lattice[list.Floor].Data[req.Grid] = 1 + } else { + + list.Lattice[list.Floor] = &pb.LatticeData{ + Data: map[int32]int32{req.Grid: 1}, } } - if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{consum}, true); errdata != nil { - return + // 校验消耗 + if conf, err = this.module.configure.GetLatticeConsumConf(); err != nil { + if conf.Cost.N > 0 { + if errdata = this.module.CheckRes(session, []*cfg.Gameatn{conf.Cost}); errdata != nil { // 消耗校验 + return + } + } } + // 校验 是否是宝箱 - latticeConf, err = this.module.configure.GetLatticeConf(list.Val) + latticeConf, err = this.module.configure.GetLatticeConf(list.Floor) if err != nil { return } @@ -68,24 +80,27 @@ func (this *apiComp) LatticeGrid(session comm.IUserSession, req *pb.UiGameLattic } } } - + if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{conf.Cost}, true); errdata != nil { + return + } + update["lattice"] = list.Lattice // 如果是下一关 if req.Grid == latticeConf.Outpos { - list.Val += 1 + list.Floor += 1 // 校验是不是达到最大层数 - if _, e := this.module.configure.GetLatticeConf(list.Val); e == nil { - list.Val -= 1 + if _, e := this.module.configure.GetLatticeConf(list.Floor); e == nil { + list.Floor -= 1 } - update["val"] = list.Val - if list.Total < list.Val { - list.Total = list.Val + update["Floor"] = list.Floor + if list.Total < list.Floor { + list.Total = list.Floor update["total"] = list.Total } } - list.Gotarr[req.Grid] = 1 + // list.Gotarr[req.Grid] = 1 - update["gotarr"] = list.Gotarr - this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update) // 修改进度 + // update["gotarr"] = list.Gotarr + this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update) session.SendMsg(string(this.module.GetType()), "latticegrid", &pb.UiGameLatticeGridResp{ Data: list, Atno: atno, diff --git a/modules/uigame/api_latticereward.go b/modules/uigame/api_latticereward.go index b7757ec9f..74454985c 100644 --- a/modules/uigame/api_latticereward.go +++ b/modules/uigame/api_latticereward.go @@ -34,8 +34,19 @@ func (this *apiComp) LatticeReward(session comm.IUserSession, req *pb.UiGameLatt } return } else { + if len(conf.Openward) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } + return + } list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid) if _, ok := list.Gotarr[req.Id]; ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ActivityRepatReward, + Title: pb.ErrorCode_ActivityRepatReward.ToString(), + } return } diff --git a/modules/uigame/comp_configure.go b/modules/uigame/comp_configure.go index b6978b491..bac2df365 100644 --- a/modules/uigame/comp_configure.go +++ b/modules/uigame/comp_configure.go @@ -1,6 +1,7 @@ package uigame import ( + "fmt" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" @@ -98,6 +99,7 @@ func (this *configureComp) GetLatticeConsumConf() (conf *cfg.GameUiGameConsumDat this.module.Errorf("GetLatticeConsumConf conf not found key :puzzle") return } + func (this *configureComp) GetLatticeConf(id int32) (conf *cfg.GameUiGameLatticeData, err error) { var ( v interface{} @@ -109,6 +111,7 @@ func (this *configureComp) GetLatticeConf(id int32) (conf *cfg.GameUiGameLattice } } } + err = fmt.Errorf("GetLatticeConf conf not found key :%d", id) this.module.Errorf("GetLatticeConf conf not found key :%d", id) return } diff --git a/modules/uigame/model_lattice.go b/modules/uigame/model_lattice.go index 83391278d..e7386fa9e 100644 --- a/modules/uigame/model_lattice.go +++ b/modules/uigame/model_lattice.go @@ -39,11 +39,11 @@ func (this *modelLattice) getLatticeList(uid string, hid string) (result *pb.DBL Gotarr: map[int32]int32{}, Lattice: map[int32]*pb.LatticeData{}, Lasttime: 0, - Val: 1, //默认1层 + Floor: 1, //默认1层 Total: 1, } err = nil - this.module.modelPuzzle.Add(uid, result) + this.module.modelLattice.Add(uid, result) } return } diff --git a/pb/uigame_db.pb.go b/pb/uigame_db.pb.go index 2ab56d9f8..9fd43ea3f 100644 --- a/pb/uigame_db.pb.go +++ b/pb/uigame_db.pb.go @@ -175,9 +175,10 @@ type DBLatticeData struct { Gotarr map[int32]int32 `protobuf:"bytes,4,rep,name=gotarr,proto3" json:"gotarr" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 奖励领取状态 Lattice map[int32]*LatticeData `protobuf:"bytes,5,rep,name=lattice,proto3" json:"lattice" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 迷宫数据 Lasttime int64 `protobuf:"varint,6,opt,name=lasttime,proto3" json:"lasttime"` - Val int32 `protobuf:"varint,7,opt,name=val,proto3" json:"val"` // 当前第几层 + Val int32 `protobuf:"varint,7,opt,name=val,proto3" json:"val"` // 今天获得N个碎片 Total int32 `protobuf:"varint,8,opt,name=total,proto3" json:"total"` // 总的层数 BReward bool `protobuf:"varint,9,opt,name=bReward,proto3" json:"bReward"` // 总奖励 + Floor int32 `protobuf:"varint,10,opt,name=floor,proto3" json:"floor"` // 当前第几层 } func (x *DBLatticeData) Reset() { @@ -275,6 +276,13 @@ func (x *DBLatticeData) GetBReward() bool { return false } +func (x *DBLatticeData) GetFloor() int32 { + if x != nil { + return x.Floor + } + return 0 +} + // 矿工 type DBMinerData struct { state protoimpl.MessageState @@ -404,7 +412,7 @@ var file_uigame_uigame_db_proto_rawDesc = []byte{ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x95, 0x03, 0x0a, 0x0d, 0x44, 0x42, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, + 0xab, 0x03, 0x0a, 0x0d, 0x44, 0x42, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x64, 0x6f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, @@ -421,32 +429,33 @@ var file_uigame_uigame_db_proto_rawDesc = []byte{ 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x52, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x48, 0x0a, - 0x0c, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfa, 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x4d, 0x69, - 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x64, 0x6f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x68, 0x64, 0x6f, 0x69, 0x64, 0x12, - 0x30, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x44, 0x42, 0x4d, 0x69, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x6f, - 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, - 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, - 0x18, 0x0a, 0x07, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x6f, 0x74, - 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x6f, 0x74, 0x61, + 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x48, 0x0a, 0x0c, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfa, 0x01, + 0x0a, 0x0b, 0x44, 0x42, 0x4d, 0x69, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x68, 0x64, 0x6f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x68, 0x64, 0x6f, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x4d, 0x69, 0x6e, 0x65, 0x72, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x47, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, + 0x39, 0x0a, 0x0b, 0x47, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From cb960129f4a83382f9a6ab55f65a244807c4659e Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 9 Aug 2023 18:16:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=E7=B1=BB=E5=9E=8B208=20=20=20=E6=8B=A5?= =?UTF-8?q?=E6=9C=89X=E5=90=8D=E5=9B=9E=E5=93=8D=E8=BE=BE=E5=88=B0?= =?UTF-8?q?=E6=BB=A1=E7=BA=A7=E7=9A=84X=E9=98=B5=E5=AE=B9=E5=AE=88?= =?UTF-8?q?=E6=8A=A4=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 1 + modules/hero/api_talentlearn.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/comm/const.go b/comm/const.go index 4edb543c0..90d4a0557 100644 --- a/comm/const.go +++ b/comm/const.go @@ -834,6 +834,7 @@ const ( Rtype205 TaskType = 205 //拾取宝箱 Rtype206 TaskType = 206 //完成X次复合事件 Rtype207 TaskType = 207 //完成X组事件 + Rtype208 TaskType = 208 // 拥有X名回响达到满级的X阵容守护者 ) const ( MailLineEasy int32 = 1 // 简单 diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 9c53a29e8..ee0e4b29e 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -204,6 +204,10 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe } } } + // 满回响 + if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) { + szTask = append(szTask, comm.GetBuriedParam(comm.Rtype128, 1, cfg.Race)) + } szTask = append(szTask, comm.GetBuriedParam(comm.Rtype199, 1)) go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) }