universe

package
v0.1.9 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: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeInformer

func TimeInformer(client safemqtt.Client)

Types

type ConnectedUsers

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

func NewUsers

func NewUsers(world *WorldController) *ConnectedUsers

func (*ConnectedUsers) Add

func (cu *ConnectedUsers) Add(u *User)

func (*ConnectedUsers) Broadcast

func (cu *ConnectedUsers) Broadcast(message *websocket.PreparedMessage)

func (*ConnectedUsers) BroadcastDisconnectedUsers

func (cu *ConnectedUsers) BroadcastDisconnectedUsers()

func (*ConnectedUsers) BroadcastPositions

func (cu *ConnectedUsers) BroadcastPositions()

func (*ConnectedUsers) BroadcastUsersUpdate

func (cu *ConnectedUsers) BroadcastUsersUpdate()

func (*ConnectedUsers) Delete

func (cu *ConnectedUsers) Delete(id uuid.UUID)

func (*ConnectedUsers) Get

func (cu *ConnectedUsers) Get(id uuid.UUID) (*User, bool)

func (*ConnectedUsers) GetOnSpace

func (cu *ConnectedUsers) GetOnSpace(spaceId uuid.UUID) []*User

func (*ConnectedUsers) Num

func (cu *ConnectedUsers) Num() int

func (*ConnectedUsers) PerformBroadcast

func (cu *ConnectedUsers) PerformBroadcast(message *websocket.PreparedMessage)

func (*ConnectedUsers) Run

func (cu *ConnectedUsers) Run()

func (*ConnectedUsers) UserLeft

func (cu *ConnectedUsers) UserLeft(userId uuid.UUID)

type ControllerHub

type ControllerHub struct {
	Worlds map[uuid.UUID]*WorldController

	DB           *storage.Database
	SpaceStorage space.Storage
	WorldStorage world.Storage
	UserStorage  user.Storage
	// contains filtered or unexported fields
}

func NewControllerHub

func NewControllerHub(cfg *config.Config, networking *net.Networking, msgBuilder *message.Builder) *ControllerHub

func (*ControllerHub) AddWorldController

func (ch *ControllerHub) AddWorldController(worldID uuid.UUID) *WorldController

func (*ControllerHub) ChangeHandler

func (ch *ControllerHub) ChangeHandler(client mqtt.Client, message mqtt.Message)

func (*ControllerHub) GetNodeSettings

func (ch *ControllerHub) GetNodeSettings()

func (*ControllerHub) GetUserSpawnPoint

func (ch *ControllerHub) GetUserSpawnPoint(uid uuid.UUID, URL *url.URL) (uuid.UUID, cmath.Vec3, error)

func (*ControllerHub) GetWorldController

func (ch *ControllerHub) GetWorldController(worldID uuid.UUID) *WorldController

func (*ControllerHub) NetworkRunner

func (ch *ControllerHub) NetworkRunner()

func (*ControllerHub) RemoveGuestsWithDelay added in v0.1.1

func (ch *ControllerHub) RemoveGuestsWithDelay()

func (*ControllerHub) RemoveUserWithDelay added in v0.1.1

func (ch *ControllerHub) RemoveUserWithDelay(id uuid.UUID, delay time.Duration)

func (*ControllerHub) UpdateTotalUsers

func (ch *ControllerHub) UpdateTotalUsers()

func (*ControllerHub) WriteInfluxPoint

func (ch *ControllerHub) WriteInfluxPoint(point *influx_write.Point) error

type LoadedSpaces

type LoadedSpaces struct {
	Time1    time.Duration
	Time2    time.Duration
	Time3    time.Duration
	Time4    time.Duration
	Time5    time.Duration
	Time6    time.Duration
	MetaTime time.Duration
	// contains filtered or unexported fields
}

func (*LoadedSpaces) Add

func (ls *LoadedSpaces) Add(obj *Space)

func (*LoadedSpaces) Delete

func (ls *LoadedSpaces) Delete(spaceId uuid.UUID)

func (*LoadedSpaces) FindClosest

func (ls *LoadedSpaces) FindClosest(pos *cmath.Vec3) (uuid.UUID, cmath.Vec3)

func (*LoadedSpaces) Get

func (ls *LoadedSpaces) Get(spaceId uuid.UUID) *Space

func (*LoadedSpaces) GetPos

func (ls *LoadedSpaces) GetPos(id uuid.UUID) (cmath.Vec3, error)

func (*LoadedSpaces) GetPresent

func (ls *LoadedSpaces) GetPresent(spaceId uuid.UUID) (*Space, bool)

func (*LoadedSpaces) Init

func (ls *LoadedSpaces) Init()

func (*LoadedSpaces) Load

func (ls *LoadedSpaces) Load(req *RegRequest) *Space

func (*LoadedSpaces) LoadFromEntry

func (ls *LoadedSpaces) LoadFromEntry(req *RegRequest, entry map[string]interface{}) *Space

func (*LoadedSpaces) Num

func (ls *LoadedSpaces) Num() int

func (*LoadedSpaces) Unload

func (ls *LoadedSpaces) Unload(spaceId uuid.UUID)

type RegRequest

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

type Space

type Space struct {
	Name string

	InfoUI uuid.UUID
	// contains filtered or unexported fields
}

func (*Space) CalculateVibes

func (s *Space) CalculateVibes() int64

func (*Space) DeInit

func (s *Space) DeInit()

func (*Space) GetOnlineUsers

func (s *Space) GetOnlineUsers() int64

func (*Space) Init

func (s *Space) Init()

func (*Space) MQTTEffectsHandler

func (s *Space) MQTTEffectsHandler(msg []byte)

func (*Space) MQTTMessageHandler

func (s *Space) MQTTMessageHandler(_ mqtt.Client, msg mqtt.Message)

func (*Space) PushObjDef

func (s *Space) PushObjDef(metaArray []message.ObjectDefinition, i *int)

func (*Space) RecursiveSendAllAttributes

func (s *Space) RecursiveSendAllAttributes(connection *socket.Connection)

func (*Space) RecursiveSendAllStrings

func (s *Space) RecursiveSendAllStrings(connection *socket.Connection)

func (*Space) RecursiveSendAllTextures

func (s *Space) RecursiveSendAllTextures(connection *socket.Connection)

func (*Space) SendToUsersOnSpace

func (s *Space) SendToUsersOnSpace(msg *websocket.PreparedMessage)

func (*Space) SetPosition

func (s *Space) SetPosition(pos cmath.Vec3)

func (*Space) UpdateChildren

func (s *Space) UpdateChildren() error

func (*Space) UpdateMeta

func (s *Space) UpdateMeta() error

func (*Space) UpdateMetaFromMap

func (s *Space) UpdateMetaFromMap(entry map[string]interface{}) error

func (*Space) UpdatePosition

func (s *Space) UpdatePosition(pos cmath.Vec3, theta float64, force bool)

func (*Space) UpdateSpace

func (s *Space) UpdateSpace() error

type StageModeSetMetadata

type StageModeSetMetadata struct {
	StageModeStatus string   `json:"stageModeStatus"`
	Users           []string `json:"ConnectedUsers"`
}

type User

type User struct {
	ID        uuid.UUID
	SessionID uuid.UUID
	// contains filtered or unexported fields
}

func (*User) HandleHighFive

func (u *User) HandleHighFive(m *posbus.TriggerInteraction)

func (*User) HandleSignals

func (u *User) HandleSignals(s posbus.Signal)

func (*User) HandleStake

func (u *User) HandleStake(m *posbus.TriggerInteraction)

func (*User) InteractionHandler

func (u *User) InteractionHandler(m *posbus.TriggerInteraction)

func (*User) MQTTMessageHandler

func (u *User) MQTTMessageHandler(_ mqtt.Client, msg mqtt.Message)

func (*User) OnMessage

func (u *User) OnMessage(msg *posbus.Message)

func (*User) Register

func (u *User) Register(wc *WorldController)

func (*User) Send

func (u *User) Send(m *websocket.PreparedMessage)

func (*User) SwitchWorld

func (u *User) SwitchWorld(newWorldId uuid.UUID)

func (*User) Unregister

func (u *User) Unregister(h *WorldController)

func (*User) UpdatePosition

func (u *User) UpdatePosition(data []byte)

func (*User) UserOfflineAction

func (u *User) UserOfflineAction()

type WorldController

type WorldController struct {
	ID uuid.UUID

	AdditionalExtensions map[string]extension.Extension
	MainExtension        extension.Extension
	EffectsEmitter       uuid.UUID
	Config               config.World
	// contains filtered or unexported fields
}

WorldController ...

func (*WorldController) AddUserToWorld

func (wc *WorldController) AddUserToWorld(u *User)

func (*WorldController) Broadcast

func (wc *WorldController) Broadcast(websocketMessage *websocket.PreparedMessage)

func (*WorldController) BroadcastObjects

func (wc *WorldController) BroadcastObjects(array []message.ObjectDefinition)

func (*WorldController) GetBuilder

func (wc *WorldController) GetBuilder() *message.Builder

func (*WorldController) GetConfig

func (wc *WorldController) GetConfig() *config.World

func (*WorldController) GetExtensionStorage

func (wc *WorldController) GetExtensionStorage() string

func (*WorldController) GetId

func (wc *WorldController) GetId() uuid.UUID

func (*WorldController) GetSpacePosition

func (wc *WorldController) GetSpacePosition(id uuid.UUID) cmath.Vec3

func (*WorldController) GetSpacePresent

func (wc *WorldController) GetSpacePresent(id uuid.UUID) bool

func (*WorldController) GetStorage

func (wc *WorldController) GetStorage() *storage.Database

func (*WorldController) InsertOnline

func (wc *WorldController) InsertOnline(id uuid.UUID)

func (*WorldController) InsertWorldDynamicMembership

func (wc *WorldController) InsertWorldDynamicMembership(id uuid.UUID)

func (*WorldController) LoadExtensions

func (wc *WorldController) LoadExtensions()

func (*WorldController) PositionRelativeToAbsolute

func (wc *WorldController) PositionRelativeToAbsolute(spaceID uuid.UUID, v cmath.Vec3) cmath.Vec3

func (*WorldController) SafeSubscribe

func (wc *WorldController) SafeSubscribe(topic string, qos byte, callback func(client mqtt.Client, msg mqtt.Message))

func (*WorldController) SanitizeOnlineUsers

func (wc *WorldController) SanitizeOnlineUsers() error

func (*WorldController) SetSpaceTitle

func (wc *WorldController) SetSpaceTitle(spaceId uuid.UUID, title string)

func (*WorldController) UpdateMeta

func (wc *WorldController) UpdateMeta() error

func (*WorldController) UpdateOnline

func (wc *WorldController) UpdateOnline()

func (*WorldController) UpdateOnlineBySpaceId

func (wc *WorldController) UpdateOnlineBySpaceId(spaceId uuid.UUID) int64

func (*WorldController) UpdateVibesBySpaceId

func (wc *WorldController) UpdateVibesBySpaceId(spaceId uuid.UUID) int64

func (*WorldController) UserOnlineAction

func (wc *WorldController) UserOnlineAction(id uuid.UUID)

type WorldMeta

type WorldMeta struct {
	Name             string
	LODs             []uint32
	Decorations      []message.DecorationMetadata
	AvatarController uuid.UUID
	SkyboxController uuid.UUID
}

type WowMetadata

type WowMetadata struct {
	UserId  []string `json:"UserId"`
	WowType string   `json:"type"` // +1 -1
	Count   int      `json:"count"`
}

Jump to

Keyboard shortcuts

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