From c724b1218216b25baf48d9eb4156879a60ae0be6 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Fri, 1 Nov 2024 14:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=AF=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_player.go | 12 +++++++++--- worldsrv/player.go | 11 ++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/worldsrv/action_player.go b/worldsrv/action_player.go index c5aa9f7..533e023 100644 --- a/worldsrv/action_player.go +++ b/worldsrv/action_player.go @@ -3097,6 +3097,9 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in p.GuideData = make(map[int32]int32) } stepId := p.GuideStep + 1 + if msg.GuideId != 1 { + stepId = int32(msg.Param[0]) + } pack := &player_proto.SCUpdateAttribute{ OpRetCode: player_proto.OpResultCode_OPRC_Error, Tp: msg.GetTp(), @@ -3139,7 +3142,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in cfg := PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.Info[msg.GuideId] switch msg.GetTp() { case common.AttributeGuideStep: - if len(msg.GetParam()) == 0 || msg.GetParam()[0] == 0 || p.GuideStep < 0 { + if len(msg.GetParam()) == 0 || msg.GetParam()[0] == 0 { return nil } if cfg.GetOn() != common.On { @@ -3148,6 +3151,9 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in return nil } if msg.GuideId == 1 { + if p.GuideStep < 0 { + return nil + } if p.GuideStep >= model.GameParamData.GuideStepMaxNum { pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_End send() @@ -3197,7 +3203,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in p.GuideData[msg.GuideId] = int32(msg.Param[0]) if p.GuideData[msg.GuideId] == cfg.AwardStep { //发奖 - items := []*model.Item{} + var items []*model.Item for _, award := range cfg.Awards { items = append(items, &model.Item{ ItemId: award.ItemId, @@ -3210,7 +3216,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in Change: items, GainWay: common.GainWayGuide, Operator: "system", - Remark: "新手引导奖励", + Remark: "完成引导奖励", }) } } diff --git a/worldsrv/player.go b/worldsrv/player.go index 3cd82fb..9d52af7 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -4598,11 +4598,12 @@ func (this *Player) SCGuide() { awards = append(awards, item) } info := &playerproto.GuideInfo{ - On: data.GetOn(), - Skip: data.GetSkip(), - GuideId: data.GetGuideId(), - Awards: awards, - MaxStep: data.MaxStep, + On: data.GetOn(), + Skip: data.GetSkip(), + GuideId: data.GetGuideId(), + Awards: awards, + MaxStep: data.MaxStep, + AwardStep: data.AwardStep, } pack.Info = append(pack.Info, info) }