Send a public message.
The message is broadcasted to all users in the current room, including the sender.
The message is broadcasted to all users in the current room, including the sender.


- message (String)
- the text of the public message.
- roomId (Int32)
- the id of the target room, in case of multi-room join (optional, default value: activeRoomId).

Sends:
SFSEvent..::.OnPublicMessageDelegate
Version:
SmartFoxServer Basic / Pro

The following example shows how to send and receive a public message.
CopyC#

SFSEvent.onPublicMessage += OnPublicMessage; smartFox.SendPublicMessage("Hello world!"); public void OnPublicMessage(string message, User sender, int roomId) { Debug.WriteLine("User " + sender.getName() + " said: " + message); }