1
This commit is contained in:
parent
f27e2d721e
commit
56fce60ff5
@ -187,26 +187,6 @@ func (this *guild) asyncLeave(accountId string, cb func(int32, string)) {
|
||||
})
|
||||
}
|
||||
|
||||
func (this *guild) asyncUpdateOwner(ownerId string, cb func(int32, string)) {
|
||||
f5.GetJsStyleDb().Update(
|
||||
constant.FRIEND_DB,
|
||||
"t_guild",
|
||||
[][]string{
|
||||
{"owner_id", ownerId},
|
||||
},
|
||||
[][]string{
|
||||
{"guild_id", this.guildId},
|
||||
},
|
||||
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||
if err != nil {
|
||||
cb(500, "server internal error")
|
||||
return
|
||||
}
|
||||
cb(0, "")
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
func (this *guild) getOwnerId() string {
|
||||
ownerId := ""
|
||||
this.traverseMembers(
|
||||
|
@ -486,16 +486,7 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
|
||||
{constant.GUILD_MEMBER_LOCK_KEY, targetId},
|
||||
},
|
||||
func (task *f5.LockAsyncTask) {
|
||||
f5.GetJsStyleDb().Update(
|
||||
constant.FRIEND_DB,
|
||||
"t_guild_member",
|
||||
[][]string{
|
||||
{"guild_job", q5.ToString(guildJob)},
|
||||
},
|
||||
[][]string{
|
||||
{"member_id", member.memberId},
|
||||
{"guild_id", guild.guildId},
|
||||
},
|
||||
model.GuildMember.SetJob(guild.guildId, member.memberId, guildJob,
|
||||
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||
if err != nil {
|
||||
task.SetFail()
|
||||
@ -503,17 +494,9 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
|
||||
return
|
||||
}
|
||||
member.guildJob = guildJob
|
||||
if guildJob == constant.GuildMemberLevelLeader {
|
||||
f5.GetJsStyleDb().Update(
|
||||
constant.FRIEND_DB,
|
||||
"t_guild_member",
|
||||
[][]string{
|
||||
{"guild_job", q5.ToString(constant.GuildMemberLevelDefault)},
|
||||
},
|
||||
[][]string{
|
||||
{"member_id", owner.memberId},
|
||||
{"guild_id", guild.guildId},
|
||||
},
|
||||
if member.guildJob == constant.GuildMemberLevelLeader {
|
||||
model.GuildMember.SetJob(guild.guildId, owner.memberId,
|
||||
constant.GuildMemberLevelDefault,
|
||||
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||
if err != nil {
|
||||
task.SetFail()
|
||||
@ -521,17 +504,9 @@ func (this *guildMgr) AsyncSetGuildJob(accountId string, targetId string, guildJ
|
||||
return
|
||||
}
|
||||
owner.guildJob = constant.GuildMemberLevelDefault
|
||||
guild.asyncUpdateOwner(member.memberId,
|
||||
func (errCode int32, errMsg string) {
|
||||
if err != nil {
|
||||
task.SetFail()
|
||||
cb(500, "")
|
||||
return
|
||||
}
|
||||
task.SetSucc()
|
||||
cb(0, "")
|
||||
})
|
||||
})
|
||||
} else {
|
||||
task.SetSucc()
|
||||
cb(0, "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user