player

package
v1.1.47 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModificationDate OrderColumnType    = "modification_date"
	Name             OrderColumnType    = "name"
	Ascending        OrderDirectionType = "asc"
	Descending       OrderDirectionType = "desc"
)

Variables

This section is empty.

Functions

func MigratePlayerDB

func MigratePlayerDB(db *sql.DB, dbtype types.DatabaseType) error

Types

type OrderColumnType added in v1.1.44

type OrderColumnType string

type OrderDirectionType added in v1.1.44

type OrderDirectionType string

type Player

type Player struct {
	Name             string  `json:"name"`
	Pitch            float64 `json:"pitch"`
	Yaw              float64 `json:"yaw"`
	PosX             float64 `json:"posx"`
	PosY             float64 `json:"posy"`
	PosZ             float64 `json:"posz"`
	HP               int     `json:"hp"`
	Breath           int     `json:"breath"`
	CreationDate     int64   `json:"creation_date"`     // unix seconds
	ModificationDate int64   `json:"modification_date"` // unix seconds
}

type PlayerInventories

type PlayerInventories struct {
	Player   string `json:"player"`
	InvID    int    `json:"inv_id"`
	InvWidth int    `json:"inv_width"`
	InvName  string `json:"inv_name"`
	InvSize  int    `json:"inv_size"`
}

type PlayerInventoryItems

type PlayerInventoryItems struct {
	Player string `json:"player"`
	InvID  int    `json:"inv_id"`
	SlotID int    `json:"slot_id"`
	Item   string `json:"item"`
}

type PlayerMetadata

type PlayerMetadata struct {
	Player   string `json:"player"`
	Metadata string `json:"metadata"`
	Value    string `json:"value"`
}

type PlayerMetadataRepository added in v1.1.27

type PlayerMetadataRepository struct {
	// contains filtered or unexported fields
}

func NewPlayerMetadataRepository added in v1.1.27

func NewPlayerMetadataRepository(db *sql.DB, dbtype types.DatabaseType) *PlayerMetadataRepository

func (*PlayerMetadataRepository) Export added in v1.1.39

func (r *PlayerMetadataRepository) Export(z *zip.Writer) error

func (*PlayerMetadataRepository) GetPlayerMetadata added in v1.1.27

func (r *PlayerMetadataRepository) GetPlayerMetadata(name string) ([]*PlayerMetadata, error)

func (*PlayerMetadataRepository) Import added in v1.1.39

func (r *PlayerMetadataRepository) Import(z *zip.Reader) error

func (*PlayerMetadataRepository) SetPlayerMetadata added in v1.1.27

func (r *PlayerMetadataRepository) SetPlayerMetadata(md *PlayerMetadata) error

type PlayerRepository

type PlayerRepository struct {
	// contains filtered or unexported fields
}

func NewPlayerRepository

func NewPlayerRepository(db *sql.DB, dbtype types.DatabaseType) *PlayerRepository

func (*PlayerRepository) Count added in v1.1.42

func (repo *PlayerRepository) Count(s *PlayerSearch) (int, error)

func (*PlayerRepository) CreateOrUpdate added in v1.1.27

func (r *PlayerRepository) CreateOrUpdate(p *Player) error

func (*PlayerRepository) Export added in v1.1.39

func (r *PlayerRepository) Export(z *zip.Writer) error

func (*PlayerRepository) GetPlayer

func (r *PlayerRepository) GetPlayer(name string) (*Player, error)

func (*PlayerRepository) Import added in v1.1.39

func (r *PlayerRepository) Import(z *zip.Reader) error

func (*PlayerRepository) RemovePlayer added in v1.1.27

func (r *PlayerRepository) RemovePlayer(name string) error

func (*PlayerRepository) Search added in v1.1.44

func (repo *PlayerRepository) Search(s *PlayerSearch) ([]*Player, error)

type PlayerSearch added in v1.1.44

type PlayerSearch struct {
	Namelike       *string             `json:"namelike"`
	Name           *string             `json:"name"`
	Limit          *int                `json:"limit"`
	OrderColumn    *OrderColumnType    `json:"order_column"`
	OrderDirection *OrderDirectionType `json:"order_direction"`
}

Jump to

Keyboard shortcuts

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