Broadcast
This function can be used to send a packet of information to all users in all joined lobbies.
Syntax
- static bool Broadcast(const int messageid, BankStream* data, const int channel = 0, const int flags = 0)
- static bool Broadcast(const int messageid, Bank* data, const int channel = 0, const int flags = 0)
- static bool Broadcast(const int messageid, const int channel = 0, const int flags = 0)
- static bool Broadcast(const int messageid, std::string& data, const int channel = 0, const int flags = 0)
- static bool Broadcast(const int messageid, const void* data, const int size, const int channel = 0, const int flags = 0)
Parameters
- messageid: an ID for the message.
- data: an optional bit of data you can include in the message.
- channel: the channel the message will be received on.
- flags: by default packets are unreliable. This can be set to Reliable for important messages you don't want to lose, but by default this should be zero.
Returns
Returns true if the message was sent successfully.