state
Everything known about this session: connection state, identity, counters and link speed.
The one action that works in every state, including before the game login has finished — which makes it the thing to poll after `POST /api/v1/sessions` until `state` reads `in_lobby`. It touches no network of its own, so polling it costs the game nothing.
Request
POST /api/v1/sessions/{accountKey}/actions/state
Takes no arguments.
Response
The connection snapshot: lifecycle state, identity, packet counters and a `speed` block.
| Field | Type | Meaning |
|---|---|---|
state | string | `connecting`, `steam_auth`, `logging_in`, `in_lobby`, `in_game` or `disconnected`. Most actions need `in_lobby`. |
account_id | string | The game account's id. |
character_id | string | The character in the lobby, or `(none)`. |
uptime_sec | number | Seconds since this session connected. |
idle_sec | number|null | Seconds since the last packet either way; null before the first. |
reconnectPending | boolean | True when the account is stuck in a dungeon. Call `enterDungeon` to rejoin or `abandonGame` to give it up. |
speed.rttMs | number|null | Mean round-trip time to the game server, null until the first ping is acked. |
Example response
{
"state": "in_lobby",
"account_id": "4611686018427387904",
"character_id": "630211546215118851",
"steam_id": 76561198000000000,
"accountKey": "main",
"label": "main",
"nick": "Grimsby",
"uptime_sec": 412.7,
"idle_sec": 0.4,
"packets_sent": 128,
"packets_recv": 341,
"pings_sent": 41,
"pings_acked": 41,
"reverse_pings": 40,
"canReconnect": true,
"reconnectPending": false,
"iconsAvailable": true,
"iconStats": { "entries": 2411, "bytes": 36700160 },
"speed": {
"bytesSent": 41283, "bytesRecv": 918422,
"bytesPerSecSent": 100.0, "bytesPerSecRecv": 2225.6,
"rttMs": 38.42, "rttLastMs": 37.11, "rttMinMs": 31.08, "rttMaxMs": 96.4,
"jitterMs": 2.31, "rttSamples": 41
}
}
See also
DarkerAPI is an independent project. It is not affiliated with, endorsed by or associated with IRONMACE Co., Ltd. or Valve Corporation. “Dark and Darker” and related marks belong to their respective owners.