Expand description
Arcane game SDK core.
Games build one ArcaneClient at launch, and pass it nothing: Arcane
Powered hands the game process the id of the title in ARCANE_GAME_ID and
the signed-in account in ARCANE_USER_ID. The client verifies ownership
once and then holds the result in memory — that user_id, that game_id,
the ownership status and the device fingerprint — so nothing downstream
needs the id again.
use arcane_sdk::ArcaneClient;
let client = ArcaneClient::init()?;
println!("user={:?} owned={}", client.user_id(), client.is_owned());Ownership is checked against a locally cached ticket when possible. If the
ticket is missing or expired, the SDK asks the Arcane desktop app (loopback
127.0.0.1:39284) to refresh online, opening the app via deep link when
needed.
init also opens a play session: one background thread reports playtime to
the Arcane desktop app once a minute, and — while the player allows it —
samples the frame rate in short windows if the game calls
ArcaneClient::frame. It never blocks or fails init. See
SessionSnapshot.
Achievements are opt-in and cost nothing until used: one line unlocks one, and it is idempotent, so a game can call it every time its condition holds.
client.achievements().unlock("first_blood")?;Friends are the same shape: one call gives the list with online and
in_game for this title, read straight from the Arcane desktop app.
client.friends().list()?;P2P lobbies are another opt-in surface: Arcane hosts the lobby, the join code and the invitations, and carries each member’s opaque connection blob. The game keeps its own netcode, or uses the coop network below.
let lobby = client.p2p().create_lobby(4, Visibility::FriendsAndCode, my_endpoint)?;
for event in client.p2p().poll_events() { /* … */ }The coop network carries the game’s own messages between the members of a lobby, with no port to open: the Arcane desktop app connects the players directly, or through Arcane’s relay when it has to.
client.net().open(lobby_id, NetOptions::default())?;
client.net().send(Peer::Host, Channel::Reliable, b"ready")?;Failures are SdkError, carrying a stable code, a
player-facing message, a developer-facing
hint and a context key/value list.
Modules§
- ffi
- Minimal C ABI for Unity / Unreal / native engines.
Structs§
- Achievement
- One achievement as the Arcane portal defines it, plus this player’s state.
- Achievements
- The achievements accessor, borrowed from the client for one or two calls.
- Arcane
Client - The handle a game holds for its whole session.
- Friend
- One friend of the signed-in Arcane account, with their presence.
- Friend
List - What the Arcane desktop app knows about this player’s friends.
- Friends
- The friends accessor, borrowed from the client for one call.
- Lobby
- A lobby as Arcane knows it, right after a create or a join.
- Lobby
Member - One player in a lobby, with the blob they published.
- Lobby
Options - What
P2p::createopens. - Lobby
Query - What
P2p::searchlooks for among the openVisibility::Publiclobbies of this game. - Lobby
Summary - One lobby
P2p::searchfound. Join it withP2p::joinand itslobby_id. - Net
- The coop network of this game. Get it from
ArcaneClient::net. - NetMessage
- One message received from a peer.
- NetOptions
- How to open the coop network.
- P2p
- The lobby accessor, borrowed from the client.
- SdkError
- A single SDK failure.
- Session
Snapshot - What the session looks like right now — for logs, overlays and QA screens.
- Unlock
- The result of an
Achievements::unlockcall.
Enums§
- Channel
- Which of the two channels a message travels on.
- Error
Code - Lobby
Event - Something that happened in a lobby this player is in, or an invitation.
- Lobby
Polling State - Whether the session thread is polling Arcane for lobby events.
- NetEvent
- What happened to the network since the last
Net::poll_events. - Ownership
Status - Peer
- Who a message is sent to.
- Route
- How a link reaches the other player.
- Tracking
State - Whether the SDK is tracking this play session.
- Visibility
- Who can join a lobby.
Constants§
- JOIN_
CODE_ LEN - Number of characters in a join code.
- MAX_
ACHIEVEMENT_ KEY_ LEN - Longest achievement key the SDK will accept, in bytes.
- MAX_
GAME_ ID_ LEN - Longest game id the SDK will accept, in bytes.
- MAX_
LOBBY_ METADATA_ BYTES - Largest lobby metadata set, in bytes of its JSON object.
- MAX_
LOBBY_ METADATA_ KEY_ LEN - Longest metadata key, in bytes: lowercase ASCII letters, digits and
_. - MAX_
LOBBY_ METADATA_ PAIRS - Most key / value pairs a lobby carries in its metadata.
- MAX_
LOBBY_ METADATA_ VALUE_ LEN - Longest metadata value, in characters.
- MAX_
LOBBY_ PAYLOAD_ LEN - Longest
payloadthe SDK will carry for one member, in bytes. - MAX_
LOBBY_ SEARCH_ RESULTS - Most lobbies one
P2p::searchreturns. - MAX_
RELIABLE_ MESSAGE - Largest message on
Channel::Reliable, in bytes. - MAX_
UNRELIABLE_ MESSAGE - Largest message on
Channel::Unreliable, in bytes. Bigger ones are refused before they leave the game.