database

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MailAvatar   = 1 // 角色
	MailMaterial = 2 // 材料
)

邮件奖励类型

Variables

This section is empty.

Functions

func DelAcceptApplyFriend added in v1.2.2

func DelAcceptApplyFriend(rc *redis.Client, uid uint32)

删除玩家待加入数据库好友信息

func GetAcceptApplyFriend added in v1.2.2

func GetAcceptApplyFriend(rc *redis.Client, uid uint32) ([]byte, bool)

获取玩家待加入数据库好友信息

func GetPlayerFriend added in v1.2.2

func GetPlayerFriend(rc *redis.Client, uid uint32) ([]byte, bool)

获取玩家好友申请信息

func NewMysql

func NewMysql(dsn string) *gorm.DB

func NewRedis

func NewRedis(addr, password string, db int) *redis.Client

func SetAcceptApplyFriend added in v1.2.2

func SetAcceptApplyFriend(rc *redis.Client, uid uint32, value []byte) bool

设置玩家待加入数据库好友信息

func SetPlayerFriend added in v1.2.2

func SetPlayerFriend(rc *redis.Client, uid uint32, value []byte) bool

设置玩家好友申请信息

Types

type Account

type Account struct {
	AccountId  uint `gorm:"primarykey;AUTO_INCREMENT"`
	Username   string
	Token      string
	CreateTime int64
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type BlockData added in v1.2.2

type BlockData struct {
	Uid         uint32 `gorm:"primaryKey"`
	EntryId     uint32 `gorm:"primaryKey"`
	DataVersion uint32
	BinData     []byte
}

type Item added in v1.2.2

type Item struct {
	ItemType uint32 // 类型
	ItemId   uint32 // id
	Num      uint32 // 数量
}

type Mail

type Mail struct {
	Id        uint32       `gorm:"primarykey;AUTO_INCREMENT"` // 邮件id
	Title     string       // 邮件标题
	Sender    string       // 发件人
	BeginTime sql.NullTime // 开始时间
	EndTime   sql.NullTime // 结束时间
	Content   string       // 内容
	Item      string       // 邮件附件
	ItemList  []*Item      `gorm:"-"`
}

全服邮件

type PlayerData

type PlayerData struct {
	Uid         uint32 `gorm:"primarykey"`
	Nickname    string
	Level       uint32
	Exp         uint32
	DataVersion uint32
	BinData     []byte
}

type PlayerUid

type PlayerUid struct {
	Uid          uint32 `gorm:"primarykey;AUTO_INCREMENT"`
	AccountType  uint32
	AccountId    uint32
	CreateTime   int64
	IsBan        bool
	BanBeginTime int64
	BanEndTime   int64
	BanMsg       string
}

type ServerConf added in v1.2.2

type ServerConf struct {
	AutoCreate bool // 是否自动注册
}

Jump to

Keyboard shortcuts

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