File Channel.lua
Functions
GwChannel:clear () | Clear the channel configuration. |
GwChannel:configure (version, name, password) | Configure the channel. |
GwChannel:isConfigured () | Test if the channel is configured. |
GwChannel:isConnected () | Check if a connection exists to the custom channel. |
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, ..., message) | Sends an encoded message on the shared channel. |
GwChannel:tlDequeue () | Remove a segment from the channel transmit queue. |
GwChannel:tlEnqueue (segment) | Add a segment to the channel transmit queue. |
GwChannel:tlFlush () | Transmit all messages in the channel transmit queue. |
Functions
- GwChannel:clear ()
- Clear the channel configuration.
- GwChannel:configure (version, name, password)
-
Configure the channel.
Parameters:
-
version
: Messaging version. -
name
: Name of the channel. -
password
: Password for the channel. (optional)
-
- GwChannel:isConfigured ()
-
Test if the channel is configured.
Return value:
- True if configured, false otherwise.
- GwChannel:isConnected ()
-
Check if a connection exists to the custom channel.
Return value:
- True if connected, otherwise false.
- 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, ..., message)
-
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 -
...
: -
message
: Text of the message.
-
- GwChannel:tlDequeue ()
-
Remove a segment from the channel transmit queue.
Return value:
- Segment removed from the queue or nil if queue is empty.
- GwChannel:tlEnqueue (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:tlFlush ()
-
Transmit all messages in the channel transmit queue.
Return value:
- Number of messages flushed.