1
This commit is contained in:
parent
a376e6a56c
commit
70ee014252
@ -76,6 +76,22 @@ func (this *guild) isOwner(accountId string) bool {
|
|||||||
return this.ownerId == accountId
|
return this.ownerId == accountId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *guild) updateByKv(kv map[int32]string) {
|
||||||
|
for k, v := range(kv) {
|
||||||
|
if k == constant.GUILD_UPDATE_FIELD_NOTICE {
|
||||||
|
this.notice = v
|
||||||
|
} else if k == constant.GUILD_UPDATE_FIELD_AVATAR {
|
||||||
|
this.badge = q5.ToInt32(v)
|
||||||
|
} else if k == constant.GUILD_UPDATE_FIELD_NAME {
|
||||||
|
this.guildName = v
|
||||||
|
} else if k == constant.GUILD_UPDATE_FIELD_COND_TYPE {
|
||||||
|
this.joinCondType = q5.ToInt32(v)
|
||||||
|
} else if k == constant.GUILD_UPDATE_FIELD_COND_VALUE {
|
||||||
|
this.joinCondVal = q5.ToInt32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (this *guild) disband() {
|
func (this *guild) disband() {
|
||||||
{
|
{
|
||||||
f5.GetJsStyleDb().Update(
|
f5.GetJsStyleDb().Update(
|
||||||
|
@ -600,6 +600,7 @@ func (this *guildMgr) AsyncUpdateGuild(accountId string, kv map[int32]string, cb
|
|||||||
cb(2, "Insufficient permissions")
|
cb(2, "Insufficient permissions")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
guildName := f5.GetApp().NewGlobalUuid()
|
||||||
if name, ok := kv[constant.GUILD_UPDATE_FIELD_NAME]; ok {
|
if name, ok := kv[constant.GUILD_UPDATE_FIELD_NAME]; ok {
|
||||||
if this.internalGetGuildByGuildName(name) != nil {
|
if this.internalGetGuildByGuildName(name) != nil {
|
||||||
cb(4, "Cube name already exists")
|
cb(4, "Cube name already exists")
|
||||||
@ -610,10 +611,12 @@ func (this *guildMgr) AsyncUpdateGuild(accountId string, kv map[int32]string, cb
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.addUsingName(name)
|
this.addUsingName(name)
|
||||||
|
guildName = name
|
||||||
}
|
}
|
||||||
f5.NewLockAsyncTask([][]string{
|
f5.NewLockAsyncTask([][]string{
|
||||||
{constant.GUILD_ID_LOCK_KEY, guild.guildId},
|
{constant.GUILD_ID_LOCK_KEY, guild.guildId},
|
||||||
{constant.GUILD_NAME_LOCK_KEY, guild.guildName},
|
{constant.GUILD_NAME_LOCK_KEY, guild.guildName},
|
||||||
|
{constant.GUILD_NAME_LOCK_KEY, guildName},
|
||||||
{constant.GUILD_MEMBER_LOCK_KEY, accountId},
|
{constant.GUILD_MEMBER_LOCK_KEY, accountId},
|
||||||
},
|
},
|
||||||
func (task *f5.LockAsyncTask) {
|
func (task *f5.LockAsyncTask) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user