samplegame

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PlayerGameTokenPeriod int32 = 60 * 60 * 24 * 8

秒数。mongoのSetExpireAfterSeconds()に使う

Variables

View Source
var PlayerGameTokenExpiredIndex = mongo.IndexModel{
	Keys:    bson.D{{"generated_at", -1}},
	Options: options.Index().SetName("idx_expired").SetExpireAfterSeconds(PlayerGameTokenPeriod),
}
View Source
var PlayerGameTokenIndex = mongo.IndexModel{
	Keys:    bson.D{{"hayabusa_id", -1}},
	Options: options.Index().SetName("idx_hayabusa_id").SetUnique(false),
}

Functions

This section is empty.

Types

type MsgPlayer

type MsgPlayer struct {
	HayabusaID string `json:"hayabusaId"`
	Nickname   string `json:"nickName"`
	GoldNum    int    `json:"goldNum"`
}

type MsgPlayerGameToken

type MsgPlayerGameToken struct {
	AppID      string    `json:"appId"`
	ValidUntil hybs.Time `json:"validUntil"`
	Token      string    `json:"token"`
}

type Player

type Player struct {
	games.PlayerBase `bson:",inline"`
	Nickname         string `bson:"nickname"`
	GoldNum          int    `bson:"gold_num"`
}

func (*Player) ToMsg

func (p *Player) ToMsg() *MsgPlayer

type PlayerGameToken

type PlayerGameToken struct {
	HayabusaID  string    `bson:"hayabusa_id"`
	GeneratedAt hybs.Time `bson:"generated_at"`
	Token       string    `bson:"token"`
}

func (*PlayerGameToken) ToMsg

func (token *PlayerGameToken) ToMsg(appID string) *MsgPlayerGameToken

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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