PlanyDocs
Playpute

Players and sessions

Who is playing right now, and who was playing earlier.

Plany works out who is on your servers from what the servers themselves print. You do not have to integrate anything.

Reading it

CallAnswers
GetPresenceHow many players are on one server right now, and who.
ListPresenceThe same counts across every server in a project and region.
ListPlayerSessionsWho was on a server, and when.
ListConnectionsThe individual connections to a server, with the addresses they came from.

The console has these at Players → Live and Players → Sessions, and on each server's Players tab.

Players → Live

Presence gives player_count, connection_count, waiting_connection_count — people connecting to a server nobody is playing on yet, usually because it is starting — and last_activity_time.

Two kinds of record

Player session

A named player joined at one time and left at another, taken from your server's own output.

Connection

One connection to a server's address: where it came from, which port, how long it waited. It exists even before the server is running.

They are related but kept separate, because one connection is not one player. A game client often opens more than one, and a household behind a single router is several players from one address. Plany links them where it can, and a link is a best match rather than a certainty.

A server browser probing your query port is a connection and not a player. Filter on port_name if you are counting.

How a session ends

End reasonMeaning
END_REASON_DISCONNECTEDThe server said the player left.
END_REASON_SUPERSEDEDThe player joined again before a leave was seen.
END_REASON_SERVER_STOPPEDThe server stopped.
END_REASON_SERVER_RESTARTEDThe server restarted.
END_REASON_EXPIREDNothing reported a departure and the session aged out.

END_REASON_EXPIRED is an upper bound on when they left, not a measurement — clamp it rather than trusting it if you are computing playtime.

CLOSE_REASON_WAKE_TIMEOUT on a connection is the one that means something went wrong: somebody connected to a stopped server, waited, and it did not start in time. See Addresses and waking.

Addresses are a narrower permission

A connection carries the address your player connected from. That is information about your players, so it is not given to everyone who can see the server.

RolePresence and sessionsConnection addresses
account.owner, account.adminYesYes
project.owner, project.editorYesYes
account.viewer, project.viewerYesNo

A viewer sees how many people are playing and who they were. "Which address kept reconnecting" is a question about abuse of your own server, and it stays with the roles that own the project.

Accuracy for a new game

For a game Plany already knows, presence is accurate from the first server you run. For a game it has not seen before, it takes a while: Plany works out the shape of your server's join and leave lines and checks them against real sessions before relying on them. Until then a server shows no players.

Sessions recognised by a pattern still being checked are marked provisional, left out of ListPlayerSessions unless you pass include_provisional, and flagged on presence as has_provisional_sessions. Autoscaling will not shrink a fleet on them, and a server is not put to sleep while they are the only evidence — so the worst case is a fleet that stays larger than it needs to, not one that disconnects people.

See how far Plany has got with a game:

plany games learning my-game

It says, in a sentence, what is happening and what happens next, and lists the line shapes your server printed that nothing recognises yet.