import { SaveSyncClient, SaveSystem } from '@datamoc/mw_games/core';
const sync = new SaveSyncClient({ endpoint: 'https://example.com/api/saves' });
const saves = new SaveSystem<{ depth: number }>({ namespace: 'my-game', version: 1 });
const payload = saves.exportSlot('slot1');
if (payload) await sync.upload('slot1', payload);
const slots = await sync.list();
const restored = await sync.download('slot1');
Uploads/downloads
SaveSystem.exportSlotpayloads to a game's own HTTPS endpoint - the server half of item 124's save export/import, followingFeedbackClient's own shape (an injectable transport a game points at its own endpoint) rather than a second pattern:mwgships no backend and assumes none here either.Every call names a
slot, the same nameSaveSystem.exportSlot/importSlotalready use locally, so a player with several named profiles (SaveSystemsupports as many as a game creates) can sync each independently against one endpoint rather than the endpoint holding only ever one save.list()is the seam a profile picker reads before choosing which slot todownload.