Running a game
Three ways a game server tells Aquila what state it is in.
Aquila needs to know when a server is ready for players and when its match is over. A fleet picks one of three ways for its servers to report that:
| Way | Use it when |
|---|---|
| Aquila SDK | You can change the server's code. It is plain HTTP, so any engine or language can call it, and Go has a client |
| Agones SDK | The game already uses Agones, or you want Agones' ready-made plugins for Unity, Unreal or C++ |
| No SDK | You cannot change the server, or it is a plain process per session |
All three run the same image format, a Linux container from any registry. A private registry needs its credentials added to the organization in the console.
The image
The server listens on the container ports the fleet template declares. Aquila maps each one to a public port on the node, and the allocation returns both the address and the public port numbers. Your server never needs to know them.
Logs go to stdout and stderr. The console shows the last lines of every server, and fleets.v1.GetGameServerLogs returns them.
Servers built against an SDK, Aquila's or Agones', get these environment variables next to the ones the template sets:
| Variable | Holds |
|---|---|
AQUILA_GAMESERVER_NAME | The server's name |
AQUILA_SDK_URL | The SDK endpoint |
AQUILA_SDK_TOKEN_FILE | A file holding the SDK token |
The SDK token only works for the server it was issued to, and stops working when that server is gone. A game bug or a compromised server can change its own state through the SDK and nothing else. Do not put an organization API key in the image, because a key reaches every fleet in the organization.
Secrets
The template's env is readable by every member of the organization and every API key with fleets:read. Put tokens, passwords and other credentials in fleet secrets instead. The game container gets each secret as an environment variable, and no call or console page shows its value again.
Add or replace one in the console's fleet editor, or with fleets.v1.SetFleetSecret, and remove one with DeleteFleetSecret. Both need fleets:write. A secret cannot share a name with an env variable.
A change replaces the servers that are not in a match. An allocated server keeps the value it started with until its match ends.