This commit is contained in:
aozhiwei 2024-04-12 11:27:50 +08:00
parent 65a440d178
commit fd036ffba0
2 changed files with 12 additions and 4 deletions

View File

@ -544,11 +544,13 @@ func (this *guildMgr) AsyncKickout(accountId string, targetId string, cb func(in
model.GuildMember.DeleteSoft(guild.guildId, targetId, model.GuildMember.DeleteSoft(guild.guildId, targetId,
func (err error, lastInsertId int64, rowsAffected int64) { func (err error, lastInsertId int64, rowsAffected int64) {
if err != nil { if err != nil {
task.SetFail()
cb(500, "server internal error") cb(500, "server internal error")
return return
} }
guild.delMember(targetId) guild.delMember(targetId)
this.delGuildMember(targetId) this.delGuildMember(targetId)
task.SetSucc()
cb(0, "") cb(0, "")
}) })
}) })
@ -594,8 +596,8 @@ func (this *guildMgr) AsyncDisband(accountId string, cb func(int32, string, []st
return return
} }
guild.disband() guild.disband()
task.SetSucc()
guild.disband() guild.disband()
task.SetSucc()
cb(0, "", members) cb(0, "", members)
}) })
} }

View File

@ -173,15 +173,17 @@ func (this *player) CMAcceptFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAcceptFriend
{constant.MEMBER_LOCK_KEY, this.GetAccountId()}, {constant.MEMBER_LOCK_KEY, this.GetAccountId()},
{constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()}, {constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()},
}, },
func (cb *f5.LockAsyncTask) { func (task *f5.LockAsyncTask) {
GetFriendMgr().AsyncAcceptApply( GetFriendMgr().AsyncAcceptApply(
this.GetAccountId(), this.GetAccountId(),
msg.GetTargetAccountId(), msg.GetTargetAccountId(),
func (errCode int32, errMsg string) { func (errCode int32, errMsg string) {
if errCode != 0 { if errCode != 0 {
task.SetFail()
this.SendMsg(rspMsg.Err(500, "server internal error")) this.SendMsg(rspMsg.Err(500, "server internal error"))
return return
} }
task.SetSucc()
this.SendMsg(rspMsg) this.SendMsg(rspMsg)
}) })
}) })
@ -220,15 +222,17 @@ func (this *player) CMRejectFriendRequest(hdr *f5.MsgHdr, msg *cs.CMRejectFriend
{constant.MEMBER_LOCK_KEY, this.GetAccountId()}, {constant.MEMBER_LOCK_KEY, this.GetAccountId()},
{constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()}, {constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()},
}, },
func (cb *f5.LockAsyncTask) { func (task *f5.LockAsyncTask) {
GetFriendMgr().AsyncRejectApply( GetFriendMgr().AsyncRejectApply(
this.GetAccountId(), this.GetAccountId(),
msg.GetTargetAccountId(), msg.GetTargetAccountId(),
func (errCode int32, errMsg string) { func (errCode int32, errMsg string) {
if errCode != 0 { if errCode != 0 {
task.SetFail()
this.SendMsg(rspMsg.Err(500, "server internal error")) this.SendMsg(rspMsg.Err(500, "server internal error"))
return return
} }
task.SetSucc()
this.SendMsg(rspMsg) this.SendMsg(rspMsg)
}) })
}) })
@ -299,15 +303,17 @@ func (this *player) CMRemoveBlacklist(hdr *f5.MsgHdr, msg *cs.CMRemoveBlacklist)
{constant.MEMBER_LOCK_KEY, this.GetAccountId()}, {constant.MEMBER_LOCK_KEY, this.GetAccountId()},
{constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()}, {constant.MEMBER_LOCK_KEY, msg.GetTargetAccountId()},
}, },
func (cb *f5.LockAsyncTask) { func (task *f5.LockAsyncTask) {
GetFriendMgr().AsyncRemoveBlack( GetFriendMgr().AsyncRemoveBlack(
this.GetAccountId(), this.GetAccountId(),
msg.GetTargetAccountId(), msg.GetTargetAccountId(),
func (errCode int32, errMsg string) { func (errCode int32, errMsg string) {
if errCode != 0 { if errCode != 0 {
task.SetFail()
this.SendMsg(rspMsg.Err(500, "server internal error")) this.SendMsg(rspMsg.Err(500, "server internal error"))
return return
} }
task.SetSucc()
this.SendMsg(rspMsg) this.SendMsg(rspMsg)
}) })
}) })