GameRegistryService
plany.game.v1.GameRegistryService — the games your servers run, and the builds behind them.
The Game Registry is the catalogue a game server is created from. It holds two kinds of thing:
- A game —
games/{game}for one Plany publishes, oraccounts/{account}/games/{game}for your own — says how to run a server: the build, the launch command, the ports and the settings. A game can inherit from another, so your modpack can extendgames/minecraft-javaand declare only what is different. - A build —
accounts/{account}/builds/{build}— is what gets installed: an archive you upload, a Steam app, or an archive at a URL.
Both belong to your account rather than to a project, so one build serves every project you have.
If you run a game Plany publishes, you never call this service: name the game on
CreateGameServer and that is all.
Bringing your own game
- Create a build
CreateBuildwithkind: KIND_SERVERand a source. For an upload, the build starts out waiting for its archive. - Upload the archive
GetBuildUploadUrlreturns a URL toPUTthe zip to, and the headers to send with it. Passchecksum_sha256and the upload is refused if the bytes do not match. Then callFinalizeBuild, and the build moves toREADY. - Create a game that uses it
CreateGamewith aserverhalf naming the build, the launch command and the ports — or with aparentto inherit everything you do not set. - Run it
Create a game server with
gameset to your game. See PlayputeService.
plany builds create my-server --kind server --upload ./server.zipThe CLI and the Terraform provider do the upload and finalize steps for you.
kind is required and cannot be changed. Use KIND_SERVER for anything a
game server runs. A single upload can be up to 5 GiB; check the size before
you start, because a larger archive is refused only after it has been sent.
Reading the catalogue
| Call | What it is for |
|---|---|
ListGames | Your games and every game Plany publishes. Set launchable_for: KIND_SERVER for only the games a server can be created from. |
GetGame | One game as declared — only the fields set on that node. |
ResolveGame | One game with everything it inherits filled in, plus the build it resolves to. What a server created from it would run. |
ListBuilds, GetBuild | Your builds and their state. A failed build carries error. |
Never write ResolveGame's answer back with UpdateGame. That copies every
inherited value onto your game, after which changing its parent stops reaching
it. And UpdateGame with server in the mask replaces the whole server
message: read the game, change what you need, and send the whole half back.
Changing and deleting
A game server pins the build it was created with, so updating a game or a build never changes a server that is already running. Create a new build and point the game at it; new servers pick it up.
DeleteGame is refused while a game server or an autoscaling group is running
the game. DeleteBuild is refused while a game uses the build.