1
This commit is contained in:
parent
e97e155c80
commit
1169662eac
@ -111,6 +111,6 @@ type DbLogMgr interface {
|
|||||||
FriendAdd(string, string)
|
FriendAdd(string, string)
|
||||||
FriendDel(string, string)
|
FriendDel(string, string)
|
||||||
|
|
||||||
GuildClearEmptyStart(string)
|
GuildClearEmptyStart(string, string)
|
||||||
GuildClearEmptyEnd(string)
|
GuildClearEmptyEnd(string, string)
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ import (
|
|||||||
type guild struct {
|
type guild struct {
|
||||||
guildId string
|
guildId string
|
||||||
guildName string
|
guildName string
|
||||||
ownerId string
|
|
||||||
creatorId string
|
creatorId string
|
||||||
badge int32
|
badge int32
|
||||||
notice string
|
notice string
|
||||||
@ -40,7 +39,6 @@ func (this *guild) GetMemberNum() int32 {
|
|||||||
func (this *guild) loadFromDb(ds *f5.DataSet) {
|
func (this *guild) loadFromDb(ds *f5.DataSet) {
|
||||||
this.guildId = ds.GetByName("guild_id")
|
this.guildId = ds.GetByName("guild_id")
|
||||||
this.guildName = ds.GetByName("guild_name")
|
this.guildName = ds.GetByName("guild_name")
|
||||||
this.ownerId = ds.GetByName("owner_id")
|
|
||||||
this.creatorId = ds.GetByName("creator_id")
|
this.creatorId = ds.GetByName("creator_id")
|
||||||
this.badge = q5.ToInt32(ds.GetByName("badge"))
|
this.badge = q5.ToInt32(ds.GetByName("badge"))
|
||||||
this.notice = ds.GetByName("notice")
|
this.notice = ds.GetByName("notice")
|
||||||
@ -135,7 +133,7 @@ func (this *guild) AsyncFillMFGuild(pbGuild *cs.MFGuild, cb func(int32, string))
|
|||||||
pbGuild.AutoId = proto.Int64(0)
|
pbGuild.AutoId = proto.Int64(0)
|
||||||
pbGuild.GuildId = proto.Int64(q5.ToInt64(this.guildId))
|
pbGuild.GuildId = proto.Int64(q5.ToInt64(this.guildId))
|
||||||
pbGuild.Name = proto.String(this.guildName)
|
pbGuild.Name = proto.String(this.guildName)
|
||||||
pbGuild.LeaderId = proto.String(this.ownerId)
|
pbGuild.LeaderId = proto.String(this.getOwnerId())
|
||||||
pbGuild.Avatar = proto.Int32(this.badge)
|
pbGuild.Avatar = proto.Int32(this.badge)
|
||||||
pbGuild.Notice = proto.String(this.notice)
|
pbGuild.Notice = proto.String(this.notice)
|
||||||
pbGuild.JoinCond = proto.Int32(this.joinCondType)
|
pbGuild.JoinCond = proto.Int32(this.joinCondType)
|
||||||
@ -257,12 +255,16 @@ func (this *guild) asyncUpdateOwner(ownerId string, cb func(int32, string)) {
|
|||||||
cb(500, "server internal error")
|
cb(500, "server internal error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.ownerId = ownerId
|
|
||||||
cb(0, "")
|
cb(0, "")
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *guild) getOwnerId() string {
|
||||||
|
ownerId := ""
|
||||||
|
return ownerId
|
||||||
|
}
|
||||||
|
|
||||||
func newGuild() *guild {
|
func newGuild() *guild {
|
||||||
p := new(guild)
|
p := new(guild)
|
||||||
p.idHash = make(map[string]*member)
|
p.idHash = make(map[string]*member)
|
||||||
|
@ -243,7 +243,6 @@ func (this *guildMgr) asyncCreateGuildTask(task *f5.LockAsyncTask,
|
|||||||
{
|
{
|
||||||
guild.guildId = guildId
|
guild.guildId = guildId
|
||||||
guild.guildName = name
|
guild.guildName = name
|
||||||
guild.ownerId = accountId
|
|
||||||
guild.creatorId = accountId
|
guild.creatorId = accountId
|
||||||
guild.badge = avatar
|
guild.badge = avatar
|
||||||
guild.maxMemberNum = constant.GuildMaxMembers
|
guild.maxMemberNum = constant.GuildMaxMembers
|
||||||
@ -907,7 +906,7 @@ func (this *guildMgr) clearEmptyGuild() {
|
|||||||
for _, g := range(emptyGuilds) {
|
for _, g := range(emptyGuilds) {
|
||||||
delete(this.idHash, g.guildId)
|
delete(this.idHash, g.guildId)
|
||||||
delete(this.nameHash, g.guildName)
|
delete(this.nameHash, g.guildName)
|
||||||
GetDbLogMgr().GuildClearEmptyStart(g.guildId)
|
GetDbLogMgr().GuildClearEmptyStart(g.guildId, g.guildName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user