From 6cbf13d8fc3f90a6917f6f8127acbc080d7e2c71 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 19 Dec 2023 11:21:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E5=8A=A9=E6=88=98?= =?UTF-8?q?=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_global.json | 2 +- modules/friend/api_cross_assisthero.go | 9 +++------ modules/friend/api_cross_getreward.go | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/json/game_global.json b/bin/json/game_global.json index 1cf8d180f..f43f8ad37 100644 --- a/bin/json/game_global.json +++ b/bin/json/game_global.json @@ -231,7 +231,7 @@ "friend_peize": [ { "a": "attr", - "t": "friend", + "t": "friendPoint", "n": 100 } ], diff --git a/modules/friend/api_cross_assisthero.go b/modules/friend/api_cross_assisthero.go index 5bedcea3a..8ed4efee3 100644 --- a/modules/friend/api_cross_assisthero.go +++ b/modules/friend/api_cross_assisthero.go @@ -63,11 +63,8 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth "assistHeroId": req.HeroObjId, "hero": hero, } - - received := self.Received - if received == 0 { - update["received"] = 1 //设置可领取状态 - } + self.Received = 1 + update["received"] = self.Received //设置可领取状态 if err := this.module.modelFriend.Change(self.Uid, update); err != nil { errdata = &pb.ErrorData{ @@ -82,7 +79,7 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth return } - rsp := &pb.FriendAssistheroResp{HeroObjId: req.HeroObjId, Received: received} + rsp := &pb.FriendAssistheroResp{HeroObjId: req.HeroObjId, Received: self.Received} if err := session.SendMsg(string(this.module.GetType()), FriendSubTypeAssistHero, rsp); err != nil { return } diff --git a/modules/friend/api_cross_getreward.go b/modules/friend/api_cross_getreward.go index fab1b3884..193cbab8f 100644 --- a/modules/friend/api_cross_getreward.go +++ b/modules/friend/api_cross_getreward.go @@ -34,9 +34,9 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar return } - received := 2 //已领 + self.Received = 2 //已领 update := map[string]interface{}{ - "received": received, + "received": self.Received, } if err := this.module.modelFriend.Change(self.Uid, update); err != nil { errdata = &pb.ErrorData{ @@ -60,7 +60,7 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar } session.SendMsg(string(this.module.GetType()), "getreward", &pb.FriendGetrewardResp{ - Received: int32(received), + Received: int32(self.Received), Atno: atno, }) From 447af63a0a2ea921fe59e01bb887f689d9260d89 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 19 Dec 2023 11:59:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E6=8A=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_drawCard.go | 2 +- modules/hero/api_selectcard.go | 2 +- modules/hero/model_hero.go | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index c6e6dc700..4ecd669a3 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -281,7 +281,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq add []*pb.DBHero allres []*cfg.Gameatn ) - if res, add, err = this.module.modelHero.ImitateHeros(session, szCards); err == nil { + if res, add, err = this.module.modelHero.ImitateHeros(session, szCards, req.DrawType); err == nil { for _, v := range res { var atno []*pb.UserAtno for _, v1 := range v { diff --git a/modules/hero/api_selectcard.go b/modules/hero/api_selectcard.go index a09fc5f1f..2fc1a1239 100644 --- a/modules/hero/api_selectcard.go +++ b/modules/hero/api_selectcard.go @@ -60,7 +60,7 @@ func (this *apiComp) SelectCard(session comm.IUserSession, req *pb.HeroSelectCar add []*pb.DBHero allres []*cfg.Gameatn ) - if res, add, err = this.module.modelHero.ImitateHeros(session, curSzCard); err == nil { + if res, add, err = this.module.modelHero.ImitateHeros(session, curSzCard, 2); err == nil { for _, v := range res { var atno []*pb.UserAtno for _, v1 := range v { diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 842d7f5a0..e7c253765 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -1117,7 +1117,7 @@ func (this *ModelHero) drawcardcreateHero(session comm.IUserSession, ids []strin } // 模拟获得英雄 -func (this *ModelHero) ImitateHeros(session comm.IUserSession, cids []string) (addres [][]*cfg.Gameatn, add []*pb.DBHero, err error) { +func (this *ModelHero) ImitateHeros(session comm.IUserSession, cids []string, itype int32) (addres [][]*cfg.Gameatn, add []*pb.DBHero, err error) { heros := make([]*pb.DBHero, 0) uid := session.GetUserId() @@ -1165,7 +1165,12 @@ func (this *ModelHero) ImitateHeros(session comm.IUserSession, cids []string) (a } if bFirst { // 没有当前英雄 - hero, err = this.initHeroOverlying(uid, heroCfgId, 1) + if itype == 1 { + hero = this.InitHero(uid, heroCfgId) + } else { + hero, err = this.initHeroOverlying(uid, heroCfgId, 1) + } + if err != nil { return } From 188ef87b076ca0504bec51a3c9d7865bae54fa25 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 19 Dec 2023 12:01:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/tools/comp_configure.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/comp_configure.go b/modules/tools/comp_configure.go index 68f7e3009..a2901e654 100644 --- a/modules/tools/comp_configure.go +++ b/modules/tools/comp_configure.go @@ -175,7 +175,7 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32, defer this.hlock.RUnlock() if _, ok := this._lotteryType1[lotteryId]; !ok { if _, ok := this._lotteryType2[lotteryId]; !ok { - this.module.Errorf("not found config lotterId:%d", lotteryId) + this.module.Debugf("not found config lotterId:%d", lotteryId) return } }