This commit is contained in:
aozhiwei 2024-04-17 13:11:33 +08:00
parent d721f5d9f3
commit 32151093dc
2 changed files with 9 additions and 0 deletions

View File

@ -219,6 +219,10 @@ func (this *guild) delMember(memberId string) {
delete(this.idHash, memberId)
}
func (this *guild) isFull() bool {
return this.GetMemberNum() >= this.maxMemberNum
}
func newGuild() *guild {
p := new(guild)
p.idHash = make(map[string]*member)

View File

@ -352,6 +352,11 @@ func (this *guildMgr) asyncAcceptApplyTask(task *f5.LockAsyncTask, guild *guild,
cb(1, "", "", "")
return
}
if guild.isFull() {
task.SetFail()
cb(1, "Exceeding cube member number limit", "", "")
return
}
if this.internalGetMemberByAccountId(targetId) != nil {
task.SetFail()
cb(1, "", "", "")