models

package
v0.0.0-...-bce320a Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountByName

func GetAccountByName(name string) (Account, CastroAccount, error)

GetAccountByName gets an account and its castro account by the account name

Types

type Account

type Account struct {
	ID              int64
	Name            string
	Premium_ends_at int64
	Password        string
	Email           string
	Creation        int64
	Secret          sql.NullString
}

Account struct used for tfs accounts

type Article

type Article struct {
	ID        int64
	Title     string
	Text      string `gorm:"type:text"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

Article struct used to represent castro latest news

type CastroAccount

type CastroAccount struct {
	ID        int64
	AccountID int64
	Points    int
	Admin     bool
}

CastroAccount struct used for castro custom accounts

type CsrfToken

type CsrfToken struct {
	Token string
	At    time.Time
}

CsrfToken struct used for the application XSRF tokens

type Guild

type Guild struct {
	ID           int64
	Name         string
	Ownerid      int64
	Creationdata int64
	Motd         string
}

func GetGuildByID

func GetGuildByID(id int64) (*Guild, error)

GetGuildByID retrieves a guild by its identifier

func GetGuildByName

func GetGuildByName(name string) (*Guild, error)

GetGuildByName retrieves a guild by its name

func GetGuildByPlayerID

func GetGuildByPlayerID(id int64) (*Guild, error)

GetGuildByPlayerID retrieves a player guild

type Map

type Map struct {
	ID           uint64
	Name         string
	Data         []byte
	Created_at   time.Time
	Updated_at   time.Time
	Last_modtime time.Time
}

Map struct used for the castro encoded map

type Player

type Player struct {
	ID         int64
	Name       string
	Level      int
	Sex        int
	Vocation   int
	Town_id    uint32
	Account_id int64
	Experience int
}

Player struct used for server players

func GetGuildMember

func GetGuildMember(id, pd int64) (*Player, error)

GetGuildMember retrieves the given guild member

func GetGuildMembers

func GetGuildMembers(id int64) ([]*Player, error)

GetGuildMembers retrieves all guild members

func GetPlayerByID

func GetPlayerByID(id int64) (*Player, error)

GetPlayerByID returns a player by the identifier

func GetPlayerByName

func GetPlayerByName(name string) (*Player, error)

GetPlayerByName returns a player by the name

func (*Player) GetBalance

func (p *Player) GetBalance() (int, error)

GetBalance returns the player balance

func (*Player) GetCapacity

func (p *Player) GetCapacity() (int, error)

GetCapacity returns the player capacity

func (*Player) GetExperience

func (p *Player) GetExperience() (int, error)

GetExperience returns the player

func (*Player) GetPremiumDays

func (p *Player) GetPremiumDays() (int, error)

GetPremiumDays returns the player premium days

func (*Player) GetPremiumEndsAt

func (p *Player) GetPremiumEndsAt() (int, error)

GetPremiumTime returns the player premium time end

func (*Player) GetPremiumTime

func (p *Player) GetPremiumTime() (int, error)

GetPremiumTime returns the player premium time end

func (*Player) GetStorageValue

func (p *Player) GetStorageValue(key int) (*Storage, error)

GetStorageValue returns a storage value by its key

func (*Player) IsOnline

func (p *Player) IsOnline() (bool, error)

IsOnline checks if the player is online

func (*Player) SetBalance

func (p *Player) SetBalance(balance int) error

SetBalance updates a player balance

func (*Player) SetStorageValue

func (p *Player) SetStorageValue(key, value int) error

SetStorageValue sets a player storage value

type PlayerColumn

type PlayerColumn struct {
	Name string
}

type Storage

type Storage struct {
	Player_id int64
	Key       int
	Value     int
}

Storage struct for player storage values

type TemplateHook

type TemplateHook struct {
	ExtensionId string
	Template    string
}

TemplateHook Struct used for template hooks

func GetTemplateHooksByName

func GetTemplateHooksByName(name string) ([]TemplateHook, error)

GetTemplateHooksByName gets a list of template hooks from database based on the hook name

Jump to

Keyboard shortcuts

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