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.

In Session & character.

Request

POST /api/v1/sessions/{accountKey}/actions/state

Takes no arguments.

Response

The connection snapshot: lifecycle state, identity, packet counters and a `speed` block.

FieldTypeMeaning
statestring`connecting`, `steam_auth`, `logging_in`, `in_lobby`, `in_game` or `disconnected`. Most actions need `in_lobby`.
account_idstringThe game account's id.
character_idstringThe character in the lobby, or `(none)`.
uptime_secnumberSeconds since this session connected.
idle_secnumber|nullSeconds since the last packet either way; null before the first.
reconnectPendingbooleanTrue when the account is stuck in a dungeon. Call `enterDungeon` to rejoin or `abandonGame` to give it up.
speed.rttMsnumber|nullMean 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.