playertwo-sdk 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.d.ts +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ Two ways, and a game can use both: products you make in your studio (`p2.store.b
|
|
|
165
165
|
makes at its own prices with your game key (`p2.store.pay(chargeId)`). PlayerTwo's own card takes the player's yes
|
|
166
166
|
and the payment from their PlayerTwo balance (USDC on Base). You get 80% of every in-game purchase, PlayerTwo keeps
|
|
167
167
|
20% (less your backers' share if your game raised with a share of its sales). Add-ons sold on the game's page are split
|
|
168
|
-
as its sales are: PlayerTwo keeps
|
|
168
|
+
as its sales are: PlayerTwo keeps 20%. Every purchase gives your game a signed receipt (a JWT typed `p2-buy`, RS256,
|
|
169
169
|
keys at https://playertwo.lol/.well-known/p2-keys.json) and your studio's webhooks a `purchase` event. Docs:
|
|
170
170
|
https://playertwo.lol/docs/sdk#purchases.
|
|
171
171
|
|
package/index.d.ts
CHANGED
|
@@ -332,6 +332,10 @@ export interface JoinOptions extends MatchOptions {
|
|
|
332
332
|
together?: boolean;
|
|
333
333
|
/** Keep the room as a replay, from its first player (a scripted room's code says so itself: room.record). */
|
|
334
334
|
record?: boolean;
|
|
335
|
+
/** false: the room stays where it opened, near its first player. By default (rooms from r21) a room opens again
|
|
336
|
+
between far-apart players by itself once it knows their round trips, and goes back if that wasn't faster for the
|
|
337
|
+
furthest one: each page goes there as it would come back ("reconnecting", "reconnected", "moved"). */
|
|
338
|
+
between?: boolean;
|
|
335
339
|
}
|
|
336
340
|
|
|
337
341
|
/** One of the game's public rooms open now (p2.rooms.live), to watch. */
|
|
@@ -547,6 +551,11 @@ export interface RoomStats {
|
|
|
547
551
|
/** Bytes a second, sent and heard. */
|
|
548
552
|
up: number;
|
|
549
553
|
down: number;
|
|
554
|
+
/** Player to player over the fast lane (ms there and back, measured every 2 s once it is up), by player id; {}
|
|
555
|
+
without a lane (PlayerTwo's rooms from r21). */
|
|
556
|
+
peers: Record<string, { ping: number; jitter: number }>;
|
|
557
|
+
/** The worst of `peers`, or null. */
|
|
558
|
+
lanePing: number | null;
|
|
550
559
|
}
|
|
551
560
|
|
|
552
561
|
export interface Room {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playertwo-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "SDK for HTML5 and browser games on PlayerTwo (playertwo.lol): trophies, leaderboards, stats, cloud saves, in-game purchases, voice chat and multiplayer rooms with server-side room code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"playertwo",
|