@opengamehq/cli 0.13.0 → 0.13.1

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/AGENTS.md CHANGED
@@ -203,19 +203,21 @@ OpenGame hosts static browser exports. The build needs `index.html` at the root
203
203
 
204
204
  At runtime the game may call its own origin, `https://api.opengame.gg`, and any other `https:` or `wss:` host. Each call comes from the player's browser, so that host sees the player's IP address. Keep API keys on the creator's server, never in the bundle: players can read every file in it. The review sandbox has no internet, so the game must draw its first frame without its server.
205
205
 
206
+ A game may keep a service worker on the game's address; a takedown removes it and a new version replaces it.
207
+
206
208
  The published game runs at `https://<label>.opengame.gg`, one origin per game, and `opengame deploy` returns it as `data.gameOrigin`. While an experiment runs, players load each version taking part from a `v-` origin instead. If the creator's servers check `Origin` (WebSocket) or send CORS headers (HTTP), they reject the game's requests until that exact origin is on their list, and online play fails with a closed socket, a 401 or 403 on the upgrade, or a CORS error in the console. Tell the creator to add it, and to add a version's `v-` origin before starting an experiment with it. Never suggest allowing `*.opengame.gg`, `null` or any pattern on `opengame.gg`, because other people's games are served there too and a pattern lets them call the creator's server. Use a token in a header or the first socket message, not a cookie. A private preview runs on a temporary `p-` origin, not the game's. That address is a private link, so keep it out of committed config and logs. [Games that talk to your own servers](https://docs.opengame.io/guides/packaging#games-that-talk-to-your-own-servers) has server examples.
207
209
 
208
210
  A game may not take payments, use crypto, make players create an account or give an email address, show ads, or carry ad pixels or session recording. [Packaging](https://docs.opengame.io/guides/packaging) has every rule and every check.
209
211
 
210
212
  ## Multiplayer
211
213
 
212
- OpenGame runs no game server or rooms. A multiplayer game brings its own, through PeerJS or a server the creator runs, and OpenGame supplies the invite link:
214
+ OpenGame runs no game server or rooms. A game in any engine can reach the creator's servers (Colyseus, Nakama, Photon or their own) over `wss:`, WebTransport or `https:`, or links browsers over WebRTC. A browser has no raw UDP or TCP, so use the engine's WebSocket or WebRTC transport. OpenGame supplies the invite link:
213
215
 
214
- - **Invites.** Share `og.invite.link(code)`, the game's page on opengame.io with `?join=CODE`, never the game's `opengame.gg` address. After `await og.init()`, a player with `og.invite.code` set opened an invite: join them to that lobby with no menu in between. Codes are 4 to 12 capitals and digits, or 22 characters of `A-Z a-z 0-9 _ -`; for any other code, and outside OpenGame, `link` returns `null`, so keep the code on screen too.
215
- - **PeerJS.** Run the creator's PeerServer over `wss:` in place of the public `0.peerjs.com`, check `Origin` in front of it, and prefix peer ids with the game's name. Use STUN plus TURN, with TURN credentials issued by the creator's server and kept out of the bundle. When the host leaves, the next player takes over the same lobby id so shared links keep working.
216
- - **Game servers.** `wss:` and `https:` only. Allow the game's exact origin, never a pattern on `opengame.gg`. Send a token in a header or the first socket message, not a cookie, and treat `og.player.id` as the player's claim.
216
+ - **Invites.** Share `og.invite.link(code)`, the game's page on opengame.io with `?join=CODE`, never the game's `opengame.gg` address. After `await og.init()`, a player with `og.invite.code` set opened an invite: join them to that lobby with no menu in between. `link` is `null` outside OpenGame and for a code the page would change, so show the code too.
217
+ - **Game servers.** Allow only the game's exact origin. Send a token in a header or the first socket message, not a cookie. A server cannot verify `og.player.id`, so it issues that token without a sign-in and decides results.
218
+ - **Peer to peer.** Run a signalling server, such as PeerServer for PeerJS, over `wss:` instead of `0.peerjs.com`, check `Origin` in front of it, and prefix peer ids with the game's name. Use STUN plus TURN, with TURN credentials from the creator's server, not the bundle. The next host keeps the lobby id.
217
219
 
218
- [Multiplayer](https://docs.opengame.io/guides/multiplayer) has the code, the server settings and how to test a lobby with two browsers.
220
+ [Multiplayer](https://docs.opengame.io/guides/multiplayer) covers each engine, server settings and testing.
219
221
 
220
222
  ## Engines
221
223
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.1
4
+
5
+ - `check` and `deploy` say how long the files an engine downloads before its first frame
6
+ take on a 50 Mbps line, when that is 3 s or more: its `.wasm`, Unity's `.data` and
7
+ framework, Godot's `.pck` and Emscripten's `.data`, each counted as the copy OpenGame sends.
8
+ The note names the largest files and the export settings to change in Unity, Godot, Unreal
9
+ or Emscripten. It shipped in 0.13.0 without a line here.
10
+ - A Unity `.data` uploaded through the asset plan now counts toward that note. It is still
11
+ downloaded before the first frame, and the CLI's check left it out.
12
+ - `opengame deploy` picks a dropped upload up again in the same run. When the connection
13
+ drops and a file or part runs out of tries, it waits 5, 15, 30 and then 60 s and resumes,
14
+ keeping everything already sent, and says so each time. It used to exit and ask you to run
15
+ it again. `OPENGAME_UPLOAD_RESUME_ROUNDS=0` stops at the first drop, for a job that would
16
+ rather fail fast.
17
+ - Sending an archive says its rate and the time left ("Sending 1.2 GB of 4.0 GB at 12 MB/s,
18
+ about 4 min left"), as sending files already did, and the line moves at least once a second.
19
+
20
+ - Every request to the OpenGame API now names the CLI (`x-opengame-client: cli`) and the
21
+ command that made it (`x-opengame-cli-command`, such as `deploy` or
22
+ `achievements:retire`), beside the version it already sent. Never an argument, a path, a
23
+ game or a flag's value. OpenGame counts requests per token, version and command per day to
24
+ learn which commands people use. `init`, `check`, `dev`, `vendor`, `setup`, `skills`,
25
+ `token` and `deploy --dry-run` send no command name, and no command makes a request it did
26
+ not make before.
27
+ - `opengame dev` serves SDK 0.5.1, which tells OpenGame its version and which of its
28
+ features a game uses.
29
+ - While an upload goes up, its rate and time left are read from what this run sends. Picking
30
+ an upload back up used to count the files already there as speed, and could say
31
+ "at 402 MiB/s, about 2 s left" over a slow line.
32
+ - A Godot export with Progressive Web App output is no longer warned about: a game's service
33
+ worker now runs on its own address on OpenGame. `opengame dev` still runs none and says so;
34
+ check caching on a private preview.
35
+
3
36
  ## 0.13.0
4
37
 
5
38
  - `opengame.json` says how the game is played with `players`: `"single"`, or
package/README.md CHANGED
@@ -88,6 +88,14 @@ in your home folder, so a coding agent can do all of the above for you, and the
88
88
  them current as it updates. `opengame setup --no-skills` turns that off.
89
89
  `opengame skills add .` installs them into one project instead, to commit with it.
90
90
 
91
+ ## What the CLI sends
92
+
93
+ Every API request includes the CLI's version, `x-opengame-client: cli` and the name of the
94
+ command, such as `deploy`. Never an argument, a path, a game or a flag's value. OpenGame
95
+ counts requests per token, version and command per day, to learn which commands people
96
+ use. `init`, `check`, `dev`, `vendor`, `setup`, `skills` and `token` run on your machine and
97
+ send no command name.
98
+
91
99
  ## Commands
92
100
 
93
101
  <!-- generated:commands -->