@opengamehq/cli 0.12.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 +8 -6
- package/CHANGELOG.md +44 -0
- package/README.md +8 -0
- package/dist/cli.mjs +368 -159
- package/dist/opengame-global.js +3 -3
- package/dist/preflight-worker.mjs +14 -14
- package/dist/runtime-builder.mjs +15 -7
- package/dist/skills/manifest.json +11 -11
- package/dist/skills/opengame-all-in-one/SKILL.md +1 -1
- package/dist/skills/opengame-all-in-one/references/opengame-deploy/README.md +9 -7
- package/dist/skills/opengame-all-in-one/references/opengame-jam/README.md +4 -3
- package/dist/skills/opengame-deploy/SKILL.md +9 -7
- package/dist/skills/opengame-jam/SKILL.md +4 -3
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -101,7 +101,7 @@ opengame init . --title "My game" --json
|
|
|
101
101
|
opengame init . --title "Doom but blue" --kind mod --based-on "Doom" --json
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
Do not ask the creator for a description or a genre before deploying. When you know them, pass `--description` (40 characters or more) and `--
|
|
104
|
+
Do not ask the creator for a description or a genre before deploying. When you know them, pass `--description` (40 characters or more), `--genre` and `--players`; when you do not, leave them out. Every field defaults to Auto: review writes the description and the genre from the game, and the creator accepts or changes them on the deploy's page, where they also enter the jam. A title or description you pass is offered back with its casing and grammar tidied, and `opengame publish --keep-words` keeps it as written. After the deploy you can set the description yourself with `opengame details --description "..." --json`. If the file already exists, `init` fills in only the fields it leaves blank; edit the file to change the rest.
|
|
105
105
|
|
|
106
106
|
For a game that already exists on OpenGame, in a new checkout, link the folder first so the deploy does not create a second game:
|
|
107
107
|
|
|
@@ -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
|
|
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.
|
|
215
|
-
- **
|
|
216
|
-
- **
|
|
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)
|
|
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,49 @@
|
|
|
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
|
+
|
|
36
|
+
## 0.13.0
|
|
37
|
+
|
|
38
|
+
- `opengame.json` says how the game is played with `players`: `"single"`, or
|
|
39
|
+
`{ "mode": "private", "min": 2, "max": 8 }` for friends who join by a code or a link, or
|
|
40
|
+
`"mode": "online"` for players matched with strangers. `min` 1 is a game that can also be
|
|
41
|
+
played alone. Left out, or `"auto"`, review works it out and the deploy's page offers it. A
|
|
42
|
+
file with the older `"multiplayer": { "mode": "none" | "p2p" }` deploys as before.
|
|
43
|
+
- `opengame init` writes `"players": "auto"`, or what `--players`, `--min-players` and
|
|
44
|
+
`--max-players` say, and `opengame publish` takes the same three flags.
|
|
45
|
+
- `opengame pull` writes the website's players back as `players`.
|
|
46
|
+
|
|
3
47
|
## 0.12.0
|
|
4
48
|
|
|
5
49
|
- Unreal Engine 5.9 Wasm packages. `opengame init` recognises a `.uproject`, sets the export
|
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 -->
|