From ba521302a303961589111c02c68ef3e28cb14920 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 18 Feb 2024 11:11:02 +0800 Subject: [PATCH] 1 --- server/imserver_new/common/types.go | 1 + server/imserver_new/guild/guildmgr.go | 3 ++- server/imserver_new/initialize/enter.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/imserver_new/common/types.go b/server/imserver_new/common/types.go index 1fce330a..4435391d 100644 --- a/server/imserver_new/common/types.go +++ b/server/imserver_new/common/types.go @@ -75,6 +75,7 @@ type GuildMgr interface { type CacheMgr interface { GetProfileByAccountId(accountId string, cb func(err error, profile *PlayerProfile)) + GetPlayerProfile(accountId string) *PlayerProfile LoadUserProfile(string) } diff --git a/server/imserver_new/guild/guildmgr.go b/server/imserver_new/guild/guildmgr.go index 8b00b91b..2c02338f 100644 --- a/server/imserver_new/guild/guildmgr.go +++ b/server/imserver_new/guild/guildmgr.go @@ -12,6 +12,7 @@ import ( "time" "main/constant" "main/common" + . "main/global" ) const ( @@ -211,7 +212,7 @@ func (gm *GuildMgr) ApplyToGuild(guildId int64, applicantAccountId string, cb fu } if guild.JoinCond == constant.JoinCondStar { - profile := cacheMgr.GetPlayerProfile(applicantAccountId) + profile := GetCacheMgr().GetPlayerProfile(applicantAccountId) if profile == nil { cb(constant.ERR_CODE_GUILD_MEMBER_NO_EXISTS, "applicantAccountId no exists", nil) return diff --git a/server/imserver_new/initialize/enter.go b/server/imserver_new/initialize/enter.go index 0f9a65ab..20081bb5 100644 --- a/server/imserver_new/initialize/enter.go +++ b/server/imserver_new/initialize/enter.go @@ -5,6 +5,7 @@ import ( _ "main/cache" _ "main/chat" _ "main/friend" + _ "main/guild" _ "main/listener" . "main/global"