This commit is contained in:
aozhiwei 2024-02-18 11:11:02 +08:00
parent d85ccbe093
commit ba521302a3
3 changed files with 4 additions and 1 deletions

View File

@ -75,6 +75,7 @@ type GuildMgr interface {
type CacheMgr interface { type CacheMgr interface {
GetProfileByAccountId(accountId string, cb func(err error, profile *PlayerProfile)) GetProfileByAccountId(accountId string, cb func(err error, profile *PlayerProfile))
GetPlayerProfile(accountId string) *PlayerProfile
LoadUserProfile(string) LoadUserProfile(string)
} }

View File

@ -12,6 +12,7 @@ import (
"time" "time"
"main/constant" "main/constant"
"main/common" "main/common"
. "main/global"
) )
const ( const (
@ -211,7 +212,7 @@ func (gm *GuildMgr) ApplyToGuild(guildId int64, applicantAccountId string, cb fu
} }
if guild.JoinCond == constant.JoinCondStar { if guild.JoinCond == constant.JoinCondStar {
profile := cacheMgr.GetPlayerProfile(applicantAccountId) profile := GetCacheMgr().GetPlayerProfile(applicantAccountId)
if profile == nil { if profile == nil {
cb(constant.ERR_CODE_GUILD_MEMBER_NO_EXISTS, "applicantAccountId no exists", nil) cb(constant.ERR_CODE_GUILD_MEMBER_NO_EXISTS, "applicantAccountId no exists", nil)
return return

View File

@ -5,6 +5,7 @@ import (
_ "main/cache" _ "main/cache"
_ "main/chat" _ "main/chat"
_ "main/friend" _ "main/friend"
_ "main/guild"
_ "main/listener" _ "main/listener"
. "main/global" . "main/global"