Documentation ¶
Index ¶
- Constants
- Variables
- func AddAccountFieldByFieldName(db *gorm.DB, account *constant.Account) (uint32, error)
- func AddPlayerDataByUid(db *gorm.DB, player *constant.PlayerData) error
- func AddPlayerStatus(rc *redis.Client, uid uint32, value []byte) bool
- func AddPlayerUidByAccountId(db *gorm.DB, AccountId uint32) *constant.PlayerUid
- func DelAcceptApplyFriend(rc *redis.Client, db *gorm.DB, uid uint32)
- func DelPlayerStatus(rc *redis.Client, uid uint32)
- func GetAcceptApplyFriend(rc *redis.Client, db *gorm.DB, uid uint32) ([]byte, bool)
- func GetAccountByFieldAccountId(db *gorm.DB, AccountId uint32) *constant.Account
- func GetAllPlayerMail(rc *redis.Client, dsn *gorm.DB, uid uint32) map[uint32]*constant.Mail
- func GetAllRegionConf(db *gorm.DB) []*constant.RegionConf
- func GetAllRogue(db *gorm.DB) []*constant.RogueConf
- func GetApplyFriend(rc *redis.Client, db *gorm.DB, uid uint32) ([]byte, bool)
- func GetBlockData(db *gorm.DB, uid, entryId uint32) *constant.BlockData
- func GetComboTokenByAccountId(rc *redis.Client, db *gorm.DB, accountId uint32) string
- func GetDbAllMail(db *gorm.DB) []*constant.Mail
- func GetPlayerBasic(rc *redis.Client, db *gorm.DB, uid uint32) ([]byte, bool)
- func GetPlayerDataByUid(db *gorm.DB, uid uint32) *constant.PlayerData
- func GetPlayerStatus(rc *redis.Client, uid uint32) ([]byte, bool)
- func GetPlayerUidByAccountId(db *gorm.DB, AccountId uint32) *constant.PlayerUid
- func GetRegionConf(db *gorm.DB, regionName string) (*constant.RegionConf, error)
- func LoginDistLockSync(rc *redis.Client, accountId string) bool
- func LoginDistUnlock(rc *redis.Client, accountId string)
- func NewGameStore(mysqlList map[string]constant.MysqlConf, ...)
- func NewGateStore(mysqlList map[string]constant.MysqlConf, ...)
- func NewMysql(dsn string) *gorm.DB
- func NewNodeStore(mysqlList map[string]constant.MysqlConf, ...)
- func NewPE(dsn string)
- func NewRedis(addr, password string, db int) *redis.Client
- func NewSqlite(dsn string) *gorm.DB
- func QueryAccountByFieldUsername(db *gorm.DB, Username string) *constant.Account
- func SetAcceptApplyFriend(rc *redis.Client, uid uint32, value []byte) bool
- func SetPlayerFriend(rc *redis.Client, uid uint32, value []byte) bool
- func SetRegionConf(db *gorm.DB, regionConf *constant.RegionConf) error
- func UpComboTokenByAccountId(rc *redis.Client, db *gorm.DB, accountId uint32, comboToken string)
- func UpPlayerDataByUid(db *gorm.DB, player *constant.PlayerData) error
- func UpdateAccountFieldByFieldName(db *gorm.DB, account *constant.Account) error
- func UpdateBlockData(db *gorm.DB, blockData *constant.BlockData) error
- func UpdatePlayerBasic(rc *redis.Client, db *gorm.DB, basic *constant.PlayerBasic) bool
- func UpdatePlayerUid(db *gorm.DB, playerUid *constant.PlayerUid) error
- type DisaptchStore
- type GameStore
- type GateStore
Constants ¶
View Source
const ( PlayerStatusMaxLockAliveTime = 600 // 玩家状态锁最大存活时间 秒 MaxLockAliveTime = 10000 // 单个锁的最大存活时间 毫秒 LockRetryWaitTime = 50 // 同步加锁重试间隔时间 毫秒 MaxLockRetryTimes = 2 // 同步加锁最大重试次数 )
Variables ¶
View Source
var NODE *nodeStore
View Source
var PE *gorm.DB
View Source
var PlayerMailId uint32 = 100000000 // 玩家邮件ID基数
Functions ¶
func AddAccountFieldByFieldName ¶ added in v1.3.0
添加新账号
func AddPlayerDataByUid ¶ added in v1.5.0
func AddPlayerDataByUid(db *gorm.DB, player *constant.PlayerData) error
添加新账号数据
func AddPlayerStatus ¶ added in v1.5.0
标记玩家状态
func AddPlayerUidByAccountId ¶ added in v1.5.0
指定account id 创建数据
func DelAcceptApplyFriend ¶ added in v1.2.2
删除待加入好友
func GetAcceptApplyFriend ¶ added in v1.2.2
获取待加入好友
func GetAccountByFieldAccountId ¶ added in v1.5.0
func GetAllPlayerMail ¶ added in v1.5.0
获取玩家邮件
func GetAllRegionConf ¶ added in v1.5.0
func GetAllRegionConf(db *gorm.DB) []*constant.RegionConf
拉取全部区服配置
func GetApplyFriend ¶ added in v1.5.0
获取好友申请
func GetBlockData ¶ added in v1.3.0
拉取地图文件
func GetComboTokenByAccountId ¶ added in v1.3.0
func GetPlayerBasic ¶ added in v1.5.0
获取账号简要数据
func GetPlayerDataByUid ¶ added in v1.5.0
func GetPlayerDataByUid(db *gorm.DB, uid uint32) *constant.PlayerData
使用账号id拉取数据
func GetPlayerStatus ¶ added in v1.5.0
获取玩家状态
func GetPlayerUidByAccountId ¶ added in v1.3.0
使用account id拉取数据
func GetRegionConf ¶ added in v1.5.0
拉取区服配置
func LoginDistLockSync ¶ added in v1.5.0
DistLockSync 加锁同步阻塞直到成功或超时
func LoginDistUnlock ¶ added in v1.5.0
func LoginDistUnlock(rc *redis.Client, accountId string)
DistUnlock 解锁
func NewGameStore ¶ added in v1.5.0
func NewGateStore ¶ added in v1.5.0
func NewNodeStore ¶ added in v1.5.0
func QueryAccountByFieldUsername ¶ added in v1.3.0
查询账号
func SetAcceptApplyFriend ¶ added in v1.2.2
设置玩家待加入数据库好友信息
func SetPlayerFriend ¶ added in v1.2.2
设置玩家好友申请信息
func SetRegionConf ¶ added in v1.5.0
func SetRegionConf(db *gorm.DB, regionConf *constant.RegionConf) error
设置区服数据
func UpComboTokenByAccountId ¶ added in v1.5.0
func UpPlayerDataByUid ¶ added in v1.5.0
func UpPlayerDataByUid(db *gorm.DB, player *constant.PlayerData) error
func UpdateAccountFieldByFieldName ¶ added in v1.3.0
更新账号
func UpdateBlockData ¶ added in v1.3.0
更新地图文件
func UpdatePlayerBasic ¶ added in v1.3.0
func UpdatePlayerBasic(rc *redis.Client, db *gorm.DB, basic *constant.PlayerBasic) bool
更新账号简要数据
Types ¶
type DisaptchStore ¶ added in v1.5.0
var DISPATCH *DisaptchStore
func NewDisaptchStore ¶ added in v1.5.0
Click to show internal directories.
Click to hide internal directories.