Addresses and waking
One address that keeps working, whether or not the server behind it is running.
Every public game server is given a Plany address that players connect to. It works whether or not the server is running — and a player connecting to a stopped or sleeping server starts it.
Which address to hand out
Read a server's endpoints. You may see the same port twice, distinguished by
proxied.
Plany's address. It works while the server is stopped, and connecting to it
starts the server. This is the one to give players. Proxied entries come
first, so endpoints[0] is it.
Where the game itself is listening. Reachable only while the server is running, and only from inside your project. Useful for debugging; not for players.
{ "endpoints": [ { "name": "game", "address": "51.140.12.9:25565", "protocol": "tcp", "proxied": true }, { "name": "game", "address": "10.20.3.4:25565", "protocol": "tcp", "proxied": false } ]}The CLI and the console show the proxied address, and Terraform exposes it as
address on plany_playpute_game_server.
Servers → the server → ConnectThe proxied address is stable for the life of the server. Put it in your launcher, your server list or your DNS and it keeps working across stops, starts, restarts and sleeps.
The port is not necessarily the one your game declares. The first server of
a game in a project gets the game's own port; a second one listening on the same
port is given another. Use the endpoint's address — the ready-to-paste host:port —
rather than assuming the game's port number.
What happens when somebody connects to a stopped server
- The connection is held
Plany accepts it and holds it open. Nothing the player sent is lost.
- The server starts
A server that stopped or went to sleep recently comes back in seconds. One that has been down for a long time, or has never run, takes longer — a modded server generating a world for the first time can take minutes.
- The connection is passed through
Once the server is accepting players, the waiting connection is joined to it and the player is in.
Twenty friends connecting at once start the server once.
Plany does not interpret your game's protocol, so this works for any game — one Plany publishes or one it has never seen. A connection over TCP is held whole; for UDP, the first datagrams are queued while the server starts.
What the player sees
A slow connect. Most clients show it as a normal connection taking a while.
If the server does not come up in time, the waiting connection is closed and
recorded with CLOSE_REASON_WAKE_TIMEOUT — the one close reason that means
something went wrong rather than somebody leaving. If you see these, the server
is taking longer to start than players will wait for; a
schematic is usually the fix. wait_duration on each
connection says how long players waited.
Which ports are reachable
Only the ports your game declares with public: true. RCON is deliberately not
public by default — it is a remote shell with a password in front of it, and a
connection to a public port starts the server. See Games.
Telling your server its own address
A game server advertises itself to master servers and query protocols, and what it can see about itself is a private address no player can reach. So Plany tells it the address players actually use:
| Where | As |
|---|---|
| Config file contents and the launch command | ${plany.public_address} |
| Environment | PLANY_PUBLIC_ADDRESS |
server-ip=server-port=25565public-address=${plany.public_address}Use the substitution rather than computing the address yourself. It is not known when the server is created, and it is filled in when the game launches — an address that changed reaches the game on its next start.
Servers with no public address
A server created with exposure: EXPOSURE_PROJECT_INTERNAL gets no Plany address.
It is reachable only from inside your project, by something you run there — a
matchmaker, a lobby, another server.
An internal server is not started by a player connecting, because there is nothing for them to connect to. Whatever directs traffic to it has to start it.
Cost
Each public port on a server running your own game is charged as
playpute-proxy-hour, $0.005 an hour (about $3.65 a month). The games Plany
publishes are free.
The addresses for a project's public servers are held by a connection proxy that runs for as long as the project has a public game server on that network. It is charged at the Playpute rates for 1 vCPU and 256 MiB, about $0.018 an hour, and appears on your bill as Playpute vCPU and memory.