接口优化

This commit is contained in:
hahwu 2025-04-01 16:24:16 +08:00
parent 80d0aa0996
commit f5995941af

View File

@ -52,6 +52,13 @@ func ReqPlayerBriefProfileDataFunc(player *Player, buf []byte) error {
proto.Unmarshal(buf, detail) proto.Unmarshal(buf, detail)
Uid := int(detail.DwUin) Uid := int(detail.DwUin)
PlayerSimpleData := G_GameLogicPtr.GetSimplePlayerByUid(Uid) PlayerSimpleData := G_GameLogicPtr.GetSimplePlayerByUid(Uid)
if PlayerSimpleData == nil {
log.Debug("玩家不存在, Uid:%d", Uid)
player.SendErrClienRes(&msg.ResPlayerBriefProfileData{
DwUin: detail.DwUin,
})
return errors.New("玩家不存在")
}
player.PushClientRes(&msg.ResPlayerBriefProfileData{ player.PushClientRes(&msg.ResPlayerBriefProfileData{
DwUin: detail.DwUin, DwUin: detail.DwUin,
ImageFrame: int32(PlayerSimpleData.Avatar), ImageFrame: int32(PlayerSimpleData.Avatar),