1
This commit is contained in:
parent
f7d6bde2e4
commit
bfce47f8cc
@ -322,13 +322,28 @@ func (this *guildMgr) AsyncGetApplyList(lastIdx int64, accountId string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *guildMgr) AsyncApplyJoin(accountId string, guildId string, cb func(int32, string)) {
|
func (this *guildMgr) AsyncApplyJoin(accountId string, guildId string, cb func(int32, string)) {
|
||||||
guild := this.internalGetGuildByAccountId(accountId)
|
if this.internalGetGuildByAccountId(accountId) != nil {
|
||||||
if guild != nil {
|
|
||||||
cb(0, "")
|
cb(0, "")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
guild := this.internalGetGuildByGuildId(guildId)
|
||||||
|
if guild == nil {
|
||||||
|
cb(0, "")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nowTime := f5.GetApp().GetNowSeconds()
|
||||||
if guild.joinCondType == constant.JoinCondFree &&
|
if guild.joinCondType == constant.JoinCondFree &&
|
||||||
!guild.isFull() {
|
!guild.isFull() {
|
||||||
|
m := newMember()
|
||||||
|
m.init(guild, constant.GuildMemberLevelDefault, accountId, int32(nowTime))
|
||||||
|
guild.addMember(m)
|
||||||
|
this.addGuildMember(m)
|
||||||
|
model.GuildApply.SetStatus(guild.guildId, accountId, constant.GUILD_APPLY_STATUS_ACCEPT,
|
||||||
|
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||||
|
GetDbLogMgr().GuildAccpetApply(guild.guildId, accountId, accountId)
|
||||||
|
cb(0, "")
|
||||||
|
return
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
model.GuildApply.Force(
|
model.GuildApply.Force(
|
||||||
guildId,
|
guildId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user