From 624a53324dedebc0efdb8db0534f68848c994332 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 13 Jan 2023 18:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E7=BA=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 4 ++-- modules/hero/hero_test.go | 5 +++-- modules/mline/api_challengeover.go | 18 ++++++++---------- modules/troll/api_getlist.go | 2 +- modules/troll/comp_configure.go | 4 ++-- modules/troll/module.go | 2 -- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/comm/const.go b/comm/const.go index 0a5bb88b8..5cd10c6f8 100644 --- a/comm/const.go +++ b/comm/const.go @@ -705,8 +705,8 @@ const ( ) const ( MainStarType1 = 1 //成功通关 - MainStarType2 = 1 //死亡人数不超过{0}人 - MainStarType3 = 1 //不超过{0}回合通关 + MainStarType2 = 2 //死亡人数不超过{0}人 + MainStarType3 = 3 //不超过{0}回合通关 ) const ( diff --git a/modules/hero/hero_test.go b/modules/hero/hero_test.go index 48b28ad47..e93dca1ea 100644 --- a/modules/hero/hero_test.go +++ b/modules/hero/hero_test.go @@ -73,14 +73,15 @@ func Test_Main(t *testing.T) { var star1, star2, star3 int32 var rst int32 - star1 = 1 << 2 + star1 = 1 << 0 star2 = 1 << 1 - star3 = 1 << 0 + star3 = 1 << 2 //rst = star1 ^ star2 ^ star3 // 三星 //rst = star1 ^ star2 // 2星 rst ^= star1 rst ^= star2 + rst ^= star2 // 校验星 b1 := (rst&star1 == star1) b2 := (rst&star2 == star2) diff --git a/modules/mline/api_challengeover.go b/modules/mline/api_challengeover.go index dee665679..3a760ceaf 100644 --- a/modules/mline/api_challengeover.go +++ b/modules/mline/api_challengeover.go @@ -78,23 +78,21 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall code = pb.ErrorCode_ConfigNoFound return } - var star1, star2, star3 int32 - star1 = 1 << 2 - star2 = 1 << 1 - star3 = 1 << 0 + + var szStar []int32 + szStar = append(szStar, 1<<0) + szStar = append(szStar, 1<<1) + szStar = append(szStar, 1<<2) for i, v := range stageConf.StarType { if v == comm.MainStarType1 { - //star += stageConf.Star[i] - star ^= star1 + star ^= szStar[i] } else if v == comm.MainStarType2 { if req.Report.Death <= stageConf.StarValue[i] { - //star += stageConf.Star[i] - star ^= star2 + star ^= szStar[i] } } else if v == comm.MainStarType3 { if req.Report.Round <= stageConf.StarValue[i] { - //star += stageConf.Star[i] - star ^= star3 + star ^= szStar[i] } } } diff --git a/modules/troll/api_getlist.go b/modules/troll/api_getlist.go index a254293be..2f6834860 100644 --- a/modules/troll/api_getlist.go +++ b/modules/troll/api_getlist.go @@ -67,7 +67,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.TrollGetListReq) code = pb.ErrorCode_ConfigNoFound return } - if int32(configure.Now().Unix()-trolltrain.RefreshTime) < szTrain[trolltrain.TarinPos-1] { + if configure.Now().Unix()-trolltrain.RefreshTime < int64(szTrain[trolltrain.TarinPos-1]) { //session.SendMsg(string(this.module.GetType()), TrollGetListResp, &pb.TrollGetListResp{Data: trolltrain}) return } diff --git a/modules/troll/comp_configure.go b/modules/troll/comp_configure.go index b10ca9df8..c69333435 100644 --- a/modules/troll/comp_configure.go +++ b/modules/troll/comp_configure.go @@ -84,9 +84,9 @@ func (this *configureComp) GetTrollRule(id int32) int32 { if configure, ok := v.(*cfg.GameTrollRule); ok { return configure.Get(id).Quantity } - } else { - log.Errorf("get GameTrollRuleData conf err:%v", err) } + log.Errorf("get GetTrollRule conf err:%d", id) + return 1 } diff --git a/modules/troll/module.go b/modules/troll/module.go index 85d119eb1..9d93a310e 100644 --- a/modules/troll/module.go +++ b/modules/troll/module.go @@ -146,9 +146,7 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain) (c this.Errorf("玩家 uid:%s 金币不足,获得金币%d", session.GetUserId(), buyGold) } } - totalGold += buyGold - } } else { // 超过当前时间 refreshTime -= int64(sz[index])