posbus

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 19 Imported by: 7

Documentation

Overview

The posbus package implements the custom protocol for communication between the backend and frontends.

Originally it implemented messaging for position updates of objects in a 3D space, hence the PosBus name. But has been expanded to include more types of information.

Messages are in a compact binary format and usually send through a websocket connection.

Index

Constants

View Source
const (
	MsgTypeSize      = 4
	MsgArrTypeSize   = 4
	MsgUUIDTypeSize  = 16
	MsgLockStateSize = 4
)
View Source
const (
	TriggerNone = iota
	TriggerWow
	TriggerHighFive
	TriggerEnteredObject
	TriggerLeftObject
	TriggerStake
)
View Source
const UserTransformMessageSize = MsgUUIDTypeSize + cmath.Float32Bytes*6

Variables

This section is empty.

Functions

func BinMessage

func BinMessage(m Message) []byte

func DecodeTo

func DecodeTo(buf []byte, m Message) (err error)

func ExtraTypes

func ExtraTypes() []reflect.Type

func MessageDataTypeById

func MessageDataTypeById(id MsgType) reflect.Type

func MessageNameById

func MessageNameById(id MsgType) string

func MessageTypeNameById

func MessageTypeNameById(id MsgType) string

func MsgTypeName

func MsgTypeName(m Message) string

func WSMessage

func WSMessage(m Message) *websocket.PreparedMessage

Types

type ActivityUpdate

type ActivityUpdate struct {
	ActivityId umid.UMID           `json:"activity_id"`
	ChangeType string              `json:"change_type"`
	Type       *entry.ActivityType `json:"type"`
	Data       *entry.ActivityData `json:"data"`
	UserId     umid.UMID           `json:"user_id"`
	ObjectId   umid.UMID           `json:"object_id"`
}

func (*ActivityUpdate) GetType

func (r *ActivityUpdate) GetType() MsgType

func (ActivityUpdate) MarshalMUS

func (v ActivityUpdate) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (ActivityUpdate) SizeMUS

func (v ActivityUpdate) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*ActivityUpdate) UnmarshalMUS

func (v *ActivityUpdate) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type ActivityUpdateType

type ActivityUpdateType string

TODO: does musgo support type aliases/const like this?

const (
	ActivityUpdateChangeType  ActivityUpdateType = ""
	NewActivityUpdateType     ActivityUpdateType = "new"
	ChangedActivityUpdateType ActivityUpdateType = "changed"
	RemovedActivityUpdateType ActivityUpdateType = "removed"
)

type AddObjects

type AddObjects struct {
	Objects []ObjectDefinition `json:"objects"`
}

func (*AddObjects) GetType

func (g *AddObjects) GetType() MsgType

func (AddObjects) MarshalMUS

func (v AddObjects) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (AddObjects) SizeMUS

func (v AddObjects) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*AddObjects) UnmarshalMUS

func (v *AddObjects) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type AddPendingStake

type AddPendingStake struct {
	TransactionID umid.UMID    `json:"transaction_id"`
	OdysseyId     umid.UMID    `json:"odyssey_id"`
	Wallet        PBEthAddress `json:"wallet"`
	Amount        PBUint256    `json:"amount"`
	Comment       string       `json:"comment"`
	Kind          int          `json:"kind"`
}

func (*AddPendingStake) GetType

func (g *AddPendingStake) GetType() MsgType

func (AddPendingStake) MarshalMUS

func (v AddPendingStake) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (AddPendingStake) SizeMUS

func (v AddPendingStake) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*AddPendingStake) UnmarshalMUS

func (v *AddPendingStake) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type AddUsers

type AddUsers struct {
	Users []UserData `json:"users"`
}

func (*AddUsers) GetType

func (a *AddUsers) GetType() MsgType

func (AddUsers) MarshalMUS

func (v AddUsers) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (AddUsers) SizeMUS

func (v AddUsers) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*AddUsers) UnmarshalMUS

func (v *AddUsers) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type AttributeChangeType

type AttributeChangeType string

TODO: does musgo support type aliases/const like this?

const (
	InvalidAttributeChangeType AttributeChangeType = ""
	ChangedAttributeChangeType AttributeChangeType = "attribute_changed"
	RemovedAttributeChangeType AttributeChangeType = "attribute_removed"
)

type AttributeValueChanged

type AttributeValueChanged struct {
	// The plugin that owns the attribute
	PluginID umid.UMID `json:"plugin_id"`
	// Name of attribute (scoped to plugin)
	AttributeName string `json:"attribute_name"`
	// Indicate what has changed (removed or value changed)
	ChangeType string `json:"change_type"`
	// The new value, in case of change/new.
	Value *StringAnyMap `json:"value"`
	// ID of the related object/user
	TargetID umid.UMID `json:"target_id"`
}

func (*AttributeValueChanged) GetType

func (r *AttributeValueChanged) GetType() MsgType

func (AttributeValueChanged) MarshalMUS

func (v AttributeValueChanged) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (AttributeValueChanged) SizeMUS

func (v AttributeValueChanged) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*AttributeValueChanged) UnmarshalMUS

func (v *AttributeValueChanged) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type EventStart

type EventStart map[string]string

func (*EventStart) GetType

func (r *EventStart) GetType() MsgType

func (EventStart) MarshalMUS

func (v EventStart) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (EventStart) SizeMUS

func (v EventStart) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*EventStart) UnmarshalMUS

func (v *EventStart) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type FlyToMe

type FlyToMe struct {
	Pilot     umid.UMID `json:"pilot"`
	PilotName string    `json:"pilot_name"`
	ObjectID  umid.UMID `json:"object_id"`
}

func (*FlyToMe) GetType

func (g *FlyToMe) GetType() MsgType

func (FlyToMe) MarshalMUS

func (v FlyToMe) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (FlyToMe) SizeMUS

func (v FlyToMe) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*FlyToMe) UnmarshalMUS

func (v *FlyToMe) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type GenericMessage

type GenericMessage struct {
	Topic string
	Data  []byte
}

func NewGenericMessage

func NewGenericMessage(topic string, data interface{}) *GenericMessage

func (*GenericMessage) GetType

func (g *GenericMessage) GetType() MsgType

func (GenericMessage) MarshalMUS

func (v GenericMessage) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (GenericMessage) SizeMUS

func (v GenericMessage) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*GenericMessage) UnmarshalMUS

func (v *GenericMessage) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type HandShake

type HandShake struct {
	// Versioning for this message, for compatibility handling.
	HandshakeVersion int `json:"handshake_version"`

	// Versioning for the protocol to use after the handshake.
	ProtocolVersion int `json:"protocol_version"`

	// Authentication token (JWT).
	Token string `json:"token"`

	// User identifier (should match the token).
	UserId umid.UMID `json:"user_id"`

	// Unique session identifier, for state/reconnection handling.
	SessionId umid.UMID `json:"session_id"`
}

A HandShake is the first message a client sends after connecting.

func (*HandShake) GetType

func (g *HandShake) GetType() MsgType

func (HandShake) MarshalMUS

func (v HandShake) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (HandShake) SizeMUS

func (v HandShake) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*HandShake) UnmarshalMUS

func (v *HandShake) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type HighFive

type HighFive struct {
	SenderID   umid.UMID `json:"sender_id"`
	ReceiverID umid.UMID `json:"receiver_id"`
	Message    string    `json:"message"`
}

func (*HighFive) GetType

func (g *HighFive) GetType() MsgType

func (HighFive) MarshalMUS

func (v HighFive) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (HighFive) SizeMUS

func (v HighFive) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*HighFive) UnmarshalMUS

func (v *HighFive) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type LockObject

type LockObject struct {
	ID umid.UMID `json:"id"`
}

func (*LockObject) GetType

func (l *LockObject) GetType() MsgType

func (LockObject) MarshalMUS

func (v LockObject) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (LockObject) SizeMUS

func (v LockObject) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*LockObject) UnmarshalMUS

func (v *LockObject) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type LockObjectResponse

type LockObjectResponse struct {
	ID        umid.UMID `json:"id"`
	Result    uint32    `json:"result"`
	LockOwner umid.UMID `json:"lock_owner"`
}

func (*LockObjectResponse) GetType

func (l *LockObjectResponse) GetType() MsgType

func (LockObjectResponse) MarshalMUS

func (v LockObjectResponse) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (LockObjectResponse) SizeMUS

func (v LockObjectResponse) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*LockObjectResponse) UnmarshalMUS

func (v *LockObjectResponse) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type Message

type Message interface {
	MarshalMUS(buf []byte) int
	UnmarshalMUS(buf []byte) (int, error)
	SizeMUS() int
	GetType() MsgType
}

func Decode

func Decode(buf []byte) (Message, error)

func NewMessageOfType

func NewMessageOfType(msgType MsgType) (Message, error)

type MsgType

type MsgType uint32
const (
	TypeActivityUpdate        MsgType = 0xCA57695D
	TypeAddObjects            MsgType = 0x2452A9C1
	TypeAddPendingStake       MsgType = 0xF020D682
	TypeAddUsers              MsgType = 0xF51F2AFF
	TypeAttributeValueChanged MsgType = 0x10DACDB7
	TypeEventStart            MsgType = 0xAA854D2C
	TypeFlyToMe               MsgType = 0xA6EB70C6
	TypeGenericMessage        MsgType = 0xF508E4A3
	TypeHandShake             MsgType = 0x7C41941A
	TypeHighFive              MsgType = 0x3D501432
	TypeLockObject            MsgType = 0xA7DE9F59
	TypeLockObjectResponse    MsgType = 0x0924668C
	TypeMyTransform           MsgType = 0xF878C4BF
	TypeNotification          MsgType = 0xC1FB41D7
	TypeObjectData            MsgType = 0xCACE197C
	TypeObjectDefinition      MsgType = 0xD742B52E
	TypeObjectTransform       MsgType = 0xEA6DA4B4
	TypeRemoveObjects         MsgType = 0x6BF88C24
	TypeRemoveUsers           MsgType = 0xF5A14BB0
	TypeSetWorld              MsgType = 0xCCDF2E49
	TypeSignal                MsgType = 0xADC1964D
	TypeTeleportRequest       MsgType = 0x78DA55D9
	TypeTriggerVisualEffects  MsgType = 0xD96089C6
	TypeUnlockObject          MsgType = 0xA54EDEB9
	TypeUserAction            MsgType = 0xEF1A2E75
	TypeUserData              MsgType = 0xF702EF5F
	TypeUserStakedToOdyssey   MsgType = 0x10DACABC
	TypeUserTransform         MsgType = 0x3BC97EBB
	TypeUsersTransformList    MsgType = 0x285954B8
)

func GetMessageIds

func GetMessageIds() []MsgType

GetMessageIds : returns list of message IDs sorted according to message names

func MessageIdByName

func MessageIdByName(name string) MsgType

func MessageType

func MessageType(buf []byte) MsgType

func MsgTypeId

func MsgTypeId(m Message) MsgType

type MyTransform

type MyTransform cmath.TransformNoScale

func (*MyTransform) GetType

func (a *MyTransform) GetType() MsgType

func (MyTransform) MarshalMUS

func (v MyTransform) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (MyTransform) SizeMUS

func (v MyTransform) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*MyTransform) UnmarshalMUS

func (v *MyTransform) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type Notification

type Notification struct {
	NotifyType NotificationType `json:"notify_type"`
	Value      string           `json:"value"`
}

func (*Notification) GetType

func (g *Notification) GetType() MsgType

func (Notification) MarshalMUS

func (v Notification) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (Notification) SizeMUS

func (v Notification) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*Notification) UnmarshalMUS

func (v *Notification) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type NotificationType

type NotificationType uint32
const (
	NotificationNone     NotificationType = 0
	NotificationWow      NotificationType = 1
	NotificationHighFive NotificationType = 2

	NotificationStageModeAccept        NotificationType = 10
	NotificationStageModeInvitation    NotificationType = 11
	NotificationStageModeSet           NotificationType = 12
	NotificationStageModeStageJoin     NotificationType = 13
	NotificationStageModeStageRequest  NotificationType = 14
	NotificationStageModeStageDeclined NotificationType = 15

	NotificationGatheringStart NotificationType = 20

	NotificationTextMessage NotificationType = 500
	NotificationRelay       NotificationType = 501

	NotificationGeneric NotificationType = 999
	NotificationLegacy  NotificationType = 1000
)

func (NotificationType) MarshalMUS

func (v NotificationType) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (NotificationType) SizeMUS

func (v NotificationType) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*NotificationType) UnmarshalMUS

func (v *NotificationType) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type ObjectData

type ObjectData struct {
	ID      umid.UMID                        `json:"id"`
	Entries map[entry.SlotType]*StringAnyMap `json:"entries"`
}

func (*ObjectData) GetType

func (l *ObjectData) GetType() MsgType

func (ObjectData) MarshalMUS

func (v ObjectData) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (ObjectData) SizeMUS

func (v ObjectData) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*ObjectData) UnmarshalMUS

func (v *ObjectData) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type ObjectDefinition

type ObjectDefinition struct {
	ID               umid.UMID       `json:"id"`
	ParentID         umid.UMID       `json:"parent_id"`
	AssetType        umid.UMID       `json:"asset_type"`
	AssetFormat      dto.Asset3dType `json:"asset_format"` // TODO: Rename AssetType to AssetID, so Type can be used for this.
	Name             string          `json:"name"`
	Transform        cmath.Transform `json:"transform"`
	IsEditable       bool            `json:"is_editable"`
	TetheredToParent bool            `json:"tethered_to_parent"`
	ShowOnMiniMap    bool            `json:"show_on_minimap"`
}

func (*ObjectDefinition) GetType

func (g *ObjectDefinition) GetType() MsgType

func (ObjectDefinition) MarshalMUS

func (v ObjectDefinition) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (ObjectDefinition) SizeMUS

func (v ObjectDefinition) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*ObjectDefinition) UnmarshalMUS

func (v *ObjectDefinition) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type ObjectTransform

type ObjectTransform struct {
	ID        umid.UMID       `json:"id"`
	Transform cmath.Transform `json:"object_transform"`
}

ObjectTransform is a transform to apply to a specific object.

func (*ObjectTransform) GetType

func (g *ObjectTransform) GetType() MsgType

func (ObjectTransform) MarshalMUS

func (v ObjectTransform) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (ObjectTransform) SizeMUS

func (v ObjectTransform) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*ObjectTransform) UnmarshalMUS

func (v *ObjectTransform) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type PBEthAddress

type PBEthAddress common.Address

func (PBEthAddress) MarshalMUS

func (v PBEthAddress) MarshalMUS(buf []byte) int

func (PBEthAddress) SizeMUS

func (v PBEthAddress) SizeMUS() int

func (*PBEthAddress) UnmarshalMUS

func (v *PBEthAddress) UnmarshalMUS(buf []byte) (int, error)

type PBUint256

type PBUint256 uint256.Int

func (PBUint256) MarshalMUS

func (v PBUint256) MarshalMUS(buf []byte) int

func (PBUint256) SizeMUS

func (v PBUint256) SizeMUS() int

func (*PBUint256) UnmarshalMUS

func (v *PBUint256) UnmarshalMUS(buf []byte) (int, error)

type RemoveObjects

type RemoveObjects struct {
	Objects []umid.UMID `json:"objects"`
}

func (*RemoveObjects) GetType

func (g *RemoveObjects) GetType() MsgType

func (RemoveObjects) MarshalMUS

func (v RemoveObjects) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (RemoveObjects) SizeMUS

func (v RemoveObjects) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*RemoveObjects) UnmarshalMUS

func (v *RemoveObjects) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type RemoveUsers

type RemoveUsers struct {
	Users []umid.UMID `json:"users"`
}

func (*RemoveUsers) GetType

func (a *RemoveUsers) GetType() MsgType

func (RemoveUsers) MarshalMUS

func (v RemoveUsers) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (RemoveUsers) SizeMUS

func (v RemoveUsers) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*RemoveUsers) UnmarshalMUS

func (v *RemoveUsers) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type SetWorld

type SetWorld struct {
	ID              umid.UMID `json:"id"`
	Name            string    `json:"name"`
	Avatar          umid.UMID `json:"avatar"`
	Owner           umid.UMID `json:"owner"`
	Avatar3DAssetID umid.UMID `json:"avatar_3d_asset_id" gopy:"avatar_3d_asset_id"`
}

func (*SetWorld) GetType

func (g *SetWorld) GetType() MsgType

func (SetWorld) MarshalMUS

func (v SetWorld) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (SetWorld) SizeMUS

func (v SetWorld) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*SetWorld) UnmarshalMUS

func (v *SetWorld) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type Signal

type Signal struct {
	// The predefined type of the signal.
	Value SignalType `json:"value"`
}

A Signal is a predefined (small) message to notify the other side of some state or event. Used to asynchronously respond to certain other messages or state changes.

func (*Signal) GetType

func (g *Signal) GetType() MsgType

func (Signal) MarshalMUS

func (v Signal) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (Signal) SizeMUS

func (v Signal) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*Signal) UnmarshalMUS

func (v *Signal) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type SignalType

type SignalType uint32
const (
	// SignalNone is not used. If received, the message was not initialized properly.
	SignalNone SignalType = iota

	// A user is only allowed to be in a world 'once' (have a single connection to a world).
	// SignalDualConnection is send went a second (teleport) attempt is made.
	SignalDualConnection

	// The client (3d engine) is ready to receive the world data.
	// @deprecated When the client sends a teleport message, it is assumed to be ready.
	SignalReady

	// The authentication token is invalid.
	// TODO: actually reimplement this? or drop it :)
	SignalInvalidToken

	// Send to client when user is added to the world.
	// @deprecated Client receives [SetWorld] message instead.
	SignalSpawn

	// Send by client when user should be removed from the world.
	// @deprecated Use teleport to go to a different world instead or else just disconnect.
	SignalLeaveWorld

	// @deprecated If connection failed, how would this signal be received then?
	SignalConnectionFailed

	// Send as the first message after a connection, indicate it is now ready to be used.
	// This is actually send by the client library, not the server side application.
	SignalConnected

	// Send when connection is closed. Either by some error or explict action by the client.
	// This is actually send by the client library, not the server side application.
	SignalConnectionClosed

	// Send when user tries to teleport to a world that can't be found.
	SignalWorldDoesNotExist
)

func (SignalType) MarshalMUS

func (v SignalType) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (SignalType) SizeMUS

func (v SignalType) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*SignalType) UnmarshalMUS

func (v *SignalType) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type StringAnyMap

type StringAnyMap map[string]any

func (StringAnyMap) MarshalMUS

func (v StringAnyMap) MarshalMUS(buf []byte) int

func (StringAnyMap) SizeMUS

func (v StringAnyMap) SizeMUS() int

func (*StringAnyMap) UnmarshalMUS

func (v *StringAnyMap) UnmarshalMUS(buf []byte) (int, error)

type TeleportRequest

type TeleportRequest struct {
	Target umid.UMID `json:"target"`
}

func (*TeleportRequest) GetType

func (g *TeleportRequest) GetType() MsgType

func (TeleportRequest) MarshalMUS

func (v TeleportRequest) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (TeleportRequest) SizeMUS

func (v TeleportRequest) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*TeleportRequest) UnmarshalMUS

func (v *TeleportRequest) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type Trigger

type Trigger uint32

func (Trigger) MarshalMUS

func (v Trigger) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (Trigger) SizeMUS

func (v Trigger) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*Trigger) UnmarshalMUS

func (v *Trigger) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type TriggerVisualEffects

type TriggerVisualEffects struct {
	Effects []VisualEffect `json:"effects"`
}

func (*TriggerVisualEffects) GetType

func (g *TriggerVisualEffects) GetType() MsgType

func (TriggerVisualEffects) MarshalMUS

func (v TriggerVisualEffects) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (TriggerVisualEffects) SizeMUS

func (v TriggerVisualEffects) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*TriggerVisualEffects) UnmarshalMUS

func (v *TriggerVisualEffects) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type UnlockObject

type UnlockObject struct {
	ID umid.UMID `json:"id"`
}

func (*UnlockObject) GetType

func (l *UnlockObject) GetType() MsgType

func (UnlockObject) MarshalMUS

func (v UnlockObject) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (UnlockObject) SizeMUS

func (v UnlockObject) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*UnlockObject) UnmarshalMUS

func (v *UnlockObject) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type UserAction

type UserAction struct {
	Value Trigger `json:"value"`
}

func (*UserAction) GetType

func (g *UserAction) GetType() MsgType

func (UserAction) MarshalMUS

func (v UserAction) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (UserAction) SizeMUS

func (v UserAction) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*UserAction) UnmarshalMUS

func (v *UserAction) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type UserData

type UserData struct {
	ID        umid.UMID              `json:"id"`
	Name      string                 `json:"name"`
	Avatar    string                 `json:"avatar"`
	Transform cmath.TransformNoScale `json:"transform"`
	IsGuest   bool                   `json:"is_guest"`
}

func (*UserData) GetType

func (a *UserData) GetType() MsgType

func (UserData) MarshalMUS

func (v UserData) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (UserData) SizeMUS

func (v UserData) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*UserData) UnmarshalMUS

func (v *UserData) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type UserStakedToOdyssey

type UserStakedToOdyssey struct {
	TransactionHash string    `json:"transaction_hash"`
	Wallet          string    `json:"wallet"`
	ObjectID        umid.UMID `json:"object_id"`
	Amount          string    `json:"amount"`
	Comment         string    `json:"comment"`
	Kind            int       `json:"kind"`
}

func (*UserStakedToOdyssey) GetType

func (r *UserStakedToOdyssey) GetType() MsgType

func (UserStakedToOdyssey) MarshalMUS

func (v UserStakedToOdyssey) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (UserStakedToOdyssey) SizeMUS

func (v UserStakedToOdyssey) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*UserStakedToOdyssey) UnmarshalMUS

func (v *UserStakedToOdyssey) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type UserTransform

type UserTransform struct {
	ID        umid.UMID              `json:"id"`
	Transform cmath.TransformNoScale `json:"transform"`
}

UserTransform is a transform to apply to a specific user.

func (*UserTransform) GetType

func (s *UserTransform) GetType() MsgType

func (UserTransform) MarshalMUS

func (v UserTransform) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (UserTransform) SizeMUS

func (v UserTransform) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*UserTransform) UnmarshalMUS

func (v *UserTransform) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type UsersTransformList

type UsersTransformList struct {
	Value []UserTransform `json:"value"`
}

func (*UsersTransformList) GetType

func (s *UsersTransformList) GetType() MsgType

func (UsersTransformList) MarshalMUS

func (v UsersTransformList) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (UsersTransformList) SizeMUS

func (v UsersTransformList) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*UsersTransformList) UnmarshalMUS

func (v *UsersTransformList) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type VisualEffect

type VisualEffect struct {
	Name string `json:"name"`
}

FIXME: finalize VisualEffect type with all data

func (VisualEffect) MarshalMUS

func (v VisualEffect) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (VisualEffect) SizeMUS

func (v VisualEffect) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*VisualEffect) UnmarshalMUS

func (v *VisualEffect) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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