Documentation ¶
Index ¶
- Variables
- func NewAccounts(path string) (*accounts, error)
- func NewSocketServer(newClientChan chan client, checkChan chan struct{}) *socketServer
- func NewUniverse(accounts Accounts, data *Data) (universe, chan client, chan struct{})
- type Account
- type Accounts
- type Appliable
- type Blockable
- type Damager
- type Data
- func (d *Data) Archetype(uuid id.UUID) game.Archetype
- func (d *Data) ArmorArchetypes() []game.ArmorArchetype
- func (d *Data) CharacterArchetypes() []game.CharacterArchetype
- func (d *Data) ItemArchetypes() []game.ItemArchetype
- func (d *Data) LoadArchetypes() error
- func (d *Data) LoadFixtures() error
- func (d *Data) LoadPlaces() error
- func (d *Data) Tile(uuid id.UUID) (game.TileArchetype, error)
- func (d *Data) TileArchetypes() []game.TileArchetype
- func (d *Data) WeaponArchetypes() []game.WeaponArchetype
- type Fixtures
- type Hurtable
- type Lockable
- type Openable
- type Places
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotLoggedIn = errors.New("not logged in") ErrBadPassword = errors.New("bad password") ErrCharacterExists = errors.New("character exists") ErrCharacterDoesNotExist = errors.New("character does not exist") ErrNoSuchArchetype = errors.New("no such archetype") )
View Source
var ( ErrNoUser = errors.New("no such user") ErrUserExists = errors.New("user exists") )
View Source
var ( ErrCharacterNotInLocation = errors.New("character is not in location") ErrCharacterAlreadyInLocation = errors.New("character is already in location") ErrCharacterCannotPlaceInLocation = errors.New("character cannot be placed in location") )
View Source
var ( ErrWrongState = errors.New("message sent in wrong state") ErrTooSoon = errors.New("message sent too soon, please wait and try again") ErrNotJoined = errors.New("character not joined") ErrAlreadyJoined = errors.New("character is already joined") ErrUserLoggedIn = errors.New("user is logged in") ErrWorldDoesNotExist = errors.New("world does not exist") )
View Source
var (
ErrMovementBlocked = errors.New("movement blocked")
)
Functions ¶
func NewAccounts ¶
func NewSocketServer ¶
func NewSocketServer(newClientChan chan client, checkChan chan struct{}) *socketServer
func NewUniverse ¶
Types ¶
type Account ¶
type Account struct { ID int Characters []*game.Character Password string // contains filtered or unexported fields }
Account is a user account that contains a password and a list of characters.
func (*Account) CreateCharacter ¶
CreateCharacter creates a character with the name and archetype.
func (*Account) DeleteCharacter ¶
DeleteCharacter deletes a given character by name.
func (*Account) HasCharacter ¶
HasCharacter returns of the account has the given character by name.
func (*Account) PasswordMatches ¶
PasswordMatches returns if the given password matches the stored hashed password.
type Accounts ¶
type Accounts interface { Account(username string) (account Account, err error) NewAccount(username string, password string) error SaveAccount(account Account) error Buckets() (buckets []string) ListBucket(bucket string) (list []string) DumpBytes(bucket, data string) []byte }
Accounts is an interface for loading, creating, and saving accounts.
type Damager ¶
type Damager interface { CalculateFromCharacter(c *game.Character) RollDamages() []game.DamageResult }
type Data ¶
func (*Data) ArmorArchetypes ¶
func (d *Data) ArmorArchetypes() []game.ArmorArchetype
func (*Data) CharacterArchetypes ¶
func (d *Data) CharacterArchetypes() []game.CharacterArchetype
func (*Data) ItemArchetypes ¶
func (d *Data) ItemArchetypes() []game.ItemArchetype
func (*Data) LoadArchetypes ¶
func (*Data) LoadFixtures ¶
func (*Data) LoadPlaces ¶
func (*Data) TileArchetypes ¶
func (d *Data) TileArchetypes() []game.TileArchetype
func (*Data) WeaponArchetypes ¶
func (d *Data) WeaponArchetypes() []game.WeaponArchetype
Click to show internal directories.
Click to hide internal directories.