Documentation ¶
Index ¶
- func TimeInformer(client safemqtt.Client)
- type ConnectedUsers
- func (cu *ConnectedUsers) Add(u *User)
- func (cu *ConnectedUsers) Broadcast(message *websocket.PreparedMessage)
- func (cu *ConnectedUsers) BroadcastDisconnectedUsers()
- func (cu *ConnectedUsers) BroadcastPositions()
- func (cu *ConnectedUsers) BroadcastUsersUpdate()
- func (cu *ConnectedUsers) Delete(id uuid.UUID)
- func (cu *ConnectedUsers) Get(id uuid.UUID) (*User, bool)
- func (cu *ConnectedUsers) GetOnSpace(spaceId uuid.UUID) []*User
- func (cu *ConnectedUsers) Num() int
- func (cu *ConnectedUsers) PerformBroadcast(message *websocket.PreparedMessage)
- func (cu *ConnectedUsers) Run()
- func (cu *ConnectedUsers) UserLeft(userId uuid.UUID)
- type ControllerHub
- func (ch *ControllerHub) AddWorldController(worldID uuid.UUID) *WorldController
- func (ch *ControllerHub) ChangeHandler(client mqtt.Client, message mqtt.Message)
- func (ch *ControllerHub) GetNodeSettings()
- func (ch *ControllerHub) GetUserSpawnPoint(uid uuid.UUID, URL *url.URL) (uuid.UUID, cmath.Vec3, error)
- func (ch *ControllerHub) GetWorldController(worldID uuid.UUID) *WorldController
- func (ch *ControllerHub) NetworkRunner()
- func (ch *ControllerHub) RemoveGuestsWithDelay()
- func (ch *ControllerHub) RemoveUserWithDelay(id uuid.UUID, delay time.Duration)
- func (ch *ControllerHub) UpdateTotalUsers()
- func (ch *ControllerHub) WriteInfluxPoint(point *influx_write.Point) error
- type LoadedSpaces
- func (ls *LoadedSpaces) Add(obj *Space)
- func (ls *LoadedSpaces) Delete(spaceId uuid.UUID)
- func (ls *LoadedSpaces) FindClosest(pos *cmath.Vec3) (uuid.UUID, cmath.Vec3)
- func (ls *LoadedSpaces) Get(spaceId uuid.UUID) *Space
- func (ls *LoadedSpaces) GetPos(id uuid.UUID) (cmath.Vec3, error)
- func (ls *LoadedSpaces) GetPresent(spaceId uuid.UUID) (*Space, bool)
- func (ls *LoadedSpaces) Init()
- func (ls *LoadedSpaces) Load(req *RegRequest) *Space
- func (ls *LoadedSpaces) LoadFromEntry(req *RegRequest, entry map[string]interface{}) *Space
- func (ls *LoadedSpaces) Num() int
- func (ls *LoadedSpaces) Unload(spaceId uuid.UUID)
- type RegRequest
- type Space
- func (s *Space) CalculateVibes() int64
- func (s *Space) DeInit()
- func (s *Space) GetOnlineUsers() int64
- func (s *Space) Init()
- func (s *Space) MQTTEffectsHandler(msg []byte)
- func (s *Space) MQTTMessageHandler(_ mqtt.Client, msg mqtt.Message)
- func (s *Space) PushObjDef(metaArray []message.ObjectDefinition, i *int)
- func (s *Space) RecursiveSendAllAttributes(connection *socket.Connection)
- func (s *Space) RecursiveSendAllStrings(connection *socket.Connection)
- func (s *Space) RecursiveSendAllTextures(connection *socket.Connection)
- func (s *Space) SendToUsersOnSpace(msg *websocket.PreparedMessage)
- func (s *Space) SetPosition(pos cmath.Vec3)
- func (s *Space) UpdateChildren() error
- func (s *Space) UpdateMeta() error
- func (s *Space) UpdateMetaFromMap(entry map[string]interface{}) error
- func (s *Space) UpdatePosition(pos cmath.Vec3, theta float64, force bool)
- func (s *Space) UpdateSpace() error
- type StageModeSetMetadata
- type User
- func (u *User) HandleHighFive(m *posbus.TriggerInteraction)
- func (u *User) HandleSignals(s posbus.Signal)
- func (u *User) HandleStake(m *posbus.TriggerInteraction)
- func (u *User) InteractionHandler(m *posbus.TriggerInteraction)
- func (u *User) MQTTMessageHandler(_ mqtt.Client, msg mqtt.Message)
- func (u *User) OnMessage(msg *posbus.Message)
- func (u *User) Register(wc *WorldController)
- func (u *User) Send(m *websocket.PreparedMessage)
- func (u *User) SwitchWorld(newWorldId uuid.UUID)
- func (u *User) Unregister(h *WorldController)
- func (u *User) UpdatePosition(data []byte)
- func (u *User) UserOfflineAction()
- type WorldController
- func (wc *WorldController) AddUserToWorld(u *User)
- func (wc *WorldController) Broadcast(websocketMessage *websocket.PreparedMessage)
- func (wc *WorldController) BroadcastObjects(array []message.ObjectDefinition)
- func (wc *WorldController) GetBuilder() *message.Builder
- func (wc *WorldController) GetConfig() *config.World
- func (wc *WorldController) GetExtensionStorage() string
- func (wc *WorldController) GetId() uuid.UUID
- func (wc *WorldController) GetSpacePosition(id uuid.UUID) cmath.Vec3
- func (wc *WorldController) GetSpacePresent(id uuid.UUID) bool
- func (wc *WorldController) GetStorage() *storage.Database
- func (wc *WorldController) InsertOnline(id uuid.UUID)
- func (wc *WorldController) InsertWorldDynamicMembership(id uuid.UUID)
- func (wc *WorldController) LoadExtensions()
- func (wc *WorldController) PositionRelativeToAbsolute(spaceID uuid.UUID, v cmath.Vec3) cmath.Vec3
- func (wc *WorldController) SafeSubscribe(topic string, qos byte, callback func(client mqtt.Client, msg mqtt.Message))
- func (wc *WorldController) SanitizeOnlineUsers() error
- func (wc *WorldController) SetSpaceTitle(spaceId uuid.UUID, title string)
- func (wc *WorldController) UpdateMeta() error
- func (wc *WorldController) UpdateOnline()
- func (wc *WorldController) UpdateOnlineBySpaceId(spaceId uuid.UUID) int64
- func (wc *WorldController) UpdateVibesBySpaceId(spaceId uuid.UUID) int64
- func (wc *WorldController) UserOnlineAction(id uuid.UUID)
- type WorldMeta
- type WowMetadata
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) 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 (*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 (*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 ¶
func (*Space) CalculateVibes ¶
func (*Space) GetOnlineUsers ¶
func (*Space) MQTTEffectsHandler ¶
func (*Space) MQTTMessageHandler ¶
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 (*Space) UpdateChildren ¶
func (*Space) UpdateMeta ¶
func (*Space) UpdateMetaFromMap ¶
func (*Space) UpdatePosition ¶
func (*Space) UpdateSpace ¶
type StageModeSetMetadata ¶
type User ¶
func (*User) HandleHighFive ¶
func (u *User) HandleHighFive(m *posbus.TriggerInteraction)
func (*User) HandleSignals ¶
func (*User) HandleStake ¶
func (u *User) HandleStake(m *posbus.TriggerInteraction)
func (*User) InteractionHandler ¶
func (u *User) InteractionHandler(m *posbus.TriggerInteraction)
func (*User) MQTTMessageHandler ¶
func (*User) Register ¶
func (u *User) Register(wc *WorldController)
func (*User) Send ¶
func (u *User) Send(m *websocket.PreparedMessage)
func (*User) SwitchWorld ¶
func (*User) Unregister ¶
func (u *User) Unregister(h *WorldController)
func (*User) UpdatePosition ¶
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 (*WorldController) SafeSubscribe ¶
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 WowMetadata ¶
Click to show internal directories.
Click to hide internal directories.