...

Package groupsupport

import "github.com/Diarkis/diarkis/proto/go/groupsupport"
Overview
Index

Overview ▾

Code generated by Diarkis Puffer module: DO NOT EDIT.

Auto-generated by Diarkis Version 1.0.0

- Maximum length of a string is 65535 bytes - Maximum length of a byte array is 65535 bytes - Maximum length of any array is 65535 elements

Code generated by Diarkis Puffer module: DO NOT EDIT.

Auto-generated by Diarkis Version 1.0.0

- Maximum length of a string is 65535 bytes - Maximum length of a byte array is 65535 bytes - Maximum length of any array is 65535 elements

Constants

JoinRandomGroupCmd 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 JoinRandomGroupCmd uint16 = 114

JoinRandomGroupResponsePayloadCmd 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 JoinRandomGroupResponsePayloadCmd uint16 = 0

JoinRandomGroupResponsePayloadVer 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 JoinRandomGroupResponsePayloadVer uint8 = 0

JoinRandomGroupVer 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 JoinRandomGroupVer uint8 = 1

type JoinRandomGroup

JoinRandomGroup represents the command protocol data structure.

type JoinRandomGroup struct {
    // Command version of the protocol
    Ver uint8
    // Command ID of the protocol
    Cmd uint16
    // If true, the group will not be deleted until TTL expires even if all members leave
    AllowEmpty bool
    // Broadcast interval in milliseconds. Interval below 100ms will be forced to 0. If it's 0, no packet merge
    Interval uint16
    // If true, the creator user will join the group automatically
    Join bool
    // Message to be sent when random join is successful.
    Message string
    // TTL of the group in seconds
    Ttl uint16
}

func NewJoinRandomGroup

func NewJoinRandomGroup() *JoinRandomGroup

NewJoinRandomGroup creates a new instance of JoinRandomGroup struct.

func (*JoinRandomGroup) GetCmd

func (proto *JoinRandomGroup) GetCmd() uint16

func (*JoinRandomGroup) GetVer

func (proto *JoinRandomGroup) GetVer() uint8

func (*JoinRandomGroup) Pack

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

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

func (*JoinRandomGroup) String

func (proto *JoinRandomGroup) String() string

func (*JoinRandomGroup) Unpack

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

Unpack decodes the command payload byte array to JoinRandomGroup struct.

type JoinRandomGroupResponsePayload

JoinRandomGroupResponsePayload represents the command protocol data structure.

type JoinRandomGroupResponsePayload struct {
    // Command version of the protocol
    Ver uint8
    // Command ID of the protocol
    Cmd uint16
    // 0: create, 1: join
    Flag uint8
    // Group ID
    GroupID string
}

func NewJoinRandomGroupResponsePayload

func NewJoinRandomGroupResponsePayload() *JoinRandomGroupResponsePayload

NewJoinRandomGroupResponsePayload creates a new instance of JoinRandomGroupResponsePayload struct.

func (*JoinRandomGroupResponsePayload) GetCmd

func (proto *JoinRandomGroupResponsePayload) GetCmd() uint16

func (*JoinRandomGroupResponsePayload) GetVer

func (proto *JoinRandomGroupResponsePayload) GetVer() uint8

func (*JoinRandomGroupResponsePayload) Pack

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

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

func (*JoinRandomGroupResponsePayload) String

func (proto *JoinRandomGroupResponsePayload) String() string

func (*JoinRandomGroupResponsePayload) Unpack

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

Unpack decodes the command payload byte array to JoinRandomGroupResponsePayload struct.