Chat System¶
Note
These Docs are WIP and will be updated with Visual Blueprint Examples. Please see Class Methods for visual examples.
The GameFuse Chat System allows you to implement real-time chat functionality in your game. This includes creating chats, sending messages, and managing message read status.
Getting Started with Chat¶
To use the GameFuse Chat system in Blueprints, you'll need to access the GameFuse Chat subsystem:
Creating a Chat¶
To create a new chat:
- Get the GameFuse Chat subsystem
- Create an array of participant usernames
- Set an initial message
- Call CreateChat with the usernames and initial message
- Create a callback function to handle the response
- Process the created chat data
Sending Messages¶
To send a message in a chat:
- Get the GameFuse Chat subsystem
- Call SendMessage with the chat ID and message text
- Create a callback function to handle the response
- Process the sent message data
Marking Messages as Read¶
To mark messages as read:
- Get the GameFuse Chat subsystem
- Call MarkMessageAsRead with the message ID
- Create a callback function to handle the response
- Process the success or failure of marking the message as read
Fetching Chats and Messages¶
To fetch all chats:
- Get the GameFuse Chat subsystem
- Call FetchAllChats with page number (e.g., 1)
- Create a callback function to handle the response
- Process the array of chats from ChatSystem->GetAllChats()
To fetch messages for a specific chat:
- Get the GameFuse Chat subsystem
- Call FetchMessages with the chat ID and page number
- Create a callback function to handle the response
- Process the array of messages from ChatSystem->GetChatMessages()
Clearing Chat Data¶
To clear cached chat data:
- Get the GameFuse Chat subsystem
- Call ClearChatData
- Update any UI elements that were displaying chat data
Function Return Values¶
Chat Creation¶
HTTP status code | Description |
---|---|
200 |
OK |
400 |
Missing or invalid parameters |
401 |
User not authenticated |
500 |
Unknown server error |
Message Operations¶
HTTP status code | Description |
---|---|
200 |
OK |
400 |
Missing or invalid parameters |
401 |
User not authenticated or not a participant in the chat |
404 |
Chat or message not found |
500 |
Unknown server error |
Fetching Data¶
HTTP status code | Description |
---|---|
200 |
OK |
401 |
User not authenticated |
500 |
Unknown server error |