1
This commit is contained in:
parent
6463fa8850
commit
aba2372e43
@ -94,7 +94,7 @@ type GuildMgr interface {
|
||||
AsyncLeave(string, func(int32, string, []string))
|
||||
AsyncKickout(string, string, func(int32, string, 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))
|
||||
AsyncGetGuildLogs(string, string, func(int32, string))
|
||||
AsyncUpdateGuild(string, map[int32]string, func(int32, string))
|
||||
|
@ -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,
|
||||
cb func(int32, string)) {
|
||||
cb func(int32, string, string, string)) {
|
||||
if accountId == targetId {
|
||||
cb(0, "")
|
||||
cb(0, "", "", "")
|
||||
return
|
||||
}
|
||||
guild := this.internalGetGuildByAccountId(accountId)
|
||||
if guild == nil {
|
||||
cb(0, "")
|
||||
cb(0, "", "", "")
|
||||
return
|
||||
}
|
||||
if !this.isValidGuildJob(guildJob) {
|
||||
cb(1, "params error")
|
||||
cb(1, "params error", "", "")
|
||||
return
|
||||
}
|
||||
if !guild.isOwner(accountId) {
|
||||
cb(0, "")
|
||||
cb(0, "", "", "")
|
||||
return;
|
||||
}
|
||||
owner := guild.getMember(accountId)
|
||||
if owner == nil {
|
||||
cb(0, "")
|
||||
cb(0, "", "", "")
|
||||
return;
|
||||
}
|
||||
member := guild.getMember(targetId)
|
||||
if member == nil {
|
||||
cb(0, "")
|
||||
cb(0, "", "", "")
|
||||
return;
|
||||
}
|
||||
f5.NewLockAsyncTask(
|
||||
@ -493,7 +493,7 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
|
||||
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||
if err != nil {
|
||||
task.SetFail()
|
||||
cb(500, "")
|
||||
cb(500, "", "", "")
|
||||
return
|
||||
}
|
||||
member.guildJob = guildJob
|
||||
@ -503,16 +503,16 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
|
||||
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||
if err != nil {
|
||||
task.SetFail()
|
||||
cb(500, "")
|
||||
cb(500, "", "", "")
|
||||
return
|
||||
}
|
||||
owner.guildJob = constant.GuildMemberLevelDefault
|
||||
task.SetSucc()
|
||||
cb(0, "")
|
||||
cb(0, "", guild.guildId, guild.guildName)
|
||||
})
|
||||
} else {
|
||||
task.SetSucc()
|
||||
cb(0, "")
|
||||
cb(0, "", guild.guildId, guild.guildName)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -613,7 +613,7 @@ func (this *player) CMSetMemberLevel(hdr *f5.MsgHdr, msg *cs.CMSetMemberLevel) {
|
||||
this.GetAccountId(),
|
||||
msg.GetMemberAccountId(),
|
||||
msg.GetMemberLevel(),
|
||||
func (errCode int32, errMsg string) {
|
||||
func (errCode int32, errMsg string, guildId string, guildName string) {
|
||||
if errCode != 0 {
|
||||
this.SendMsg(rspMsg.Err(errCode, errMsg))
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user