1
This commit is contained in:
parent
d80ecef43d
commit
87489f09d3
@ -110,7 +110,7 @@ DROP TABLE IF EXISTS `t_guild`;
|
|||||||
CREATE TABLE `t_guild` (
|
CREATE TABLE `t_guild` (
|
||||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||||
`guild_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '公会id',
|
`guild_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '公会id',
|
||||||
`guld_name` varchar(48) NOT NULL,
|
`guild_name` varchar(48) NOT NULL,
|
||||||
`owner_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '公会长',
|
`owner_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '公会长',
|
||||||
`creator_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '公会创始人',
|
`creator_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '公会创始人',
|
||||||
`badge` int(11) DEFAULT '0' COMMENT '公会头像',
|
`badge` int(11) DEFAULT '0' COMMENT '公会头像',
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package guild
|
package guild
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"q5"
|
||||||
|
"f5"
|
||||||
)
|
)
|
||||||
|
|
||||||
type guild struct {
|
type guild struct {
|
||||||
@ -25,3 +26,17 @@ func (this *guild) GetGuildId() string {
|
|||||||
func (this *guild) GetGuildName() string {
|
func (this *guild) GetGuildName() string {
|
||||||
return this.guildName
|
return this.guildName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *guild) loadFromDb(ds *f5.DataSet) {
|
||||||
|
this.guildId = ds.GetByName("guild_id")
|
||||||
|
this.guildName = ds.GetByName("guild_name")
|
||||||
|
this.ownerId = ds.GetByName("owner_id")
|
||||||
|
this.creatorId = ds.GetByName("creator_id")
|
||||||
|
this.badge = q5.ToInt32(ds.GetByName("badge"))
|
||||||
|
this.notice = ds.GetByName("notice")
|
||||||
|
this.joinCondType = q5.ToInt32(ds.GetByName("join_cond_type"))
|
||||||
|
this.joinCondVal = q5.ToInt32(ds.GetByName("join_cond_val"))
|
||||||
|
this.maxMemberNum = q5.ToInt32(ds.GetByName("max_members"))
|
||||||
|
this.createTime = q5.ToInt32(ds.GetByName("createtime"))
|
||||||
|
this.modifyTime = q5.ToInt32(ds.GetByName("modifytime"))
|
||||||
|
}
|
||||||
|
@ -25,11 +25,36 @@ func (this *guildMgr) Init() {
|
|||||||
this.idHash = make(map[string]*guild)
|
this.idHash = make(map[string]*guild)
|
||||||
this.nameHash = make(map[string]*guild)
|
this.nameHash = make(map[string]*guild)
|
||||||
this.accountIdHash = make(map[string]*guild)
|
this.accountIdHash = make(map[string]*guild)
|
||||||
|
this.loadFromDB()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *guildMgr) UnInit() {
|
func (this *guildMgr) UnInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *guildMgr) loadFromDB() {
|
||||||
|
/*
|
||||||
|
f5.GetSysLog().Info("friendMgr.loadFriendships begin")
|
||||||
|
lastIdx := f5.GetJsStyleDb().SyncBatchLoadFullTable(
|
||||||
|
constant.FRIEND_DB,
|
||||||
|
"SELECT * FROM t_guild idx > %d AND deleted = 0",
|
||||||
|
func (ds *f5.DataSet) {
|
||||||
|
guildId := ds.GetByName("guild_id")
|
||||||
|
guildName := ds.GetByName("guild_name")
|
||||||
|
ownerId := q5.ToInt32(ds.GetByName("owner_id"))
|
||||||
|
//this.addFriendShip(accountId1, accountId2, addTime)
|
||||||
|
},
|
||||||
|
func (err error) {
|
||||||
|
panic(fmt.Sprintf("friendMgr.loadFriendships dberror:%s", err))
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
f5.GetSysLog().Info("friendMgr.loadFriendships end lastIdx:%d friendNum:%d blackNum:%d",
|
||||||
|
lastIdx,
|
||||||
|
len(this.friendHash),
|
||||||
|
len(this.blackHash))
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
func (this *guildMgr) isNameTooLong(name string, maxNum int) bool {
|
func (this *guildMgr) isNameTooLong(name string, maxNum int) bool {
|
||||||
return len(name) > maxNum
|
return len(name) > maxNum
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user