Skip to main content
One line gives you the list:
Each entry is the signed-in player’s friend on Arcane, with their presence right now:

in_game is about your title

in_game is true when the friend is playing the same game_id as this client — the id Arcane Powered launched you with. A friend playing something else on Arcane is online, not in_game. That presence is set by the Arcane desktop app when a game opens its play session, so it costs your game nothing. false is never a guess about your own title: the client always knows its game_id, so in_game is false only when the friend is playing something else, or nothing at all.

Joining a friend

A friend with joinable: true is in a lobby of your title that is not a code lobby, and it still has a free slot. Put a Join button next to them and hand lobby_id to p2p().join:
lobby_id is only set for a lobby of this title, so a friend in a lobby of another game reads joinable: false. A code lobby never shows here: it is reached with its join code only. The slot can be taken between the list and the join, so still handle lobby_full — and not_friends when your friend is a member of a friends lobby hosted by someone you are not friends with.

Sending a friend request

Someone met in a public lobby is not a friend yet. send_request asks them, with the user_id from the lobby’s members:
The request lands in their Arcane Powered launcher, where they accept or decline it; nothing changes in your game until they do, and the next list() then shows them. Sending one to a friend, or to someone a request is already pending with, answers already_friends.

stale

The Arcane desktop app caches the list for 15 seconds. When it is offline it serves that cache and says so:
stale: true is a success, not an error. The SDK keeps no list of its own: every call asks the desktop app, and the desktop app decides what to answer with.
list() is synchronous: one loopback round trip to the Arcane desktop app, on your thread, on the order of a millisecond. Call it when a friends menu opens, or on a timer of your own of a few seconds — never per frame.

What stays in the launcher

A game reads presence and can send a friend request, nothing more. Accepting, declining or removing a friend, chat and the in-game overlay stay in the Arcane Powered desktop app.

Errors

Full table and what to do about each: Errors.

In C

arcane_sdk_friend_request is an action: 0 on success, 1 for a bad argument or before init, 2 with the reason in err_buf. arcane_sdk_friends_json is a getter: it returns the bytes written, and a -4 means it failed — read arcane_sdk_last_error_json for the code. Size the buffer to the player’s friend list (a few hundred bytes per friend); a short buffer gives -3 and an empty string, never a truncated one. Details: C ABI.

Next steps

  • Session — the play session that makes your player “in game” for their friends
  • Achievements — unlock("first_blood"), one line, idempotent
  • Errors — every code, and its fix
  • Rust API · C ABI