storage

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateDb

func MigrateDb(DB *Database, cfg *config.MySQL) error

Types

type Database

type Database struct {
	*sqlx.DB
}

func OpenDB

func OpenDB(cfg *config.MySQL) (*Database, error)

func (*Database) GetCompoundUsersByID added in v0.3.0

func (DB *Database) GetCompoundUsersByID(userID uuid.UUID) ([]uuid.UUID, error)

func (*Database) GetDefaultEntranceWorld

func (DB *Database) GetDefaultEntranceWorld() (uuid.UUID, error)

func (*Database) GetGuestUserTypeId

func (DB *Database) GetGuestUserTypeId(typename string) (uuid.UUID, error)

func (*Database) GetMainDomain added in v0.3.0

func (DB *Database) GetMainDomain() (string, error)

func (*Database) GetParentWorld

func (DB *Database) GetParentWorld(sid uuid.UUID) (uuid.UUID, error)

func (*Database) GetRandomWorld

func (DB *Database) GetRandomWorld() (uuid.UUID, error)

func (*Database) GetSubdomainNames added in v0.3.0

func (DB *Database) GetSubdomainNames() ([]string, error)

func (*Database) GetUserInfo

func (DB *Database) GetUserInfo(id uuid.UUID) (string, uuid.UUID, error)

func (*Database) GetUserLastKnownPosition

func (DB *Database) GetUserLastKnownPosition(UserId, WorldId uuid.UUID) (uuid.UUID, cmath.Vec3, error)

func (*Database) GetUserSpawnPosition

func (DB *Database) GetUserSpawnPosition(uid uuid.UUID, URL *url.URL) (uuid.UUID, uuid.UUID, cmath.Vec3, error)

func (*Database) GetUserSpawnPositionInWorld

func (DB *Database) GetUserSpawnPositionInWorld(uid, worldId uuid.UUID) (uuid.UUID, cmath.Vec3)

func (*Database) GetUsersIDsByType added in v0.1.1

func (DB *Database) GetUsersIDsByType(typeid uuid.UUID) ([]uuid.UUID, error)

func (*Database) GetWorldByURL

func (DB *Database) GetWorldByURL(URL *url.URL) (uuid.UUID, error)

func (*Database) GetWorldCreatorsGroupID added in v0.3.0

func (DB *Database) GetWorldCreatorsGroupID() (uuid.UUID, error)

func (*Database) GetWorldDefauleSpawnPositon

func (DB *Database) GetWorldDefauleSpawnPositon(WorldId uuid.UUID) (uuid.UUID, cmath.Vec3, error)

func (*Database) GetWorldNames added in v0.3.0

func (DB *Database) GetWorldNames() ([]string, error)

func (*Database) GetWorldTemplates added in v0.3.0

func (DB *Database) GetWorldTemplates() ([]WorldTemplateItem, error)

func (*Database) GetastUserWorld

func (DB *Database) GetastUserWorld(uid uuid.UUID) (uuid.UUID, error)

func (*Database) InsertOnline

func (DB *Database) InsertOnline(userId, spaceId uuid.UUID) error

func (*Database) InsertRows added in v0.3.2

func (DB *Database) InsertRows(w *World) error

func (*Database) QuerySingleAuxById

func (DB *Database) QuerySingleAuxById(tables []string, id []byte) (map[string]interface{}, error)

func (*Database) QuerySingleByBinId

func (DB *Database) QuerySingleByBinId(table string, id []byte) (map[string]interface{}, error)

func (*Database) QuerySingleByField

func (DB *Database) QuerySingleByField(table string, field string, ref interface{}) (map[string]interface{}, error)

func (*Database) QuerySingleByUUID

func (DB *Database) QuerySingleByUUID(table string, id uuid.UUID) (map[string]interface{}, error)

func (*Database) QueryWorldConfig

func (DB *Database) QueryWorldConfig(id uuid.UUID) (map[string]interface{}, error)

func (*Database) RemoveAllDynamicMembership added in v0.1.16

func (DB *Database) RemoveAllDynamicMembership() error

func (*Database) RemoveAllOnlineUsers added in v0.1.16

func (DB *Database) RemoveAllOnlineUsers() error

func (*Database) RemoveDynamicWorldMembership

func (DB *Database) RemoveDynamicWorldMembership(userId, worldId uuid.UUID) error

func (*Database) RemoveFromUsers

func (DB *Database) RemoveFromUsers(userId uuid.UUID) error

func (*Database) RemoveManyFromUsers added in v0.1.1

func (DB *Database) RemoveManyFromUsers(ids []uuid.UUID) error

func (*Database) RemoveOnline

func (DB *Database) RemoveOnline(userId, worldId uuid.UUID) error

func (*Database) UpdateHighFives

func (DB *Database) UpdateHighFives(sender, target uuid.UUID) error

func (*Database) WorldJSONTemplate added in v0.3.2

func (DB *Database) WorldJSONTemplate(templateID uuid.UUID) (string, error)

func (*Database) WriteLastKnownPosition

func (DB *Database) WriteLastKnownPosition(
	userId, worldId, anchorId uuid.UUID, vector *cmath.Vec3, timeOffset time.Duration,
) error

type World added in v0.3.2

type World struct {
	ID                         uuid.UUID   `json:"id"`
	OwnerID                    uuid.UUID   `json:"owner_id"`
	NameHash                   string      `json:"name_hash"`
	FullDomain                 string      `json:"domain"`
	Name                       string      `json:"name"`
	Mpath                      string      `json:"mpath"`
	AssetParameters            string      `json:"asset_parameters"`
	Parameters2D               string      `json:"parameters2D"`
	Parameters3D               string      `json:"parameters3D"`
	Secret                     int         `json:"secret"`
	FrameTemplates             interface{} `json:"frame_templates"`
	AllowedSubspaces           interface{} `json:"allowed_subspaces"`
	ChildPlacement             interface{} `json:"child_placement"`
	Minimap                    int         `json:"minimap"`
	Visible                    int         `json:"visible"`
	Metadata                   interface{} `json:"metadata"`
	Position                   interface{} `json:"position"`
	Asset                      interface{} `json:"asset"`
	UniqueAttributeInSpaceType interface{} `json:"uniqueAttributeInSpaceType"`
	UITypeID                   uuid.UUID
	SpaceTypeID                uuid.UUID
	ParentID                   uuid.UUID
}

type WorldTemplateItem added in v0.3.0

type WorldTemplateItem struct {
	ID          uuid.UUID       `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Image       string          `json:"image"`
	Content     json.RawMessage `json:"-"`
}

Jump to

Keyboard shortcuts

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