services

Unified platform services core (identity, achievements, leaderboards, cloud saves, presence, lifecycle, and mock backend) for Garnet

Garnet Services

Unified platform services abstraction for the Garnet engine, shared across Steamworks (garnet-steam), Apple Game Center (garnet-game-center), Google Play Games (garnet-play-games), and future console SDK providers (PSN, Xbox GDK, Nintendo Switch).

Features

  • Capability-gated Backend contract: query client.capabilities (achievements?, stats?, leaderboards?, cloud_storage?, rich_presence?, invites?, entitlements?, virtual_keyboard?, text_filter?, multi_user?, overlay?) so games degrade gracefully across platforms (e.g. Nintendo Switch having no native achievements).
  • Console-ready multi-user & lifecycle model: optional user : LocalUser? on every call, OverlayToggled, LifecycleChanged (Active, Constrained, Suspended), UserChanged, InviteReceived, and AchievementUnlocked events pumped into Garnet::World via Services::Plugin.
  • Canonical ID Manifest (garnet-services-v1): map logical Garnet IDs ("first_win") to per-provider native IDs (steam, game_center, play_games, psn, xbox, switch) in one diffable JSON file.
  • Deterministic MockBackend: full in-memory implementation with multi-user switching, quota-enforced cloud saves, leaderboards, presence, entitlements, text filter, and simulated overlay/suspend events for headless testing and CI.

Usage

require "garnet-services"

manifest = Garnet::Services::ServiceManifest.from_json(File.read("services.json"))
backend = Garnet::Services::MockBackend.new
client = Garnet::Services::Client.new(backend, manifest)

world = Garnet::World.new
world.add_plugin(Garnet::Services::Plugin.new(client))

client.unlock_achievement("first_win")
client.cloud_write("slot1", "save-data".to_slice)
Repository

services

Owner
Statistic
  • 0
  • 0
  • 0
  • 3
  • 1
  • about 1 hour ago
  • December 4, 2026
License

Links
Synced at

Fri, 04 Dec 2026 00:21:32 GMT

Languages