package dgs

import "github.com/Diarkis/diarkis/proto/go/dgs"

Index

Constants

const InstanceCreateCmd uint16 = 50000

InstanceCreateCmd represents the command ID of the protocol's command ID.

[NOTE] The value is optional and if cmd is not given in the definition JSON, it will be 0.
const InstanceCreateVer uint8 = 2

InstanceCreateVer represents the ver of the protocol's command.

[NOTE] The value is optional and if ver is not given in the definition JSON, it will be 0.
const PushInstanceCreateCmd uint16 = 50000

PushInstanceCreateCmd represents the command ID of the protocol's command ID.

[NOTE] The value is optional and if cmd is not given in the definition JSON, it will be 0.
const PushInstanceCreateVer uint8 = 2

PushInstanceCreateVer represents the ver of the protocol's command.

[NOTE] The value is optional and if ver is not given in the definition JSON, it will be 0.
const ResponseInstanceCreateCmd uint16 = 50000

ResponseInstanceCreateCmd represents the command ID of the protocol's command ID.

[NOTE] The value is optional and if cmd is not given in the definition JSON, it will be 0.
const ResponseInstanceCreateVer uint8 = 2

ResponseInstanceCreateVer represents the ver of the protocol's command.

[NOTE] The value is optional and if ver is not given in the definition JSON, it will be 0.

Types

type InstanceCreate

type InstanceCreate struct {
	// Command version of the protocol
	Ver uint8
	// Command ID of the protocol
	Cmd uint16
	// Member IDs of users connected to same server as host to join the DGS.
	MemberIDs []string
	// Metadata payload for instance creation (used to enable user security keys).
	Metadata []byte
}

InstanceCreate represents the command protocol data structure.

func NewInstanceCreate

func NewInstanceCreate() *InstanceCreate

NewInstanceCreate creates a new instance of InstanceCreate struct.

func (*InstanceCreate) GetCmd

func (proto *InstanceCreate) GetCmd() uint16

func (*InstanceCreate) GetVer

func (proto *InstanceCreate) GetVer() uint8

func (*InstanceCreate) Pack

func (proto *InstanceCreate) Pack() []byte

Pack encodes InstanceCreate struct to a byte array to be delivered over the command.

func (*InstanceCreate) PackedSize

func (proto *InstanceCreate) PackedSize() int

PackedSize returns the estimated packed size of the struct.

func (*InstanceCreate) String

func (proto *InstanceCreate) String() string

func (*InstanceCreate) Unpack

func (proto *InstanceCreate) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to InstanceCreate struct.

type PushInstanceCreate

type PushInstanceCreate struct {
	// Command version of the protocol
	Ver uint8
	// Command ID of the protocol
	Cmd uint16
	// IV of remote DGS user.
	IV []byte
	// Key of remote DGS user.
	Key []byte
	// MacKey of remote DGS user.
	MacKey []byte
	// SID of remote DGS user.
	SID []byte
	// Host of remote DGS.
	ServerHost string
	// Port of remote DGS.
	ServerPort uint16
	// Server type of remote DGS.
	ServerType string
	// UID of remote DGS user.
	UID string
}

PushInstanceCreate represents the command protocol data structure.

func NewPushInstanceCreate

func NewPushInstanceCreate() *PushInstanceCreate

NewPushInstanceCreate creates a new instance of PushInstanceCreate struct.

func (*PushInstanceCreate) GetCmd

func (proto *PushInstanceCreate) GetCmd() uint16

func (*PushInstanceCreate) GetVer

func (proto *PushInstanceCreate) GetVer() uint8

func (*PushInstanceCreate) Pack

func (proto *PushInstanceCreate) Pack() []byte

Pack encodes PushInstanceCreate struct to a byte array to be delivered over the command.

func (*PushInstanceCreate) PackedSize

func (proto *PushInstanceCreate) PackedSize() int

PackedSize returns the estimated packed size of the struct.

func (*PushInstanceCreate) String

func (proto *PushInstanceCreate) String() string

func (*PushInstanceCreate) Unpack

func (proto *PushInstanceCreate) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to PushInstanceCreate struct.

type ResponseInstanceCreate

type ResponseInstanceCreate struct {
	// Command version of the protocol
	Ver uint8
	// Command ID of the protocol
	Cmd uint16
	// Serialized credentials to join remote DGS.
	Credentials []byte
}

ResponseInstanceCreate represents the command protocol data structure.

func NewResponseInstanceCreate

func NewResponseInstanceCreate() *ResponseInstanceCreate

NewResponseInstanceCreate creates a new instance of ResponseInstanceCreate struct.

func (*ResponseInstanceCreate) GetCmd

func (proto *ResponseInstanceCreate) GetCmd() uint16

func (*ResponseInstanceCreate) GetVer

func (proto *ResponseInstanceCreate) GetVer() uint8

func (*ResponseInstanceCreate) Pack

func (proto *ResponseInstanceCreate) Pack() []byte

Pack encodes ResponseInstanceCreate struct to a byte array to be delivered over the command.

func (*ResponseInstanceCreate) PackedSize

func (proto *ResponseInstanceCreate) PackedSize() int

PackedSize returns the estimated packed size of the struct.

func (*ResponseInstanceCreate) String

func (proto *ResponseInstanceCreate) String() string

func (*ResponseInstanceCreate) Unpack

func (proto *ResponseInstanceCreate) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to ResponseInstanceCreate struct.