This commit is contained in:
aozhiwei 2024-04-12 13:45:25 +08:00
parent 6463fa8850
commit aba2372e43
3 changed files with 13 additions and 13 deletions

View File

@ -94,7 +94,7 @@ type GuildMgr interface {
AsyncLeave(string, func(int32, string, []string)) AsyncLeave(string, func(int32, string, []string))
AsyncKickout(string, string, func(int32, string, string, string)) AsyncKickout(string, string, func(int32, string, string, string))
AsyncDisband(string, func(int32, string, []string)) AsyncDisband(string, func(int32, string, []string))
AsyncSetGuildJob(string, string, int32, func(int32, string)) AsyncSetGuildJob(string, string, int32, func(int32, string, string, string))
AsyncSearch(int64, string, func(int32, string, int64, []string)) AsyncSearch(int64, string, func(int32, string, int64, []string))
AsyncGetGuildLogs(string, string, func(int32, string)) AsyncGetGuildLogs(string, string, func(int32, string))
AsyncUpdateGuild(string, map[int32]string, func(int32, string)) AsyncUpdateGuild(string, map[int32]string, func(int32, string))

View File

@ -453,32 +453,32 @@ func (this *guildMgr) AsyncLeave(accountId string, cb func(int32, string, []stri
} }
func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJob int32, func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJob int32,
cb func(int32, string)) { cb func(int32, string, string, string)) {
if accountId == targetId { if accountId == targetId {
cb(0, "") cb(0, "", "", "")
return return
} }
guild := this.internalGetGuildByAccountId(accountId) guild := this.internalGetGuildByAccountId(accountId)
if guild == nil { if guild == nil {
cb(0, "") cb(0, "", "", "")
return return
} }
if !this.isValidGuildJob(guildJob) { if !this.isValidGuildJob(guildJob) {
cb(1, "params error") cb(1, "params error", "", "")
return return
} }
if !guild.isOwner(accountId) { if !guild.isOwner(accountId) {
cb(0, "") cb(0, "", "", "")
return; return;
} }
owner := guild.getMember(accountId) owner := guild.getMember(accountId)
if owner == nil { if owner == nil {
cb(0, "") cb(0, "", "", "")
return; return;
} }
member := guild.getMember(targetId) member := guild.getMember(targetId)
if member == nil { if member == nil {
cb(0, "") cb(0, "", "", "")
return; return;
} }
f5.NewLockAsyncTask( f5.NewLockAsyncTask(
@ -493,7 +493,7 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
func (err error, lastInsertId int64, rowsAffected int64) { func (err error, lastInsertId int64, rowsAffected int64) {
if err != nil { if err != nil {
task.SetFail() task.SetFail()
cb(500, "") cb(500, "", "", "")
return return
} }
member.guildJob = guildJob member.guildJob = guildJob
@ -503,16 +503,16 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
func (err error, lastInsertId int64, rowsAffected int64) { func (err error, lastInsertId int64, rowsAffected int64) {
if err != nil { if err != nil {
task.SetFail() task.SetFail()
cb(500, "") cb(500, "", "", "")
return return
} }
owner.guildJob = constant.GuildMemberLevelDefault owner.guildJob = constant.GuildMemberLevelDefault
task.SetSucc() task.SetSucc()
cb(0, "") cb(0, "", guild.guildId, guild.guildName)
}) })
} else { } else {
task.SetSucc() task.SetSucc()
cb(0, "") cb(0, "", guild.guildId, guild.guildName)
} }
}) })
}) })

View File

@ -613,7 +613,7 @@ func (this *player) CMSetMemberLevel(hdr *f5.MsgHdr, msg *cs.CMSetMemberLevel) {
this.GetAccountId(), this.GetAccountId(),
msg.GetMemberAccountId(), msg.GetMemberAccountId(),
msg.GetMemberLevel(), msg.GetMemberLevel(),
func (errCode int32, errMsg string) { func (errCode int32, errMsg string, guildId string, guildName string) {
if errCode != 0 { if errCode != 0 {
this.SendMsg(rspMsg.Err(errCode, errMsg)) this.SendMsg(rspMsg.Err(errCode, errMsg))
return return