
Player statistics
Record counters and personal bests for each player.
SDKs and REST
Integrate with Unity, Godot or Unreal, or use the REST interface.
Project dashboard
Configure each feature and manage its current data in your project.
Quick Integration
Player statistics
Video coming soon
Track rounds, kills and best scores in one session batch, with sum, maximum, minimum or latest-value rules.
using UnityEngine;
using PM.horizOn.Cloud.Manager;
using PM.horizOn.Cloud.Objects.Network.Requests;
var manager = StatisticsManager.Instance;
var snapshot = await manager.GetStatistics();
if (snapshot == null) { Debug.LogWarning(manager.LastErrorCode); return; }
string pendingKey = "horizOn_statistics_pending_" + snapshot.userId;
var pending = PlayerPrefs.HasKey(pendingKey)
? JsonUtility.FromJson<UpdateStatisticsRequest>(PlayerPrefs.GetString(pendingKey))
: new UpdateStatisticsRequest {
userId = snapshot.userId, operationId = manager.CreateOperationId(),
updates = new[] { new StatisticUpdate("kills", 3), new StatisticUpdate("best_score", 250) }
};
string originalJson = JsonUtility.ToJson(pending);
PlayerPrefs.SetString(pendingKey, originalJson);
PlayerPrefs.Save();
var result = await manager.UpdateStatistics(pending.updates, pending.operationId);
if (result == null) {
// Keep the saved ID and batch. Reconcile OPERATION_EXPIRED before a new logical report.
Debug.LogWarning(manager.LastErrorCode);
return;
}
// A late success for O1 must never acknowledge a newer pending O2.
if (PlayerPrefs.GetString(pendingKey, null) == originalJson) {
PlayerPrefs.DeleteKey(pendingKey);
PlayerPrefs.Save();
}
foreach (var counter in result.values) Debug.Log(counter.key + "=" + counter.value);These examples use the Unity SDK (C#) and the REST API. Godot and Unreal have the same calls in their own SDKs: see the quickstart
Frequently Asked Questions
Ready to Integrate?
Start building with horizOn today. Free tier included.
