File Channel.lua
Functions
GwChannel:age () | Mark the channel as stale. |
GwChannel:al_decode (mtype, message) | Adaptation layer decoding. |
GwChannel:clear () | Clear the channel configuration. |
GwChannel:configure (cversion, name, password) | Configure the channel. |
GwChannel:dump_status (label) | Dump the channel status. |
GwChannel:is_configured () | Test if the channel is configured. |
GwChannel:is_connected () | Check if a connection exists to the custom channel. |
GwChannel:is_stale () | Check if channel configuration is stale. |
GwChannel:join () | Join a bridge channel. |
GwChannel:leave () | Leave a bridge channel. |
GwChannel:new () | GwChannel constructor function. |
GwChannel:receive (f, ...) | Handler for data received on a channel. |
GwChannel:send (type, ...) | Sends an encoded message on the shared channel. |
GwChannel:tl_dequeue () | Remove a segment from the channel transmit queue. |
GwChannel:tl_enqueue (segment) | Add a segment to the channel transmit queue. |
GwChannel:tl_flush () | Transmit all messages in the channel transmit queue. |
Functions
- GwChannel:age ()
- Mark the channel as stale.
- GwChannel:al_decode (mtype, message)
-
Adaptation layer decoding.
Parameters:
-
mtype
: message type -
message
: message content
Return value:
- A table of message strings. Returns nil on error.
-
- GwChannel:clear ()
- Clear the channel configuration.
- GwChannel:configure (cversion, name, password)
-
Configure the channel.
Parameters:
-
cversion
: Configuration version. -
name
: Name of the channel. -
password
: Password for the channel. (optional)
-
- GwChannel:dump_status (label)
-
Dump the channel status.
Parameters:
-
label
: An identifier for the channel.
-
- GwChannel:is_configured ()
-
Test if the channel is configured.
Return value:
- True if configured, false otherwise.
- GwChannel:is_connected ()
-
Check if a connection exists to the custom channel.
Return value:
- True if connected, otherwise false.
- GwChannel:is_stale ()
-
Check if channel configuration is stale.
Return value:
- True if stale, false otherwise.
- GwChannel:join ()
-
Join a bridge channel.
Return value:
- True if connection success, false otherwise.
- GwChannel:leave ()
-
Leave a bridge channel.
Return value:
- True if a disconnection occurred, false otherwise.
- GwChannel:new ()
-
GwChannel constructor function.
Return value:
- An initialized GwChannel instance.
- GwChannel:receive (f, ...)
-
Handler for data received on a channel.
Parameters:
-
f
: A callback function. -
...
: The API event arguments.
Return value:
- The return value of f applied to the data.
-
- GwChannel:send (type, ...)
-
Sends an encoded message on the shared channel.
Parameters:
-
type
: The message type. Accepted values are: GW_MTYPE_CHAT GW_MTYPE_ACHIEVEMENT GW_MTYPE_BROADCAST GW_MTYPE_NOTICE GW_MTYPE_REQUEST GW_MTYPE_ADDON GW_MTYPE_EXTERNAL -
...
: Text of the message.
-
- GwChannel:tl_dequeue ()
-
Remove a segment from the channel transmit queue.
Return value:
- Segment removed from the queue or nil if queue is empty.
- GwChannel:tl_enqueue (segment)
-
Add a segment to the channel transmit queue.
Parameters:
-
segment
: Segment to enqueue.
Return value:
- Number of segments in queue after the insertion.
-
- GwChannel:tl_flush ()
-
Transmit all messages in the channel transmit queue.
Return value:
- Number of messages flushed.