Skip to content

About

Free, open-source stand-in for PlayFab: test your game offline with no player limit, and keep games working after their servers shut down.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Keep Playing

A free, open-source server that answers PlayFab calls. PlayFab is the Microsoft service that many games use for sign-ins, saves, shops, leaderboards and server-side scripts. Keep Playing runs on your own computer and answers those calls itself, so you can:

  • give players a way to keep playing when a game's online services shut down;
  • bring players back from their saved data, so their characters and items return with the game (how);
  • test a game offline without touching your live PlayFab title, or using up the 1,000 players PlayFab's free Development Mode allows (for developers).

Keep Playing running with --verbose while a short test script plays the part of a game. The script signs in, buys a sword, runs a CloudScript function, checks the leaderboard and saves, and Keep Playing answers each call. One call it can't answer yet shows up as a note.

It needs nothing but Node.js 22 or newer. There's nothing to install from npm and no database to set up.

Keep Playing is not made by, or affiliated with, Microsoft. PlayFab is a trademark of Microsoft.

Where it's up to

This is an early version (0.2).

  • It answers 353 of the 797 calls that Microsoft still lists. COVERAGE.md lists which ones.
  • Every answer is checked against Microsoft's own description of that call: the field names, the types, the required fields and the allowed values. The tests check over 700 answers this way, and they try every call that Keep Playing answers. They also make the same checks as the test page in Microsoft's own JavaScript SDK.
  • It hasn't been tried with a real game yet. If you make games or mods with PlayFab, please try it and tell us what broke.

Why

When the company behind a game's online services goes, the game often goes with it. When Amazon closed GameSparks in 2022, Killer Queen Black shut down because of it. Fans now rebuild these services one game at a time, like this replacement for the PlayFab features in Overkill's The Walking Dead. And a law isn't coming soon: in June 2026 the European Commission decided not to propose one.

One shared, open replacement means a shutdown doesn't have to be the end. Studios can hand it to players when they close a game, and communities don't have to start from nothing.

Try it

  1. Install Node.js 22 or newer.

  2. Download this project, open a terminal in its folder, and run:

    node server.js --title title-example
    
  3. Sign in a player, the way a game would:

    curl -X POST http://localhost:8080/Client/LoginWithCustomID -H "Content-Type: application/json" -d "{\"TitleId\":\"1A2B3\",\"CustomId\":\"me\",\"CreateAccount\":true}"
    

Open http://localhost:8080 in a browser to see what's going on: how many players there are, each call the game has made, and which ones Keep Playing can't answer yet. If there are any, the Report on GitHub button opens a report with them filled in, so you can tell us what your game needs. Nothing is sent until you post it.

Keep Playing's page in a browser, listing the calls a game has made and one it can't answer yet

Options: --port 9000, --data ./saves (where players are kept, ./data by default), --verbose (show every call), --https (for games that only use https; see Games that need https), --title-id 1A2B3 (answer at that game's PlayFab address; see Games you can't change), and --host 0.0.0.0 (let other computers on your network connect; by default only your own computer can).

Point your game at it

Every PlayFab SDK lets you change the address it calls. If the address starts with http, the SDK uses it as it is:

SDK Setting
Unity PlayFabSettings.staticSettings.ProductionEnvironmentUrl = "http://localhost:8080";
C# PlayFabSettings.staticSettings.ProductionEnvironmentUrl = "http://localhost:8080";
JavaScript (browser) PlayFab.settings.productionServerUrl = "http://localhost:8080";
Node.js PlayFab.settings.productionUrl = "http://localhost:8080";

Game servers and tools that use the Server or Admin calls need the secret key. Keep Playing makes one the first time it starts and keeps it in data/keys.json.

Games that need https

Some games only talk to https addresses. Most Unreal games are like this, because PlayFab's Unreal plugin only uses https. Start Keep Playing with --https:

node server.js --https

Keep Playing makes a certificate for this computer, keeps it in data/tls/keep-playing.crt, and listens at https://127.0.0.1:8443. Point the game at that address.

The game will only accept the certificate once it trusts it. There are two ways to do that:

  • Trust it in Windows. Double-click keep-playing.crt, click Install Certificate, choose Current User, then Place all certificates in the following store. Click Browse, pick Trusted Root Certification Authorities, and click OK, Next and Finish. Say Yes to the warning. The certificate only covers this computer's own addresses (localhost and 127.0.0.1) and can't vouch for any other website. To remove it later, open certmgr.msc and delete "Keep Playing on this computer" from Trusted Root Certification Authorities.

  • Unreal games that still say no. Many Unreal games keep their own list of trusted certificates instead of using Windows'. You can tell such a game to stop checking certificates by adding these lines to its Engine.ini (usually in %localappdata%\<game>\Saved\Config\WindowsNoEditor):

    [/Script/Engine.NetworkSettings]
    n.VerifyPeer=False

    The game then stops checking every secure connection it makes, not just the ones to Keep Playing. Only do this for a game whose servers are gone, and remove the lines if they ever come back.

To use a certificate of your own instead, start Keep Playing with --cert yourcert.pem --key yourkey.pem.

Games you can't change

This is new, and it hasn't been tried on a real Windows PC yet. It's been tested everywhere except the Windows parts: the request to change the hosts file, and Windows trusting the certificate. If you try it, please tell us how it went, even if it worked. Trying it without a game (see below) is a help too.

A finished game calls PlayFab at an address that's built in, like https://1a2b3.playfabapi.com, and only trusts PlayFab's own certificate. On Windows, Keep Playing can still answer it, without changing any of the game's files:

  1. Install Node.js (the LTS version). Download Keep Playing (the green Code button at the top of this page, then Download ZIP) and unzip it.
  2. Start the game, and wait until it says it can't connect.
  3. Double-click connect-game.cmd in the Keep Playing folder. If Windows warns you about running it, choose Run (or More info, then Run anyway). Press Enter when it asks.
  4. It finds the address the game asked for. Then Windows asks two things: whether it may make changes to your device, and whether to install a certificate. Click Yes both times.
  5. When it says It works, start the game again, and keep the window open while you play. Your browser opens Keep Playing's page, which shows each call the game makes.

To put everything back, close the window and double-click disconnect-game.cmd.

What it changes, and why:

  • One line in Windows' hosts file (C:\Windows\System32\drivers\etc\hosts), which says the game's PlayFab address is this computer. The line ends in # Keep Playing, so it's easy to spot.
  • Keep Playing's certificate, trusted for your Windows user only. It isn't a certificate authority: it only covers this computer and the game's PlayFab address, so it can't be used to pretend to be any other website.

While it's connected, that game can't reach PlayFab at all, so only use it for a game whose servers are gone. To try it without a game, type kptest when it asks for a title ID. Your browser should open Keep Playing's page at https://kptest.playfabapi.com/.

Some games keep their own list of trusted certificates and still say no. Many Unreal games do this; see Games that need https. If your game doesn't connect, tell us about it.

On macOS or Linux, do the same by hand: add 127.0.0.1 1a2b3.playfabapi.com to /etc/hosts, start node server.js --title-id 1A2B3 (port 443 needs sudo on Linux), and trust data/tls/keep-playing.crt.

Your game's settings

Put the game's settings in a folder and start the server with --title that-folder. title-example shows every file. They're all optional:

File What's in it
title.json The title ID, the game's name, extra secret keys and a few switches (below)
title-data.json Title data: the key/value settings the whole game reads
title-internal-data.json Title data that only servers can read
catalog.json or catalogs/*.json Items, in PlayFab's own catalog export format
stores.json Stores and their prices
currencies.json Virtual currencies, with starting amounts and recharge rates
statistics.json Statistics: how values combine (Last, Min, Max, Sum) and when they reset
cloudscript.js or cloudscript/*.js The game's classic CloudScript
news.json Title news
matchmaking-queues.json Matchmaking queues and their rules, in the form PlayFab's SetMatchmakingQueue takes

The folder is read every time the server starts, and what's in it is put in place. Changes made while the server was running are kept: title data set by the game's server, statistic versions, and earlier CloudScript revisions.

Switches in title.json → settings:

  • allowClientStatistics (default true): let players post their own statistics. PlayFab's own default is false.
  • allowClientCurrency (default false): let players add or take away their own currency.
  • checkRequiredFields (default true): refuse calls that leave out a required field, like PlayFab does.
  • acceptAnySecretKey (default false): for old game servers that have a secret key built in that nobody knows any more.
  • openServerCalls (default none): Server calls the game itself makes without a working key, like ["/Server/WritePlayerEvent"]. This is safer than acceptAnySecretKey, because the Admin calls stay locked.
  • createAccountsOnLogin (default false): make an account when a game signs in with a new ID but leaves out CreateAccount. Old games often do this, because their players already had accounts.
  • cloudScriptTimeoutMs (default 10000): how long a CloudScript function may run.

For developers: test without PlayFab

Keep Playing is like Firebase's local emulators, but for PlayFab. Point your game or your automated tests at it, and they run offline, with nothing billed and nothing touching your live title.

That matters more since March 2026. A title in PlayFab's free Development Mode can now only ever create 1,000 players, and once it has, no new players can be made until the title moves to a paid plan. Tests that make a fresh player each run use that up quickly. Keep Playing has no limit.

  1. Keep your title's settings in your repository. Save them once with tools/export-title.js (see For studios), or write the files by hand: title-example has one of each.

  2. Start Keep Playing with that folder and an empty data folder, so each run starts with no players:

    node server.js --title ./playfab-title --data ./playfab-test-data
    
  3. Point the SDK at http://localhost:8080 (see Point your game at it). Server and Admin calls need the secret key: it's secretKey in keys.json, in the data folder.

Requests are checked against Microsoft's description of each call, so a missing field or a value of the wrong type fails with InvalidParams, the way it would on PlayFab. Errors use PlayFab's own names. A call Keep Playing can't answer yet fails with NotImplemented (HTTP 501), so a test tells you straight away. COVERAGE.md lists every call it answers, and What doesn't work yet lists the big gaps, like the newer economy and lobbies.

In GitHub Actions:

- uses: actions/setup-node@v4
  with:
    node-version: 22
- name: Start Keep Playing
  run: |
    git clone --depth 1 https://github.com/LifeboatLabs/keep-playing "$RUNNER_TEMP/keep-playing"
    node "$RUNNER_TEMP/keep-playing/server.js" --title ./playfab-title --data "$RUNNER_TEMP/playfab-data" &
    until curl -sf http://localhost:8080/status > /dev/null; do sleep 0.2; done
- name: Test
  run: npm test # with the PlayFab SDK pointed at http://localhost:8080

To keep your tests on one version of Keep Playing, add --branch and a version's tag (like --branch v0.2.0) to the git clone line. The releases page lists them.

What works

  • Signing in: custom IDs, Android and iOS device IDs, usernames and email addresses with passwords, Steam, Apple, Game Center, Nintendo (Switch device and Nintendo account), Battle.net, Kongregate, Facebook Instant Games, OpenID Connect and server custom IDs. Also linking, unlinking, looking players up by any of these, session tickets and entity tokens.
  • Player data: player data of every kind (normal, read-only, internal and publisher), with public and private keys and data versions.
  • Title data: title data, internal title data and publisher data.
  • Accounts: account info, profiles, combined info, display names, avatars, contact emails, tags, bans, custom properties and generic IDs.
  • Friends: friends, friend tags and friend leaderboards.
  • Shared groups: small groups of players who share data, with public and private keys.
  • Groups: clans and guilds, with roles, invitations, applications to join, and blocked players. A group can have its own objects and files too.
  • Matchmaking: queues, tickets (with friends who join the same ticket), teams, and the rules that decide who plays together: same mode, a skill gap that widens the longer people wait, shared choices, totals, and a region everyone can reach. Games that ask how their ticket is doing get their match. Keep Playing can't start game servers, so matches come without server details.
  • Statistics: player statistics with Last, Min, Max and Sum, and hourly, daily, weekly and monthly resets. Also classic leaderboards, including the leaderboard around a player.
  • Economy: the classic economy, with catalogs, stores, bundles, containers and keys, consumable and stackable items, and virtual currency that recharges.
  • Characters: the classic characters a player can have, each with its own data, statistics, leaderboards, items and currency. Buying an item straight into a character's inventory doesn't work yet.
  • CloudScript: classic CloudScript, with handlers, server.*, entity.*, log, revisions and time limits.
  • Entities: entity objects and entity profiles.
  • Files: entity files, like save games. Uploads and downloads go to Keep Playing instead of Microsoft's storage, and the files are kept in the files folder inside your data folder.
  • Events: PlayStream and telemetry events. They're accepted and counted, and never sent anywhere.

What doesn't work yet

These are the big gaps, roughly in the order we'll work on them:

  • lobbies, and matchmaking for games that wait to be told about a match instead of asking;
  • the newer economy (Catalog and Inventory), and the newer leaderboards and statistics;
  • CloudScript that runs on Azure Functions;
  • multiplayer servers and Party;
  • drop tables, web requests from CloudScript, and push notifications;
  • signing in with Google, Facebook, Xbox, PlayStation or Twitch. Their tokens can only be checked by those companies, so there's no player ID to read from them.

Sign-ins aren't checked with Valve, Apple, Nintendo and the others. Keep Playing reads the player's ID from what the game sends, which is fine on your own computer. Don't run a public server with these sign-ins until they're checked.

Games

Settings folders for particular games live in games:

When a game's servers shut down

Keep Playing is for games whose official servers are gone, or for studios planning what happens when they close a game. We keep to a few lines:

  • Only games whose official servers are gone. This isn't a way around a live service.
  • Players bring their own copy. This project never shares game files.
  • No unlocking things people didn't pay for, no cheats, and no getting around copy protection.

On Windows, connect-game.cmd sends most games to Keep Playing without changing any of their files (see Games you can't change). Trying a game with Keep Playing explains the rest, step by step.

For studios: an end-of-life plan

If your game uses PlayFab, closing it can look like this:

  1. Save your title's settings into a folder before you switch it off:

    node tools/export-title.js --title-id ABCD --out ./my-game --store your_store_id
    

    It asks for the secret key in the PLAYFAB_SECRET_KEY environment variable (or --secret-key). It only reads, and it only talks to your own title. It saves title data, internal title data, catalogs (--catalog for each one beyond the primary), stores (--store for each one, because PlayFab has no call that lists them), currencies, statistics, the live CloudScript and news. Player accounts aren't included.

  2. Ship a last update that lets players change the server address, or points at a community server.

  3. Hand players Keep Playing and the folder. node server.js --title ./my-game brings it all back. The tests check that a saved title comes back exactly as it was.

  4. Give each player their own player file (see Bring a player back), so their account comes back too.

Bring a player back

Keep Playing can bring back a player's account from a player file: what PlayFab's GetPlayerCombinedInfo answered for that player. It brings back their name, player data, items, currencies, statistics and characters. They keep their PlayFab ID and their sign-ins, so when they sign in the way they always did, the game finds them again.

To bring someone back, put their player file in the import folder inside Keep Playing's data folder, then start Keep Playing. It says who it brought back, and moves the file into import/done. (Or start it with --import their-file.json.) A player who's already there is left alone, so starting it again doesn't change anything. If they've already played on this server under the same sign-in, that sign-in moves to the account that was brought back.

For studios: before you switch PlayFab off, call Server/GetPlayerCombinedInfo for each player with everything turned on, and save each answer as it is:

{
  "PlayFabId": "THE PLAYER'S ID",
  "InfoRequestParameters": {
    "GetUserAccountInfo": true, "GetUserData": true, "GetUserReadOnlyData": true,
    "GetUserInventory": true, "GetUserVirtualCurrency": true, "GetPlayerStatistics": true,
    "GetCharacterList": true, "GetCharacterInventories": true, "GetPlayerProfile": true,
    "ProfileConstraints": { "ShowDisplayName": true, "ShowLinkedAccounts": true }
  }
}

A player file is personal data. Give each player only their own file, the way you'd answer a data request, and never publish them together.

For players: if you asked a game company for your data (with Save Your Game, say), it may not come back in this shape. We don't know yet what companies send. If yours came back, please tell us what it looks like: just the kinds of files and the names of the fields, with none of your details. Then Keep Playing can learn to read it.

What doesn't come back: passwords (PlayFab never gives them out, so a player who signed in with a username and password needs another way in), internal player data, friends, and character data beyond each character's name, type and items.

Safety

  • CloudScript runs as the server. It runs in its own JavaScript context, which keeps scripts tidy, but that isn't a security boundary. Only load CloudScript you trust: your own game's, or a version you've read.
  • The secret key is in data/keys.json. Anyone with it can use the Server and Admin calls. Keep it private, like a password.
  • Only your own computer can connect by default. If you open the server up with --host 0.0.0.0, put HTTPS in front of it before anyone connects over the internet.

Tests

node tests/run.js

The tests start real servers and make the calls the way the SDKs do. Every successful answer is checked against Microsoft's description of that call.

spec/calls.json is made from Microsoft's PlayFab/API_Specs with node tools/gen-spec.js. Run node tools/coverage.js to update the coverage list.

Who made it

Lifeboat Labs makes free, open-source tools for when something you rely on shuts down. Keep Playing was built with Claude, Anthropic's AI. Follow us on X or Reddit.

Licence

Keep Playing is under the MIT licence. spec/calls.json comes from Microsoft's PlayFab API descriptions, which are under the Apache licence 2.0 (see spec/NOTICE).

About

Free, open-source stand-in for PlayFab: test your game offline with no player limit, and keep games working after their servers shut down.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages