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
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() *JoinRandomGroup
NewJoinRandomGroup creates a new instance of JoinRandomGroup struct.
func (proto *JoinRandomGroup) GetCmd() uint16
func (proto *JoinRandomGroup) GetVer() uint8
func (proto *JoinRandomGroup) Pack() []byte
Pack encodes JoinRandomGroup struct to a byte array to be delivered over the command.
func (proto *JoinRandomGroup) String() string
func (proto *JoinRandomGroup) Unpack(bytes []byte) error
Unpack decodes the command payload byte array to JoinRandomGroup struct.
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() *JoinRandomGroupResponsePayload
NewJoinRandomGroupResponsePayload creates a new instance of JoinRandomGroupResponsePayload struct.
func (proto *JoinRandomGroupResponsePayload) GetCmd() uint16
func (proto *JoinRandomGroupResponsePayload) GetVer() uint8
func (proto *JoinRandomGroupResponsePayload) Pack() []byte
Pack encodes JoinRandomGroupResponsePayload struct to a byte array to be delivered over the command.
func (proto *JoinRandomGroupResponsePayload) String() string
func (proto *JoinRandomGroupResponsePayload) Unpack(bytes []byte) error
Unpack decodes the command payload byte array to JoinRandomGroupResponsePayload struct.