GameDB

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerListCollectionName         = "server_list"
	ServerWeightCollectionName       = "server_weight"
	BlackListCollectionName          = "black_list"
	WhiteListCollectionName          = "white_list"
	GameServerSessionCollectionName  = "gs_session"
	UserServerCollectionName         = "uid_sid"
	LuckyStarCollectionName          = "lucky_star"
	TransferBattleCollectionName     = "transferbattle"
	StrongestCommanderCollectionName = "strongest_commander"
)

Variables

This section is empty.

Functions

func Init

func Init()

Types

type ConfigDocument

type ConfigDocument struct {
	Id       uint64 "_id"
	ServerId uint32 "server_id"
}

配置

type DBObject

type DBObject struct {
	// contains filtered or unexported fields
}

数据库父类

type GamServerSessionDocument

type GamServerSessionDocument struct {
	Sid        int64     "_id"
	ExpireTime time.Time "expire_time"
	IP         string    "ip"
	Port       string    "port"
}

GameServerSession

type GamServerSessionObject

type GamServerSessionObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	GamServerSession *GamServerSessionObject
)

func (*GamServerSessionObject) ForEach

func (object *GamServerSessionObject) ForEach(callback func(document *GamServerSessionDocument))

迭代名单

func (*GamServerSessionObject) GetById

* @brief 通过id获取

func (*GamServerSessionObject) Init

func (object *GamServerSessionObject) Init(dbName, collectionName string)

* @brief 初始化

func (*GamServerSessionObject) UpsertWithId

func (object *GamServerSessionObject) UpsertWithId(id int64, update interface{}) error

更新

type IdDocument

type IdDocument struct {
	Id     uint64 "_id"
	NextId uint32 "next_id"
}

id

type ListDocument

type ListDocument struct {
	ID    string "_id"
	Value string "value"
}

type ListObject

type ListObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	BlackListObject *ListObject
	WhiteListObject *ListObject
)

func (*ListObject) Init

func (object *ListObject) Init(dbName, collectionName string)

* @brief 初始化

func (*ListObject) IsInList

func (object *ListObject) IsInList(value string) bool

func (*ListObject) RemoveAll

func (object *ListObject) RemoveAll() error

func (*ListObject) RemoveById

func (object *ListObject) RemoveById(id string) error

func (*ListObject) UpsertListWithId

func (object *ListObject) UpsertListWithId(id string, update interface{}) error

更新

type LuckyStarDocument

type LuckyStarDocument struct {
	SID  uint64 "_id"
	Data []byte "data"
}

type LuckyStarObject

type LuckyStarObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	LuckyStarDBObject *LuckyStarObject
)

func (*LuckyStarObject) GetById

func (object *LuckyStarObject) GetById(id int64) (error, *LuckyStarDocument)

func (*LuckyStarObject) Init

func (object *LuckyStarObject) Init(dbName, collectionName string)

* @brief 初始化

func (*LuckyStarObject) UpsertWithId

func (object *LuckyStarObject) UpsertWithId(id int64, update interface{}) error

更新

type SCNumDocument

type SCNumDocument struct {
	ID     uint32 "_id"
	NextId uint32 "next_id"
}

type ServerListDocument

type ServerListDocument struct {
	ID               int64  "_id"
	SName            string "sname"
	KingLeague       string "king_league"
	King             string "king"
	ServerInitTime   uint64 "protect_time"
	Status           int32  "status"
	WhiteList        int32  "white_list"
	SAddr            string "saddr"
	KingServerName   string "kingservername"
	KingLeagueSlogan string "kingleagueslogan"
	CanMoveIn        bool   "canmovein"
	RpcAddr          string "rpcaddr"
	StarPioneerPower uint64 "star_pioneer_power"
	StarPioneerRank  int32  "star_pioneer_rank"
	PowerLimit       int32  "power_limit"
	KingSid          uint32 "king_sid"
}

type ServerListObject

type ServerListObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	ServerListDBObject *ServerListObject
)

func (*ServerListObject) ForEach

func (object *ServerListObject) ForEach(callback func(document *ServerListDocument))

迭代服务器

func (*ServerListObject) GetServerInfo

func (object *ServerListObject) GetServerInfo(sid int64) *ServerListDocument

func (*ServerListObject) Init

func (object *ServerListObject) Init(dbName, collectionName string)

* @brief 初始化

func (*ServerListObject) UpsertServerInfoWithId

func (object *ServerListObject) UpsertServerInfoWithId(id int64, update interface{}) error

更新

type ServerWeight

type ServerWeight struct {
	SID    int64 "sid"
	Weight int64 "weight"
}

type ServerWeightDocument

type ServerWeightDocument struct {
	ID    uint64         "_id"
	Array []ServerWeight "weight_array"
}

type ServerWeightObject

type ServerWeightObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	ServerWeightObjectInstance *ServerWeightObject
)

func (*ServerWeightObject) GetById

func (object *ServerWeightObject) GetById(id uint64) (error, *ServerWeightDocument)

* @brief 通过id获取

func (*ServerWeightObject) Init

func (object *ServerWeightObject) Init(dbName, collectionName string)

* @brief 初始化

func (*ServerWeightObject) UpsertWithId

func (object *ServerWeightObject) UpsertWithId(id uint64, update interface{}) error

* @brief 更新

type StrongestCommanderDocument

type StrongestCommanderDocument struct {
	ID   uint32 "_id"
	Data []byte "data"
}

type StrongestCommanderObject

type StrongestCommanderObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	StrongestCommanderDBObject *StrongestCommanderObject
)

func (*StrongestCommanderObject) ForEach

func (object *StrongestCommanderObject) ForEach(callback func(document *StrongestCommanderDocument))

迭代服务器

func (*StrongestCommanderObject) GetById

func (*StrongestCommanderObject) GetNextTBNum

func (object *StrongestCommanderObject) GetNextTBNum() (error, uint32)

得到一个新的全局的Num(直接写进数据库,然后拿出来用)

func (*StrongestCommanderObject) Init

func (object *StrongestCommanderObject) Init(dbName, collectionName string)

* @brief 初始化

func (*StrongestCommanderObject) UpsertWithId

func (object *StrongestCommanderObject) UpsertWithId(id uint32, update interface{}) error

更新

type TBNumDocument

type TBNumDocument struct {
	ID     uint32 "_id"
	NextId uint32 "next_id"
}

type TransferBattleDocument

type TransferBattleDocument struct {
	ID   uint32 "_id"
	Data []byte "data"
}

type TransferBattleObject

type TransferBattleObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	TransferBattleDBObject *TransferBattleObject
)

func (*TransferBattleObject) ForEach

func (object *TransferBattleObject) ForEach(callback func(document *TransferBattleDocument))

迭代服务器

func (*TransferBattleObject) GetById

func (object *TransferBattleObject) GetById(id uint32) (error, *TransferBattleDocument)

func (*TransferBattleObject) GetNextTBNum

func (object *TransferBattleObject) GetNextTBNum() (error, uint32)

得到一个新的全局的Num(直接写进数据库,然后拿出来用)

func (*TransferBattleObject) Init

func (object *TransferBattleObject) Init(dbName, collectionName string)

* @brief 初始化

func (*TransferBattleObject) UpsertWithId

func (object *TransferBattleObject) UpsertWithId(id uint32, update interface{}) error

更新

type UserServerDocument

type UserServerDocument struct {
	ID  uint64 "_id"
	SID int64  "sid"
}

type UserServerObject

type UserServerObject struct {
	DBObject
	// contains filtered or unexported fields
}
var (
	UserServerDBObject *UserServerObject
)

func (*UserServerObject) GetById

func (object *UserServerObject) GetById(id uint64) (error, *UserServerDocument)

func (*UserServerObject) Init

func (object *UserServerObject) Init(dbName, collectionName string)

* @brief 初始化

func (*UserServerObject) UpsertWithId

func (object *UserServerObject) UpsertWithId(id uint64, update interface{}) error

更新

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL