net

package
v0.0.0-...-124f97e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AuthPacket_TypeID = 0xfe26553a53d9d276

AuthPacket_TypeID is the unique identifier for the type AuthPacket.

View Source
const EnterWorldPacket_TypeID = 0xd7296609ec1b130c

EnterWorldPacket_TypeID is the unique identifier for the type EnterWorldPacket.

View Source
const EntityDespawnPacket_TypeID = 0xe597cefc768f55cb

EntityDespawnPacket_TypeID is the unique identifier for the type EntityDespawnPacket.

View Source
const EntityMovePacket_TypeID = 0xf2786494a8b7e4d0

EntityMovePacket_TypeID is the unique identifier for the type EntityMovePacket.

View Source
const EntityObservePacket_TypeID = 0xc823831ca674c61b

EntityObservePacket_TypeID is the unique identifier for the type EntityObservePacket.

View Source
const EntitySpawnPacket_TypeID = 0x90a96340f29028ba

EntitySpawnPacket_TypeID is the unique identifier for the type EntitySpawnPacket.

View Source
const GamePort = 1423
View Source
const Packet_TypeID = 0xc7ca850fead659c0

Packet_TypeID is the unique identifier for the type Packet.

View Source
const Vec3_TypeID = 0xc7e9576dd1cb2dc1

Vec3_TypeID is the unique identifier for the type Vec3.

Variables

View Source
var ErrInvalidPacket = errors.New("invalid packet")
View Source
var ErrUnknownPacket = errors.New("unknown packet")

Functions

func RegisterSchema

func RegisterSchema(reg *schemas.Registry)

func ToVec3

func ToVec3(v Vec3) vec3.T

Types

type AuthPacket

type AuthPacket capnp.Struct

func NewAuthPacket

func NewAuthPacket(s *capnp.Segment) (AuthPacket, error)

func NewRootAuthPacket

func NewRootAuthPacket(s *capnp.Segment) (AuthPacket, error)

func ReadRootAuthPacket

func ReadRootAuthPacket(msg *capnp.Message) (AuthPacket, error)

func (AuthPacket) DecodeFromPtr

func (AuthPacket) DecodeFromPtr(p capnp.Ptr) AuthPacket

func (AuthPacket) EncodeAsPtr

func (s AuthPacket) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (AuthPacket) IsValid

func (s AuthPacket) IsValid() bool

func (AuthPacket) Message

func (s AuthPacket) Message() *capnp.Message

func (AuthPacket) Segment

func (s AuthPacket) Segment() *capnp.Segment

func (AuthPacket) SetToken

func (s AuthPacket) SetToken(v uint64)

func (AuthPacket) String

func (s AuthPacket) String() string

func (AuthPacket) ToPtr

func (s AuthPacket) ToPtr() capnp.Ptr

func (AuthPacket) Token

func (s AuthPacket) Token() uint64

type AuthPacket_Future

type AuthPacket_Future struct{ *capnp.Future }

AuthPacket_Future is a wrapper for a AuthPacket promised by a client call.

func (AuthPacket_Future) Struct

func (f AuthPacket_Future) Struct() (AuthPacket, error)

type AuthPacket_List

type AuthPacket_List = capnp.StructList[AuthPacket]

AuthPacket_List is a list of AuthPacket.

func NewAuthPacket_List

func NewAuthPacket_List(s *capnp.Segment, sz int32) (AuthPacket_List, error)

NewAuthPacket creates a new list of AuthPacket.

type EnterWorldPacket

type EnterWorldPacket capnp.Struct

func NewEnterWorldPacket

func NewEnterWorldPacket(s *capnp.Segment) (EnterWorldPacket, error)

func NewRootEnterWorldPacket

func NewRootEnterWorldPacket(s *capnp.Segment) (EnterWorldPacket, error)

func ReadRootEnterWorldPacket

func ReadRootEnterWorldPacket(msg *capnp.Message) (EnterWorldPacket, error)

func (EnterWorldPacket) DecodeFromPtr

func (EnterWorldPacket) DecodeFromPtr(p capnp.Ptr) EnterWorldPacket

func (EnterWorldPacket) EncodeAsPtr

func (s EnterWorldPacket) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (EnterWorldPacket) HasMap

func (s EnterWorldPacket) HasMap() bool

func (EnterWorldPacket) IsValid

func (s EnterWorldPacket) IsValid() bool

func (EnterWorldPacket) Map

func (s EnterWorldPacket) Map() (string, error)

func (EnterWorldPacket) MapBytes

func (s EnterWorldPacket) MapBytes() ([]byte, error)

func (EnterWorldPacket) Message

func (s EnterWorldPacket) Message() *capnp.Message

func (EnterWorldPacket) Segment

func (s EnterWorldPacket) Segment() *capnp.Segment

func (EnterWorldPacket) SetMap

func (s EnterWorldPacket) SetMap(v string) error

func (EnterWorldPacket) String

func (s EnterWorldPacket) String() string

func (EnterWorldPacket) ToPtr

func (s EnterWorldPacket) ToPtr() capnp.Ptr

type EnterWorldPacket_Future

type EnterWorldPacket_Future struct{ *capnp.Future }

EnterWorldPacket_Future is a wrapper for a EnterWorldPacket promised by a client call.

func (EnterWorldPacket_Future) Struct

type EnterWorldPacket_List

type EnterWorldPacket_List = capnp.StructList[EnterWorldPacket]

EnterWorldPacket_List is a list of EnterWorldPacket.

func NewEnterWorldPacket_List

func NewEnterWorldPacket_List(s *capnp.Segment, sz int32) (EnterWorldPacket_List, error)

NewEnterWorldPacket creates a new list of EnterWorldPacket.

type EntityDespawnPacket

type EntityDespawnPacket capnp.Struct

func NewEntityDespawnPacket

func NewEntityDespawnPacket(s *capnp.Segment) (EntityDespawnPacket, error)

func NewRootEntityDespawnPacket

func NewRootEntityDespawnPacket(s *capnp.Segment) (EntityDespawnPacket, error)

func ReadRootEntityDespawnPacket

func ReadRootEntityDespawnPacket(msg *capnp.Message) (EntityDespawnPacket, error)

func (EntityDespawnPacket) DecodeFromPtr

func (EntityDespawnPacket) EncodeAsPtr

func (s EntityDespawnPacket) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (EntityDespawnPacket) Entity

func (s EntityDespawnPacket) Entity() uint64

func (EntityDespawnPacket) IsValid

func (s EntityDespawnPacket) IsValid() bool

func (EntityDespawnPacket) Message

func (s EntityDespawnPacket) Message() *capnp.Message

func (EntityDespawnPacket) Segment

func (s EntityDespawnPacket) Segment() *capnp.Segment

func (EntityDespawnPacket) SetEntity

func (s EntityDespawnPacket) SetEntity(v uint64)

func (EntityDespawnPacket) String

func (s EntityDespawnPacket) String() string

func (EntityDespawnPacket) ToPtr

func (s EntityDespawnPacket) ToPtr() capnp.Ptr

type EntityDespawnPacket_Future

type EntityDespawnPacket_Future struct{ *capnp.Future }

EntityDespawnPacket_Future is a wrapper for a EntityDespawnPacket promised by a client call.

func (EntityDespawnPacket_Future) Struct

type EntityDespawnPacket_List

type EntityDespawnPacket_List = capnp.StructList[EntityDespawnPacket]

EntityDespawnPacket_List is a list of EntityDespawnPacket.

func NewEntityDespawnPacket_List

func NewEntityDespawnPacket_List(s *capnp.Segment, sz int32) (EntityDespawnPacket_List, error)

NewEntityDespawnPacket creates a new list of EntityDespawnPacket.

type EntityMovePacket

type EntityMovePacket capnp.Struct

func NewEntityMovePacket

func NewEntityMovePacket(s *capnp.Segment) (EntityMovePacket, error)

func NewRootEntityMovePacket

func NewRootEntityMovePacket(s *capnp.Segment) (EntityMovePacket, error)

func ReadRootEntityMovePacket

func ReadRootEntityMovePacket(msg *capnp.Message) (EntityMovePacket, error)

func (EntityMovePacket) DecodeFromPtr

func (EntityMovePacket) DecodeFromPtr(p capnp.Ptr) EntityMovePacket

func (EntityMovePacket) Delta

func (s EntityMovePacket) Delta() float32

func (EntityMovePacket) EncodeAsPtr

func (s EntityMovePacket) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (EntityMovePacket) Entity

func (s EntityMovePacket) Entity() uint64

func (EntityMovePacket) HasPosition

func (s EntityMovePacket) HasPosition() bool

func (EntityMovePacket) IsValid

func (s EntityMovePacket) IsValid() bool

func (EntityMovePacket) Message

func (s EntityMovePacket) Message() *capnp.Message

func (EntityMovePacket) NewPosition

func (s EntityMovePacket) NewPosition() (Vec3, error)

NewPosition sets the position field to a newly allocated Vec3 struct, preferring placement in s's segment.

func (EntityMovePacket) Position

func (s EntityMovePacket) Position() (Vec3, error)

func (EntityMovePacket) Rotation

func (s EntityMovePacket) Rotation() float32

func (EntityMovePacket) Segment

func (s EntityMovePacket) Segment() *capnp.Segment

func (EntityMovePacket) SetDelta

func (s EntityMovePacket) SetDelta(v float32)

func (EntityMovePacket) SetEntity

func (s EntityMovePacket) SetEntity(v uint64)

func (EntityMovePacket) SetPosition

func (s EntityMovePacket) SetPosition(v Vec3) error

func (EntityMovePacket) SetRotation

func (s EntityMovePacket) SetRotation(v float32)

func (EntityMovePacket) SetStopped

func (s EntityMovePacket) SetStopped(v bool)

func (EntityMovePacket) Stopped

func (s EntityMovePacket) Stopped() bool

func (EntityMovePacket) String

func (s EntityMovePacket) String() string

func (EntityMovePacket) ToPtr

func (s EntityMovePacket) ToPtr() capnp.Ptr

type EntityMovePacket_Future

type EntityMovePacket_Future struct{ *capnp.Future }

EntityMovePacket_Future is a wrapper for a EntityMovePacket promised by a client call.

func (EntityMovePacket_Future) Position

func (p EntityMovePacket_Future) Position() Vec3_Future

func (EntityMovePacket_Future) Struct

type EntityMovePacket_List

type EntityMovePacket_List = capnp.StructList[EntityMovePacket]

EntityMovePacket_List is a list of EntityMovePacket.

func NewEntityMovePacket_List

func NewEntityMovePacket_List(s *capnp.Segment, sz int32) (EntityMovePacket_List, error)

NewEntityMovePacket creates a new list of EntityMovePacket.

type EntityObservePacket

type EntityObservePacket capnp.Struct

func NewEntityObservePacket

func NewEntityObservePacket(s *capnp.Segment) (EntityObservePacket, error)

func NewRootEntityObservePacket

func NewRootEntityObservePacket(s *capnp.Segment) (EntityObservePacket, error)

func ReadRootEntityObservePacket

func ReadRootEntityObservePacket(msg *capnp.Message) (EntityObservePacket, error)

func (EntityObservePacket) DecodeFromPtr

func (EntityObservePacket) EncodeAsPtr

func (s EntityObservePacket) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (EntityObservePacket) Entity

func (s EntityObservePacket) Entity() uint64

func (EntityObservePacket) IsValid

func (s EntityObservePacket) IsValid() bool

func (EntityObservePacket) Message

func (s EntityObservePacket) Message() *capnp.Message

func (EntityObservePacket) Segment

func (s EntityObservePacket) Segment() *capnp.Segment

func (EntityObservePacket) SetEntity

func (s EntityObservePacket) SetEntity(v uint64)

func (EntityObservePacket) String

func (s EntityObservePacket) String() string

func (EntityObservePacket) ToPtr

func (s EntityObservePacket) ToPtr() capnp.Ptr

type EntityObservePacket_Future

type EntityObservePacket_Future struct{ *capnp.Future }

EntityObservePacket_Future is a wrapper for a EntityObservePacket promised by a client call.

func (EntityObservePacket_Future) Struct

type EntityObservePacket_List

type EntityObservePacket_List = capnp.StructList[EntityObservePacket]

EntityObservePacket_List is a list of EntityObservePacket.

func NewEntityObservePacket_List

func NewEntityObservePacket_List(s *capnp.Segment, sz int32) (EntityObservePacket_List, error)

NewEntityObservePacket creates a new list of EntityObservePacket.

type EntitySpawnPacket

type EntitySpawnPacket capnp.Struct

func NewEntitySpawnPacket

func NewEntitySpawnPacket(s *capnp.Segment) (EntitySpawnPacket, error)

func NewRootEntitySpawnPacket

func NewRootEntitySpawnPacket(s *capnp.Segment) (EntitySpawnPacket, error)

func ReadRootEntitySpawnPacket

func ReadRootEntitySpawnPacket(msg *capnp.Message) (EntitySpawnPacket, error)

func (EntitySpawnPacket) DecodeFromPtr

func (EntitySpawnPacket) DecodeFromPtr(p capnp.Ptr) EntitySpawnPacket

func (EntitySpawnPacket) EncodeAsPtr

func (s EntitySpawnPacket) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (EntitySpawnPacket) Entity

func (s EntitySpawnPacket) Entity() uint64

func (EntitySpawnPacket) HasPosition

func (s EntitySpawnPacket) HasPosition() bool

func (EntitySpawnPacket) IsValid

func (s EntitySpawnPacket) IsValid() bool

func (EntitySpawnPacket) Message

func (s EntitySpawnPacket) Message() *capnp.Message

func (EntitySpawnPacket) NewPosition

func (s EntitySpawnPacket) NewPosition() (Vec3, error)

NewPosition sets the position field to a newly allocated Vec3 struct, preferring placement in s's segment.

func (EntitySpawnPacket) Position

func (s EntitySpawnPacket) Position() (Vec3, error)

func (EntitySpawnPacket) Rotation

func (s EntitySpawnPacket) Rotation() float32

func (EntitySpawnPacket) Segment

func (s EntitySpawnPacket) Segment() *capnp.Segment

func (EntitySpawnPacket) SetEntity

func (s EntitySpawnPacket) SetEntity(v uint64)

func (EntitySpawnPacket) SetPosition

func (s EntitySpawnPacket) SetPosition(v Vec3) error

func (EntitySpawnPacket) SetRotation

func (s EntitySpawnPacket) SetRotation(v float32)

func (EntitySpawnPacket) String

func (s EntitySpawnPacket) String() string

func (EntitySpawnPacket) ToPtr

func (s EntitySpawnPacket) ToPtr() capnp.Ptr

type EntitySpawnPacket_Future

type EntitySpawnPacket_Future struct{ *capnp.Future }

EntitySpawnPacket_Future is a wrapper for a EntitySpawnPacket promised by a client call.

func (EntitySpawnPacket_Future) Position

func (EntitySpawnPacket_Future) Struct

type EntitySpawnPacket_List

type EntitySpawnPacket_List = capnp.StructList[EntitySpawnPacket]

EntitySpawnPacket_List is a list of EntitySpawnPacket.

func NewEntitySpawnPacket_List

func NewEntitySpawnPacket_List(s *capnp.Segment, sz int32) (EntitySpawnPacket_List, error)

NewEntitySpawnPacket creates a new list of EntitySpawnPacket.

type Message

type Message interface {
	Message() *capnp.Message
}

type Packet

type Packet capnp.Struct

func NewPacket

func NewPacket(s *capnp.Segment) (Packet, error)

func NewRootPacket

func NewRootPacket(s *capnp.Segment) (Packet, error)

func ReadRootPacket

func ReadRootPacket(msg *capnp.Message) (Packet, error)

func (Packet) Auth

func (s Packet) Auth() (AuthPacket, error)

func (Packet) DecodeFromPtr

func (Packet) DecodeFromPtr(p capnp.Ptr) Packet

func (Packet) EncodeAsPtr

func (s Packet) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (Packet) EnterWorld

func (s Packet) EnterWorld() (EnterWorldPacket, error)

func (Packet) EntityDespawn

func (s Packet) EntityDespawn() (EntityDespawnPacket, error)

func (Packet) EntityMove

func (s Packet) EntityMove() (EntityMovePacket, error)

func (Packet) EntityObserve

func (s Packet) EntityObserve() (EntityObservePacket, error)

func (Packet) EntitySpawn

func (s Packet) EntitySpawn() (EntitySpawnPacket, error)

func (Packet) HasAuth

func (s Packet) HasAuth() bool

func (Packet) HasEnterWorld

func (s Packet) HasEnterWorld() bool

func (Packet) HasEntityDespawn

func (s Packet) HasEntityDespawn() bool

func (Packet) HasEntityMove

func (s Packet) HasEntityMove() bool

func (Packet) HasEntityObserve

func (s Packet) HasEntityObserve() bool

func (Packet) HasEntitySpawn

func (s Packet) HasEntitySpawn() bool

func (Packet) IsValid

func (s Packet) IsValid() bool

func (Packet) Message

func (s Packet) Message() *capnp.Message

func (Packet) NewAuth

func (s Packet) NewAuth() (AuthPacket, error)

NewAuth sets the auth field to a newly allocated AuthPacket struct, preferring placement in s's segment.

func (Packet) NewEnterWorld

func (s Packet) NewEnterWorld() (EnterWorldPacket, error)

NewEnterWorld sets the enterWorld field to a newly allocated EnterWorldPacket struct, preferring placement in s's segment.

func (Packet) NewEntityDespawn

func (s Packet) NewEntityDespawn() (EntityDespawnPacket, error)

NewEntityDespawn sets the entityDespawn field to a newly allocated EntityDespawnPacket struct, preferring placement in s's segment.

func (Packet) NewEntityMove

func (s Packet) NewEntityMove() (EntityMovePacket, error)

NewEntityMove sets the entityMove field to a newly allocated EntityMovePacket struct, preferring placement in s's segment.

func (Packet) NewEntityObserve

func (s Packet) NewEntityObserve() (EntityObservePacket, error)

NewEntityObserve sets the entityObserve field to a newly allocated EntityObservePacket struct, preferring placement in s's segment.

func (Packet) NewEntitySpawn

func (s Packet) NewEntitySpawn() (EntitySpawnPacket, error)

NewEntitySpawn sets the entitySpawn field to a newly allocated EntitySpawnPacket struct, preferring placement in s's segment.

func (Packet) Segment

func (s Packet) Segment() *capnp.Segment

func (Packet) SetAuth

func (s Packet) SetAuth(v AuthPacket) error

func (Packet) SetEnterWorld

func (s Packet) SetEnterWorld(v EnterWorldPacket) error

func (Packet) SetEntityDespawn

func (s Packet) SetEntityDespawn(v EntityDespawnPacket) error

func (Packet) SetEntityMove

func (s Packet) SetEntityMove(v EntityMovePacket) error

func (Packet) SetEntityObserve

func (s Packet) SetEntityObserve(v EntityObservePacket) error

func (Packet) SetEntitySpawn

func (s Packet) SetEntitySpawn(v EntitySpawnPacket) error

func (Packet) SetUnknown

func (s Packet) SetUnknown()

func (Packet) String

func (s Packet) String() string

func (Packet) ToPtr

func (s Packet) ToPtr() capnp.Ptr

func (Packet) Which

func (s Packet) Which() Packet_Which

type Packet_Future

type Packet_Future struct{ *capnp.Future }

Packet_Future is a wrapper for a Packet promised by a client call.

func (Packet_Future) Auth

func (Packet_Future) EnterWorld

func (p Packet_Future) EnterWorld() EnterWorldPacket_Future

func (Packet_Future) EntityDespawn

func (p Packet_Future) EntityDespawn() EntityDespawnPacket_Future

func (Packet_Future) EntityMove

func (p Packet_Future) EntityMove() EntityMovePacket_Future

func (Packet_Future) EntityObserve

func (p Packet_Future) EntityObserve() EntityObservePacket_Future

func (Packet_Future) EntitySpawn

func (p Packet_Future) EntitySpawn() EntitySpawnPacket_Future

func (Packet_Future) Struct

func (f Packet_Future) Struct() (Packet, error)

type Packet_List

type Packet_List = capnp.StructList[Packet]

Packet_List is a list of Packet.

func NewPacket_List

func NewPacket_List(s *capnp.Segment, sz int32) (Packet_List, error)

NewPacket creates a new list of Packet.

type Packet_Which

type Packet_Which uint16
const (
	Packet_Which_unknown       Packet_Which = 0
	Packet_Which_auth          Packet_Which = 1
	Packet_Which_enterWorld    Packet_Which = 2
	Packet_Which_entityMove    Packet_Which = 3
	Packet_Which_entitySpawn   Packet_Which = 4
	Packet_Which_entityObserve Packet_Which = 5
	Packet_Which_entityDespawn Packet_Which = 6
)

func (Packet_Which) String

func (w Packet_Which) String() string

type Vec3

type Vec3 capnp.Struct

func FromVec3

func FromVec3(seg *capnp.Segment, v vec3.T) (Vec3, error)

func NewRootVec3

func NewRootVec3(s *capnp.Segment) (Vec3, error)

func NewVec3

func NewVec3(s *capnp.Segment) (Vec3, error)

func ReadRootVec3

func ReadRootVec3(msg *capnp.Message) (Vec3, error)

func (Vec3) DecodeFromPtr

func (Vec3) DecodeFromPtr(p capnp.Ptr) Vec3

func (Vec3) EncodeAsPtr

func (s Vec3) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr

func (Vec3) IsValid

func (s Vec3) IsValid() bool

func (Vec3) Message

func (s Vec3) Message() *capnp.Message

func (Vec3) Segment

func (s Vec3) Segment() *capnp.Segment

func (Vec3) SetX

func (s Vec3) SetX(v float32)

func (Vec3) SetY

func (s Vec3) SetY(v float32)

func (Vec3) SetZ

func (s Vec3) SetZ(v float32)

func (Vec3) String

func (s Vec3) String() string

func (Vec3) ToPtr

func (s Vec3) ToPtr() capnp.Ptr

func (Vec3) X

func (s Vec3) X() float32

func (Vec3) Y

func (s Vec3) Y() float32

func (Vec3) Z

func (s Vec3) Z() float32

type Vec3_Future

type Vec3_Future struct{ *capnp.Future }

Vec3_Future is a wrapper for a Vec3 promised by a client call.

func (Vec3_Future) Struct

func (f Vec3_Future) Struct() (Vec3, error)

type Vec3_List

type Vec3_List = capnp.StructList[Vec3]

Vec3_List is a list of Vec3.

func NewVec3_List

func NewVec3_List(s *capnp.Segment, sz int32) (Vec3_List, error)

NewVec3 creates a new list of Vec3.

Jump to

Keyboard shortcuts

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