Multicasting and Chatting¶
Multicasting and Chatting help broadcast a message to the players in the same channel.
Difference between them is that Multicasting handles any message in JSON or Protobuf, while Chatting is a special form of Multicasting with text messages. So, Chatting is implemented on top of Multicasting.
MANIFEST.json¶
To use Multicasting and Chatting, simply add MulticastServer
in the dependency list in MANIFEST.json.
Since MulticastServer
relies on RpcService
, you should turn rpc_enabled
to true, too.
(Please see RPC MANIFEST.json for about the RPC.)
MANIFEST.json file
{
"dependency": {
.....,
"MulticastServer": {
"max_member_count_per_channel": 0
},
....,
"RpcService": {
"rpc_enabled": true,
...
}
}
}
If you want to limit the maximum players in a single channel, sets
max_member_count_per_channel
to non-zero, positive integer. The value cannot be 1 because channel for a single member does not make any sense.
Required Server Code¶
No additional code is required to use Multicasting/Chatting.
Setting MANIFEST.json is only thing you should do.
After enabling through MANIFEST.json, the iFun Engine client plug-in will talk to the MulticastServer
component.
Required Client Code¶
iFun Engine plug-ins have already implemented the feature.
They are FunapiMulticastClient
and FunapiChatClient
.
So, you do not require additional coding to use the feature.
However, you cannot use Multicasting and Chatting at the same time. (This is subject to improvement.)
Please see Client Plug-in Multicasting & Chatting to figure out how to use.
Also, there’s an example code illustrating how to use the feature at GitHub engine-plugin-unity3d and GitHub FunapiMulticastClient.