xaya / xmppbroadcast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XMPP Broadcast

This project implements a broadcast method for game channels that uses XMPP for the underlying communication.

Usage

Game-channel applications can use the XMPP broadcast in two ways:

  1. As a library: The project provides an XmppBroadcast class, which directly implements an ReceivingOffChainBroadcast that can be used when interacting with the game-channel library.

  2. 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 binary xmpp-broadcast-rpc-server), which the game channel can connect to using the standard RpcBroadcast. This allows to "XMPP-ify" existing applications in a modular way.

Details

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).

About

License:GNU General Public License v3.0


Languages

Language:C++ 94.7%Language:Makefile 3.0%Language:M4 2.3%Language:Shell 0.1%