This commit is contained in:
aozhiwei 2024-04-04 14:05:11 +08:00
parent fe8befa333
commit e4303e3f02

View File

@ -101,7 +101,7 @@ func (this *guildMgr) GetGuildByGuildName(guildName string) common.Guild {
func (this *guildMgr) internalGetGuildByAccountId(accountId string) *guild {
m := this.internalGetMemberByAccountId(accountId)
if m != nil {
return m.guild
}
return nil
}
@ -153,8 +153,8 @@ func (this* guildMgr) removeUsingName(name string) {
delete(this.usingNameHash, name)
}
func (this* guildMgr) genMemberLockKey(accountId string) string {
return accountId
func (this* guildMgr) genMemberLockKeys(accountIds []string) []string {
return accountIds
}
func (this *guildMgr) asyncCreateGuildTask(task *f5.AsyncTask, accountId string, avatar int32, name string,
@ -240,8 +240,8 @@ func (this *guildMgr) asyncCreateGuildTask(task *f5.AsyncTask, accountId string,
func (this *guildMgr) AsyncCreateGuild(accountId string, avatar int32, name string,
cb func(int32, string, int64)) {
lockKey := this.genMemberLockKey(accountId)
f5.GetApp().AsyncLock(lockKey,
lockKeys := this.genMemberLockKeys([]string{accountId})
f5.GetApp().AsyncLock(lockKeys,
f5.NewAsyncTask(
func (task *f5.AsyncTask) {
this.asyncCreateGuildTask(task, accountId, avatar, name, cb)
@ -319,8 +319,17 @@ func (this *guildMgr) AsyncApplyJoin(accountId string, guildId string, cb func(i
})
}
func (this *guildMgr) AsyncAcceptApply(string, string, func(int32, string)) {
func (this *guildMgr) asyncAcceptApplyTask(task *f5.AsyncTask,
accountId string, targetId string, cb func(int32, string)) {
}
func (this *guildMgr) AsyncAcceptApply(accountId string, targetId string, cb func(int32, string)) {
lockKeys := this.genMemberLockKeys([]string{accountId})
f5.GetApp().AsyncLock(lockKeys,
f5.NewAsyncTask(
func (task *f5.AsyncTask) {
this.asyncAcceptApplyTask(task, accountId, targetId, cb)
}))
}
func (this *guildMgr) AsyncRejectApply(accountId string, guildId string,