Game ideas & features

Your next feature

Chat

Retained player messages, explicit realtime subscriptions and bounded moderation.

SDK developRequires a player session
Godot
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 read_chat_snapshot(channel_id) from an explicit button or scene action. Opening the file alone sends no request.

GDScript
res://scripts/chat.gd
horizOn call
1extends Node
2​
3# Explicit read after restoring the SAME existing signed-in player.
4func read_chat_snapshot(channel_id: String) -> void:
5 var user = Horizon.auth.getCurrentUser()
6 if user == null:
7 return
8 var result = await Horizon.chat.requestChannelSnapshot(user.userId, channel_id, "", [])
9 if not result.success:
10 push_warning(result.errorCode)
11 return
12 print("Snapshot epoch: ", result.data.channel.epoch)
13 # This raw result never authorizes, opens or populates a managed feed.
14 # watchChannel(user.userId, channel_id) waits for a confirmed subscription.
15 # getCached(channel_id) is visible only while that watch is authorized.
16 # No timer polling, disconnected HTTP fallback or automatic send/retry.
17# Executable durable send/report UI: addons/horizon_sdk/examples/features/chat_example.gd.
18# Persist the original project+player intent before sendMessage; host is only a request fence.
19# Keep operationId, issuedAt, text and original report IDs/reason unchanged after timeout.
20# getOperation 404 is not a confirmed failure. PHP returns 501 NOT_SUPPORTED.
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.