db

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxLockAliveTime  = 0  // 单个锁的最大存活时间 毫秒
	LockRetryWaitTime = 50 // 同步加锁重试间隔时间 毫秒
	MaxLockRetryTimes = 2  // 同步加锁最大重试次数
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	PlayerDataMysql      *gorm.DB
	ServerConf           *gorm.DB
	LoginRedis           *redis.Client
	StatusRedis          *redis.Client
	PlayerBriefDataRedis *redis.Client // 玩家简要信息
	// contains filtered or unexported fields
}
var Db *Store

func GetDb added in v1.2.2

func GetDb() *Store

func NewStore

func NewStore(config *config.Config) *Store

NewStore 创建一个新的 store。

func (*Store) DistLockPlayerStatus added in v1.2.1

func (s *Store) DistLockPlayerStatus(accountId string, value []byte) bool

标记玩家状态

func (*Store) DistUnlockPlayerStatus added in v1.2.1

func (s *Store) DistUnlockPlayerStatus(accountId string)

删除玩家状态

func (*Store) GetPlayerPlayerBasicBriefData added in v1.2.1

func (s *Store) GetPlayerPlayerBasicBriefData(uid uint32) ([]byte, bool)

func (*Store) GetPlayerStatus added in v1.0.5

func (s *Store) GetPlayerStatus(accountId string) ([]byte, bool)

获取玩家状态

func (*Store) SetPlayerPlayerBasicBriefData added in v1.2.1

func (s *Store) SetPlayerPlayerBasicBriefData(uid uint32, value []byte) bool

Jump to

Keyboard shortcuts

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