1
This commit is contained in:
parent
7927a484c4
commit
79cd9b8290
@ -98,6 +98,7 @@ type GuildMgr interface {
|
|||||||
AsyncLeave(string, func(int32, string, []string))
|
AsyncLeave(string, func(int32, string, []string))
|
||||||
AsyncKickout(string, string, func(int32, string))
|
AsyncKickout(string, string, func(int32, string))
|
||||||
AsyncDisband(string, func(int32, string, []string))
|
AsyncDisband(string, func(int32, string, []string))
|
||||||
|
AsyncSetGuildJob(string, string, int32, func(int32, string))
|
||||||
AsyncSearch(string, string, func(int32, string))
|
AsyncSearch(string, string, func(int32, 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))
|
||||||
|
@ -537,6 +537,33 @@ 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)) {
|
||||||
|
guild := this.internalGetGuildByAccountId(accountId)
|
||||||
|
if guild == nil {
|
||||||
|
cb(0, "")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if !guild.isOwner(accountId) {
|
||||||
|
cb(0, "")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if guild.getMember(targetId) == nil {
|
||||||
|
cb(0, "")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
f5.NewLockAsyncTask(
|
||||||
|
[][]string{
|
||||||
|
{constant.GUILD_ID_LOCK_KEY, guild.guildId},
|
||||||
|
{constant.GUILD_NAME_LOCK_KEY, guild.guildName},
|
||||||
|
{constant.GUILD_MEMBER_LOCK_KEY, accountId},
|
||||||
|
{constant.GUILD_MEMBER_LOCK_KEY, targetId},
|
||||||
|
},
|
||||||
|
func (task *f5.LockAsyncTask) {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (this *guildMgr) AsyncKickout(accountId string, targetId string, cb func(int32, string)) {
|
func (this *guildMgr) AsyncKickout(accountId string, targetId string, cb func(int32, string)) {
|
||||||
guild := this.internalGetGuildByAccountId(accountId)
|
guild := this.internalGetGuildByAccountId(accountId)
|
||||||
if guild == nil {
|
if guild == nil {
|
||||||
|
@ -511,6 +511,18 @@ func (this *player) CMDismissMember(hdr *f5.MsgHdr, msg *cs.CMDismissMember) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) CMSetMemberLevel(hdr *f5.MsgHdr, msg *cs.CMSetMemberLevel) {
|
func (this *player) CMSetMemberLevel(hdr *f5.MsgHdr, msg *cs.CMSetMemberLevel) {
|
||||||
|
rspMsg := new(cs.SMSetMemberLevel)
|
||||||
|
GetGuildMgr().AsyncSetGuildJob(
|
||||||
|
this.GetAccountId(),
|
||||||
|
msg.GetMemberAccountId(),
|
||||||
|
msg.GetMemberLevel(),
|
||||||
|
func (errCode int32, errMsg string) {
|
||||||
|
if errCode != 0 {
|
||||||
|
this.SendMsg(rspMsg.Err(errCode, errMsg))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.SendMsg(rspMsg)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) CMDisband(hdr *f5.MsgHdr, msg *cs.CMDisband) {
|
func (this *player) CMDisband(hdr *f5.MsgHdr, msg *cs.CMDisband) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user