types

package
v0.0.0-...-86510a5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnumControlNewInstance        int = 1
	EnumControlStartClientSession int = 2
	EnumControlStartServerSession int = 3
	EnumControlNewPlayerConnected int = 4
	EnumControlCreateSession      int = 5
	EnumControlConnectSession     int = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EnumMessageType

type EnumMessageType int

EnumMessageType typeof message

const (
	//EnumMessageControl control type message
	EnumMessageControl EnumMessageType = 1
	//EnumMessageMove move message type
	EnumMessageMove EnumMessageType = 2
	//EnumMessageCustom custom message type
	EnumMessageCustom EnumMessageType = 3
)

type Message

type Message struct {
	Type     EnumMessageType `json:"t"`
	SubType  int             `json:"s"`
	Message  string          `json:"m"`
	ClientId string          `json:"c,omitempty"`
}

func MessageFromString

func MessageFromString(inString string) (*Message, error)

func (*Message) ToString

func (m *Message) ToString() (string, error)

type NewInstanceConfig

type NewInstanceConfig struct {
	Websocket   bool `json:"w"` // Set to false to switch to WebRtc
	Multiplayer bool `json:"m"` // Multiple player can connect
}

func NewInstanceConfigFromString

func NewInstanceConfigFromString(inString string) (*NewInstanceConfig, error)

Jump to

Keyboard shortcuts

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