1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! 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.
//!
//! ```no_run
//! use arcane_sdk::ArcaneClient;
//!
//! let client = ArcaneClient::init()?;
//! println!("user={:?} owned={}", client.user_id(), client.is_owned());
//! # Ok::<(), arcane_sdk::SdkError>(())
//! ```
//!
//! 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.
//!
//! ```no_run
//! # let client = arcane_sdk::ArcaneClient::init()?;
//! client.achievements().unlock("first_blood")?;
//! # Ok::<(), arcane_sdk::SdkError>(())
//! ```
//!
//! 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.
//!
//! ```no_run
//! # let client = arcane_sdk::ArcaneClient::init()?;
//! client.friends().list()?;
//! # Ok::<(), arcane_sdk::SdkError>(())
//! ```
//!
//! 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.
//!
//! ```no_run
//! # use arcane_sdk::Visibility;
//! # let client = arcane_sdk::ArcaneClient::init()?;
//! # let my_endpoint = b"udp://203.0.113.7:7777";
//! let lobby = client.p2p().create_lobby(4, Visibility::FriendsAndCode, my_endpoint)?;
//! for event in client.p2p().poll_events() { /* … */ }
//! # Ok::<(), arcane_sdk::SdkError>(())
//! ```
//!
//! 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.
//!
//! ```no_run
//! # use arcane_sdk::{Channel, NetOptions, Peer};
//! # let client = arcane_sdk::ArcaneClient::init()?;
//! # let lobby_id = "3f2b9c1e-0d4a-4e7b-9a61-5c8e2f7d1b40";
//! client.net().open(lobby_id, NetOptions::default())?;
//! client.net().send(Peer::Host, Channel::Reliable, b"ready")?;
//! # Ok::<(), arcane_sdk::SdkError>(())
//! ```
//!
//! Failures are [`SdkError`], carrying a stable [`code`](SdkError::code), a
//! player-facing [`message`](SdkError::message), a developer-facing
//! [`hint`](SdkError::hint) and a [`context`](SdkError::context) key/value list.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;