BACKND Chat Structure
BACKND Chat follows the TCP server/client model.
Event formats
Send messages
When a method is called from the client to the server to send a message, the SDK puts the data the client wants to send in a send queue and sends it in order.
Receive messages
The message sent by the server is put in the receive queue in the SDK, and taken out in order and reprocessed into an event format to generate an event on the client.
Poll method
In order to send the message that exists in the send queue and reprocess the message that exists in the receive queue and call it in an event format, the client must periodically call the Poll method.
It is recommended to call the Poll method in the Update method of the Unity object in BACKND.
Developers can call Poll in any desired manner, such as calling Poll by creating a coroutine or calling Poll in a separate thread.
If the Poll method is not called, the event is also not called.
Chat server
Users can chat after connecting to the chat server in the following order:
1. Connect to a chat channel
The user connects to the chat server.
Other members are notified that a user joined.
Upon a successful channel connection, the handlers are called back in the following order:
- User list loading event handler
- Channel entrance event handler
- Recent chat history loading event handler
2. Send/receive messages
The user sends and/or receives messages.
- General message event handler
- Whisper message event handler
- Admin(BACKND Console) announcement event handler
- Operator(user) announcement event handler
3. Disconnect from the chat channel
The user disconnects from the chat server.
Other members receive a message notifying them that the user left.
- Channel leave event handler
Send announcements from the console
You can send messages to users in all chat channels through BACKND Console - Announcement Management - Send Announcement.