From 812893939abfbcc86da814c0e71e8c916ddc560a Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Fri, 27 May 2022 16:21:45 +0800 Subject: [PATCH] update --- cmd/gameserver/action/RoleAction.go | 3 ++- cmd/gameserver/service/agent.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/gameserver/action/RoleAction.go b/cmd/gameserver/action/RoleAction.go index 2447414..1499f49 100644 --- a/cmd/gameserver/action/RoleAction.go +++ b/cmd/gameserver/action/RoleAction.go @@ -115,7 +115,7 @@ func HeroEquipReferRpc(role *models.RoleModel, msg components.IMessage) (int32, var outHero, inHero *models.HeroModel inEquip := csvdata.Get().TbEquipmentData.Get(equip.Equip.GetTbId()) if !req.Refer { - if h1 == nil { + if h1 != nil { outHero = h1.(*models.HeroModel) outHero.UpdateEquipment(equip.Equip.Id, 0) } @@ -123,6 +123,7 @@ func HeroEquipReferRpc(role *models.RoleModel, msg components.IMessage) (int32, outHero = h2.(*models.HeroModel) outHero.UpdateEquipment(equip.Equip.Id, 0) } + equip.SetProperty("heroid", "") } else { if h1 == nil { diff --git a/cmd/gameserver/service/agent.go b/cmd/gameserver/service/agent.go index 16b100d..4b4d732 100644 --- a/cmd/gameserver/service/agent.go +++ b/cmd/gameserver/service/agent.go @@ -110,7 +110,7 @@ func (c *Agent) SendMsg(errCode int32, cmd uint32, msg interface{}) error { func (c *Agent) OnMessage(msg components.IMessage) error { atomic.StoreInt64(&c.lastHeartCheckTime, common.Timex()) - logger.Debug("req protocolID: %d", msg.GetHeader().GetMsgID()) + logger.Debug("req protocolID: %d, %s", msg.GetHeader().GetMsgID(), msg.GetData()) //heart if msg.GetHeader().GetMsgID() == uint32(pb.ProtoCode_HeartReq) { return nil -- libgit2 0.21.2