From 8fff399bd97d203822e46d4f6e1b85c74a46586e Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 23 Oct 2024 11:50:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=8A=80=E9=A6=86=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=BF=85=E4=B8=AD=E7=8E=A9=E5=AE=B6=E5=BC=80?= =?UTF-8?q?=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/playerinfo.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/worldsrv/playerinfo.go b/worldsrv/playerinfo.go index 89ce022..b9069ff 100644 --- a/worldsrv/playerinfo.go +++ b/worldsrv/playerinfo.go @@ -72,10 +72,6 @@ func (p *PlayerInfoMgr) Shutdown() { } func (p *PlayerInfoMgr) Load(platform string, snid int32, data any) *internal.PlayerLoadReplay { - if platform != "" && snid > 0 { - p.PlayerPlatform[snid] = platform - } - var err error allPlayerInfo := &AllPlayerInfo{ GameData: make([]*model.PlayerGameData, 0), @@ -129,17 +125,21 @@ func (p *PlayerInfoMgr) Callback(data any, ret *internal.PlayerLoadReplay) { // ... p.Players[ret.Snid] = info + if ret.Snid > 0 && ret.Platform != "" { + p.PlayerPlatform[ret.Snid] = ret.Platform + } } func (p *PlayerInfoMgr) LoadAfter(platform string, snid int32) *internal.PlayerLoadReplay { - if platform != "" && snid > 0 { - p.PlayerPlatform[snid] = platform - } - return nil } -func (p *PlayerInfoMgr) CallbackAfter(ret *internal.PlayerLoadReplay) {} +func (p *PlayerInfoMgr) CallbackAfter(ret *internal.PlayerLoadReplay) { + + if ret != nil && ret.Snid > 0 && ret.Platform != "" { + p.PlayerPlatform[ret.Snid] = ret.Platform + } +} func (p *PlayerInfoMgr) Save(platform string, snid int32, isSync, force bool) { var err error