storage

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 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)

Types

type Database

type Database struct {
	*sqlx.DB
}

func OpenDB

func OpenDB(cfg *config.MySQL) *Database

func (*Database) GetDefaultEntranceWorld

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

func (*Database) GetGuestUserTypeId

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

func (*Database) GetParentWorld

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

func (*Database) GetRandomWorld

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

func (*Database) GetUserInfo

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

func (*Database) GetUserLastKnownPosition

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

func (*Database) GetUserName

func (DB *Database) GetUserName(id uuid.UUID) string

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, bool)

func (*Database) GetWorldDefauleSpawnPositon

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

func (*Database) GetastUserWorld

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

func (*Database) InsertOnline

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

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) RemoveDynamicWorldMembership

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

func (*Database) RemoveFromUsers

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

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)

func (*Database) UpdateHighFives

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

func (*Database) WriteLastKnownPosition

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

Jump to

Keyboard shortcuts

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