1
This commit is contained in:
parent
702e9720b1
commit
11b1482cec
@ -68,7 +68,7 @@ type FriendMgr interface {
|
||||
}
|
||||
|
||||
type Guild interface {
|
||||
GetGuildId() int64
|
||||
GetGuildId() string
|
||||
}
|
||||
|
||||
type GuildMember interface {
|
||||
|
@ -5,4 +5,19 @@ import (
|
||||
)
|
||||
|
||||
type guild struct {
|
||||
guildId string
|
||||
guildName string
|
||||
ownerId string
|
||||
creatorId string
|
||||
badge int32
|
||||
notice string
|
||||
joinCondType int32
|
||||
joinCondVal int32
|
||||
maxMemberNum int32
|
||||
createTime int32
|
||||
modifyTime int32
|
||||
}
|
||||
|
||||
func (this *guild) GetGuildId() string {
|
||||
return this.guildId
|
||||
}
|
||||
|
@ -12,14 +12,15 @@ const (
|
||||
)
|
||||
|
||||
type guildMgr struct {
|
||||
/*
|
||||
guilds map[int64]*Guild // 公会ID -> 公会
|
||||
guildLogs map[int64][]*GuildLog // 公会ID -> []公会日志列表
|
||||
userGuilds map[string]int64 // accountId -> 公会ID
|
||||
loadedFlags int64*/
|
||||
idHash map[string]*guild
|
||||
nameHash map[string]*guild
|
||||
accountIdHash map[string]*guild
|
||||
}
|
||||
|
||||
func (this *guildMgr) Init() {
|
||||
this.idHash = make(map[string]*guild)
|
||||
this.nameHash = make(map[string]*guild)
|
||||
this.accountIdHash = make(map[string]*guild)
|
||||
}
|
||||
|
||||
func (this *guildMgr) UnInit() {
|
||||
@ -29,7 +30,10 @@ func (this *guildMgr) isNameTooLong(name string, maxNum int) bool {
|
||||
return len(name) > maxNum
|
||||
}
|
||||
|
||||
func (this *guildMgr) GetGuildByAccountId(string) common.Guild {
|
||||
func (this *guildMgr) GetGuildByAccountId(accountId string) common.Guild {
|
||||
if guild, ok := this.accountIdHash[accountId]; ok {
|
||||
return guild
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user