gogonet

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

README

gogonet

GoDot high-level networking for golang

Documentation

Index

Constants

View Source
const (
	NIL = iota

	// atomic types
	BOOL
	INT
	REAL
	STRING

	VECTOR2 // 5
	RECT2
	VECTOR3
	TRANSFORM2D
	PLANE
	QUAT // 10
	AABB
	BASIS
	TRANSFORM

	// misc types
	COLOR
	NODE_PATH // 15

	OBJECT
	DICTIONARY
	ARRAY

	// arrays
	POOL_BYTE_ARRAY // 20
	POOL_INT_ARRAY
	POOL_REAL_ARRAY
	POOL_STRING_ARRAY
	POOL_VECTOR2_ARRAY
	POOL_VECTOR3_ARRAY // 25
	POOL_COLOR_ARRAY

	VARIANT_MAX
)

Variables

This section is empty.

Functions

This section is empty.

Types

type INativeMethod

type INativeMethod interface {
	New() INativeMethod
	SetOwnerNode(INode)

	Name() string

	Call()
	Unmarshal(*StreamReader)
}

type INetworkPeer

type INetworkPeer interface {
	signals.ISubscribeable

	GetPacket() (source uint32, target int32, data []byte)
	PutPacket()
	ListenAndServe()
}

type INode

type INode interface {
	Name() string
	Path() string
	InstanceID() uint32

	NewNode(path string) INode
	GetNode(path string) INode
	GetOrNewNode(path string) INode

	AppendChild(node INode)
	AddNativeRPCMethod(method INativeMethod)

	Rpc(procedureName string, params ...interface{})
	RpcId(id int32, procedureName string, params ...interface{})

	RpcUnreliable(procedureName string, params ...interface{})
	RpcUnreliableId(id int32, procedureName string, params ...interface{})
	// contains filtered or unexported methods
}

func NewNode

func NewNode(name string) INode

type IScene

type IScene interface {
	INode

	Instance() INode
}

func GetOrNewScene

func GetOrNewScene(name string) IScene

func GetScene

func GetScene(name string) IScene

func NewScene

func NewScene(name string) IScene

type ITree

type ITree interface {
	INode

	SetScene(scene INode)
	SetNetworkPeer(peer INetworkPeer)
	ListenAndServe()
}

func GetTree

func GetTree() ITree

type MultiplayerAPI

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

func (*MultiplayerAPI) ListenAndServe

func (m *MultiplayerAPI) ListenAndServe()

func (*MultiplayerAPI) SetNetworkPeer

func (m *MultiplayerAPI) SetNetworkPeer(peer INetworkPeer)

type NetworkCommand

type NetworkCommand uint8
const (
	CommandRemoteCall   NetworkCommand = 0
	CommandRemoteSet    NetworkCommand = 1
	CommandSimplifyPath NetworkCommand = 2
	CommandConfirmPath  NetworkCommand = 3
	CommandRaw          NetworkCommand = 4
)

func (NetworkCommand) Uint8

func (i NetworkCommand) Uint8() uint8

type Node

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

func (*Node) AddNativeRPCMethod

func (n *Node) AddNativeRPCMethod(method INativeMethod)

func (*Node) AppendChild

func (n *Node) AppendChild(node INode)

func (*Node) GetNode

func (n *Node) GetNode(path string) INode

func (*Node) GetOrNewNode

func (n *Node) GetOrNewNode(path string) INode

func (*Node) Instance

func (n *Node) Instance() INode

Lets think that, /root is scene tree, like in godot, so we can call instance() method

func (*Node) InstanceID

func (n *Node) InstanceID() uint32

func (*Node) ListenAndServe

func (t *Node) ListenAndServe()

func (*Node) Name

func (n *Node) Name() string

func (*Node) NewNode

func (n *Node) NewNode(path string) (r INode)

Create child node, or if path is absolute, create node for this path

func (*Node) Path

func (n *Node) Path() (result string)

func (*Node) Rpc

func (n *Node) Rpc(procedureName string, params ...interface{})

func (*Node) RpcId

func (n *Node) RpcId(id int32, procedureName string, params ...interface{})

func (*Node) RpcUnreliable

func (n *Node) RpcUnreliable(procedureName string, params ...interface{})

func (*Node) RpcUnreliableId

func (n *Node) RpcUnreliableId(id int32, procedureName string, params ...interface{})

func (*Node) SetNetworkPeer

func (t *Node) SetNetworkPeer(peer INetworkPeer)

func (*Node) SetScene

func (t *Node) SetScene(scene INode)

type SentPathCache

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

type StreamReader

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

func NewStreamReader

func NewStreamReader(a []byte) *StreamReader

func (*StreamReader) ReadInt32

func (r *StreamReader) ReadInt32() (i int32)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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