This project implements a broadcast method for game channels that uses XMPP for the underlying communication.
Game-channel applications can use the XMPP broadcast in two ways:
-
As a library: The project provides an
XmppBroadcast
class, which directly implements anReceivingOffChainBroadcast
that can be used when interacting with the game-channel library. -
As a local RPC server: It is also possible to launch a local RPC server (through the library's
RpcServer
class or the stand-alone binaryxmpp-broadcast-rpc-server
), which the game channel can connect to using the standardRpcBroadcast
. This allows to "XMPP-ify" existing applications in a modular way.
The communications for each channel are done in a temporary MUC channel
on the XMPP server, named as gameid_channelid
. This allows all participants
to join the channel as needed, and send / receive messages through it.
Each channel message is encoded into a custom stanza tag of this form:
<msg xmlns="https://xaya.io/xmppbroadcast">
encoded payload
</msg>
The tag (especially the encoded payload) is created with Charon's xmldata
library.
On the XMPP side, the encoded payload corresponds directly to the raw broadcast data from the game-channels library. In the RPC server, this data is additionally base64-encoded on the side of the RPC client (but not when sent to XMPP).