Game ideas & features

Your next feature

Chat

Retained player messages, explicit realtime subscriptions and bounded moderation.

SDK developRequires a player session
Unity
Illustration of Chat
Your visible result

Use two existing player sessions: open the project channel, send once, read a snapshot and report an actual retained message. Direct chat needs friendship; group chat needs active membership.

Video coming later

This step does not have a video yet. The guide and MCP request are ready to use.

Chat

Prepare the same project

  1. Choose the same project in the dashboard as in your game configuration.

    Chat →
  2. No additional definition is needed for the first request. An empty result is valid until matching game data exists.

    Use two existing player sessions: open the project channel, send once, read a snapshot and report an actual retained message. Direct chat needs friendship; group chat needs active membership.

    PHP simpleServer returns 501 NOT_SUPPORTED for all Chat routes.

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed, project configuration imported and player signed in.

This SDK example uses develop. Check whether the required APIs exist in your installed SDK.

Complete the Quickstart connection with the intended player. Call ReadChannelSnapshot(channelId) from an explicit button or scene action. Opening the file alone sends no request.

C#
Assets/Scripts/ChatDemo.cs
horizOn call
1using UnityEngine;
2using PM.horizOn.Cloud.Manager;
3​
4// Existing imported SDK and authenticated player session required.
5// Call these methods explicitly from a player action; nothing runs on startup.
6public sealed class ChatDemo : MonoBehaviour
7{
8 public async void ReadChannelSnapshot(string channelId)
9 {
10 var user = UserManager.Instance.CurrentUser;
11 if (user == null || !user.IsValid()) return;
12 var result = await ChatManager.Instance.SyncChannel(user.UserId, channelId);
13 if (!result.IsSuccess) { Debug.LogWarning(result.ErrorCode); return; }
14 Debug.Log("Snapshot epoch: " + result.Data.channel.epoch);
15 foreach (var message in result.Data.messages) Debug.Log(message.text);
16 // This is the small authorized server window, not the full device history.
17 // A raw snapshot does not authorize or populate a managed realtime feed.
18 // WatchChannel waits for confirmed subscription; revocation hides the feed.
19 }
20​
21 public void ReadDeviceHistory(string channelId, string before = null)
22 {
23 var user = UserManager.Instance.CurrentUser;
24 if (user == null || !user.IsValid()) return;
25 var page = ChatManager.Instance.ReadLocalHistory(channelId, before, 50);
26 if (!page.IsSuccess) { Debug.LogWarning(page.ErrorCode); return; }
27 foreach (var message in page.Data.messages) Debug.Log(message.text);
28 // Continue only on an explicit action using page.Data.nextCursor.
29 // Local delivered history can outlive the small current server window.
30 // For send/report, import the SDK ChatExample and preserve its original
31 // operationId, issuedAt, channel and text before one explicit send.
32 // An uncertain outcome never permits a fresh identity or implicit retry.
33 }
34}
Open the complete SDK sample ↗

Two players, one channel

Use two existing player sessions: open the project channel, send once, read a snapshot and report an actual retained message. Direct chat needs friendship; group chat needs active membership.

Managed feeds require subscription confirmation, then event/resync and one Sync plus a dirty bit. No polling or disconnected fallback; revocation hides cached text.

Persist the exact project/player original before sending. Host and session only fence requests. Never replace an uncertain ID, time, text or revision.

Operation 404 is not proof of failure. Keep the original after timeout or OPERATION_EXPIRED; reconcile only with its matching receipt.

Repeat the original report IDs/reason. Status removed is a successful replay; REPORT_EXPIRED never creates a new report.

PHP simpleServer returns 501 NOT_SUPPORTED for all Chat routes.

Test your new feature.

Use two existing player sessions: open the project channel, send once, read a snapshot and report an actual retained message. Direct chat needs friendship; group chat needs active membership.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • GET/chat/limits
  • POST/chat/channels/open
  • POST/chat/channels/{channelId}/sync
  • POST/chat/channels/{channelId}/messages
  • GET/chat/operations/{operationId}
  • POST/chat/channels/{channelId}/messages/{messageId}/report
All endpoints in the API reference
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.