cache

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerWeight *GameDB.ServerWeightDocument
)

Functions

func Init

func Init()

func IsChange

func IsChange(doc *GameDB.ServerListDocument, info *proto.ST_Server_PB) bool

func ServerInfoDoc2PB

func ServerInfoDoc2PB(doc *GameDB.ServerListDocument) *proto.ST_Server_PB

Types

type ServerListCache

type ServerListCache struct {
	sync.RWMutex
}
var (
	ServerListCacheInstance *ServerListCache
)

func (*ServerListCache) AddServerInfo

func (this *ServerListCache) AddServerInfo(info *proto.ST_Server_PB) bool

func (*ServerListCache) ForeachServerInfo

func (this *ServerListCache) ForeachServerInfo(writeOrRead bool, callback func(info *GameDB.ServerListDocument) bool)

func (*ServerListCache) GetServerInfo

func (this *ServerListCache) GetServerInfo(sid int64) *GameDB.ServerListDocument

func (*ServerListCache) GetServerProtectTime

func (this *ServerListCache) GetServerProtectTime(sid int64) uint64

func (*ServerListCache) HasServer

func (this *ServerListCache) HasServer(sid int64) bool

func (*ServerListCache) WithServer

func (this *ServerListCache) WithServer(readOrWrite bool, sid int64, callback func(info *GameDB.ServerListDocument)) bool

Jump to

Keyboard shortcuts

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