com.robotsquid.squidhub 0.5.8 → 0.5.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.10
4
+
5
+ **Fullscreen: the check that makes it actually work.**
6
+
7
+ `Check WebGL Settings` and every build now warn when **Run In Background** is
8
+ off. Unity WebGL pauses its main loop when the canvas loses focus, and on
9
+ SquidHub every control the player can see — mute, fullscreen, the back link —
10
+ belongs to the PORTAL, in the parent document. Clicking one takes focus off the
11
+ canvas and stops the game.
12
+
13
+ ⚠️ **Fullscreen is where it shows, and the pause is invisible.** The portal
14
+ fullscreens its own container, the frame gets bigger and the canvas CSS box
15
+ grows — but the engine loop is what syncs the WebGL render target to that box.
16
+ A paused game keeps drawing at the old resolution and is upscaled across the
17
+ whole screen. Measured: a 2560x1290 frame still rendering a 1800x1120 target,
18
+ unchanged after 24 seconds, correct within two seconds of a real click into the
19
+ game. A player sees a blurry game that sharpens when they touch it, which nobody
20
+ ever reports as a focus bug.
21
+
22
+ ⚠️ **A warning, not fatal.** The build runs, and a game that is genuinely
23
+ unplayable unfocused is entitled to pause. It is the wrong default here, not an
24
+ impossibility.
25
+
26
+ **And the button only exists if you declare it.** `display.fullscreen` defaults
27
+ to false, so the portal draws no fullscreen control at all until the manifest
28
+ opts in — tick **Fullscreen button** in `SquidHub → Game Manifest…`. That is
29
+ separate from this check, and both are needed.
30
+
31
+ ## 0.5.9
32
+
33
+ **Build and Upload just uploads.** The "Upload N files (X MB)?" confirmation is
34
+ gone. Choosing the action IS the decision, and a modal that appears after a long
35
+ WebGL build is worse than redundant — it stops an unattended build from ever
36
+ finishing.
37
+
38
+ Nothing it said is lost, only moved. The file count, the size, the endpoint, the
39
+ skipped OS metadata, the missing-manifest warning and the build warnings all go
40
+ to the Console, where they can be read *during* the upload and are still there
41
+ afterwards. A dialog is gone the moment it is dismissed, which is exactly when a
42
+ warning stops being read.
43
+
44
+ ⚠️ **Refusals still stop the run.** A precompressed build or one with no
45
+ `index.html` at its top level is a failure, not a confirmation, and the server
46
+ would reject it anyway.
47
+
3
48
  ## 0.5.8
4
49
 
5
50
  **The game fills the frame, and Unity's chrome is gone.**
@@ -38,6 +38,7 @@ namespace SquidHub.Editor
38
38
  CheckJslib(findings);
39
39
  CheckThreads(findings);
40
40
  CheckCompression(findings);
41
+ CheckRunInBackground(findings);
41
42
 
42
43
  return findings;
43
44
  }
@@ -106,6 +107,41 @@ namespace SquidHub.Editor
106
107
  "Player Settings > Publishing Settings > Compression Format to Disabled.");
107
108
  }
108
109
 
110
+ /// <summary>
111
+ /// ⚠️ Unity WebGL PAUSES ITS MAIN LOOP when the canvas loses focus, and on
112
+ /// this platform the canvas loses focus constantly: every control the
113
+ /// player can see — mute, fullscreen, the back link — belongs to the
114
+ /// PORTAL, in the parent document, not to the game. Clicking any of them
115
+ /// takes focus off the canvas and stops the game.
116
+ ///
117
+ /// ⚠️ The worst of it is fullscreen, because the pause is invisible. The
118
+ /// portal fullscreens its own container, the frame gets bigger, and the
119
+ /// canvas CSS box grows — but the engine loop is what syncs the WebGL
120
+ /// render target to that box, so a paused game keeps rendering at the old
121
+ /// resolution and is upscaled across the whole screen. Measured here: a
122
+ /// 2560x1290 frame still drawing a 1800x1120 target, unchanged after 24
123
+ /// seconds, and correct within two seconds of a real click into the game.
124
+ /// The player sees a blurry game that sharpens when they touch it, which
125
+ /// nobody reports as a focus bug.
126
+ ///
127
+ /// ⚠️ A WARNING, not fatal. The build runs, and a game that is genuinely
128
+ /// unplayable unfocused — a turn-based puzzle, say — is entitled to
129
+ /// pause. It is the wrong default here, not an impossibility.
130
+ /// </summary>
131
+ private static void CheckRunInBackground(List<Finding> findings)
132
+ {
133
+ if (PlayerSettings.runInBackground) return;
134
+
135
+ Warn(findings,
136
+ "Run In Background is off (Player Settings > Resolution and Presentation). " +
137
+ "Unity WebGL pauses when the canvas loses focus, and on SquidHub every visible " +
138
+ "control belongs to the portal rather than to the game — so the mute and " +
139
+ "fullscreen buttons stop the game as a side effect of being clicked. " +
140
+ "Fullscreen is the one that shows: the frame grows, the paused engine never " +
141
+ "resizes its render target to match, and the game is upscaled and blurry until " +
142
+ "the player clicks into it. Turn it on.");
143
+ }
144
+
109
145
  private static bool AllowsThreads()
110
146
  {
111
147
  var defines = PlayerSettings.GetScriptingDefineSymbols(NamedBuildTarget.WebGL);
@@ -85,32 +85,49 @@ namespace SquidHub.Editor
85
85
 
86
86
  var publish = SquidHubUploadSettings.PublishAfterUpload;
87
87
 
88
- if (!EditorUtility.DisplayDialog("SquidHub",
89
- $"Upload {scan.Files.Count} files ({scan.TotalBytes / 1024f / 1024f:F1} MB)?" +
90
- (scan.Skipped.Count > 0
91
- ? $"\n\n{scan.Skipped.Count} OS metadata file(s) will be skipped."
92
- : "") +
93
- // ⚠️ Said before the upload, not after. A build folder with no
94
- // manifest.json declares nothing — save schema 1, no display
95
- // constraints — and the publisher cannot tell from the result.
96
- (scan.Files.Any(f => f.Path == "manifest.json")
97
- ? ""
98
- : "\n\nThere is no manifest.json in this folder, so the build declares " +
99
- "nothing: save schema 1 and no display constraints. Set one up in " +
100
- "SquidHub → Game Manifest… and rebuild.") +
101
- // ⚠️ These describe a build that uploads fine and PLAYS badly,
102
- // which is the kind nobody catches until a player does.
103
- (scan.Warnings.Count > 0 ? "\n\n" + string.Join("\n\n", scan.Warnings) : "") +
104
- (publish
105
- ? "\n\nIt will be published to players if the server allows it — that is " +
106
- "dev only. On prod, promote it in the console."
107
- : ""),
108
- "Upload", "Cancel"))
88
+ // ⚠️ NO CONFIRMATION. Choosing "Build and Upload" IS the decision;
89
+ // asking again is a modal between the publisher and the thing they
90
+ // just asked for, and one that appears after a long WebGL build is
91
+ // worse than useless — it stops an unattended build from finishing.
92
+ //
93
+ // ⚠️ Nothing is lost, only moved. Everything the dialog used to say
94
+ // goes to the Console, where it can be read during the upload and is
95
+ // still there afterwards — a dialog is gone the moment it is
96
+ // dismissed, which is exactly when a warning stops being read.
97
+ // Refusals above still stop the run; those are failures, not
98
+ // confirmations.
99
+ Report(scan, publish);
100
+
101
+ Run(Upload(scan, publish));
102
+ }
103
+
104
+ /// <summary>
105
+ /// What the dialog used to ask, said to the Console instead.
106
+ ///
107
+ /// ⚠️ Warnings are LogWarning, not Log. They describe a build that
108
+ /// uploads perfectly and plays badly, so they have to survive a Console
109
+ /// that is already full of build spam.
110
+ /// </summary>
111
+ private static void Report(BuildScan scan, bool publish)
112
+ {
113
+ Debug.Log($"[SquidHub] uploading {scan.Files.Count} file(s), " +
114
+ $"{scan.TotalBytes / 1024f / 1024f:F1} MB, to {SquidHubUploadSettings.Endpoint}" +
115
+ (scan.Skipped.Count > 0
116
+ ? $" ({scan.Skipped.Count} OS metadata file(s) skipped)"
117
+ : "") +
118
+ (publish ? " — will publish on success where the server allows it (dev only)." : "."));
119
+
120
+ // ⚠️ A build folder with no manifest.json declares nothing — save
121
+ // schema 1, no display constraints — and nothing in the upload
122
+ // result would ever tell the publisher that.
123
+ if (!scan.Files.Any(f => f.Path == "manifest.json"))
109
124
  {
110
- return;
125
+ Debug.LogWarning(
126
+ "[SquidHub] no manifest.json in this build, so it declares nothing: save schema 1 " +
127
+ "and no display constraints. Set one up in SquidHub → Game Manifest… and rebuild.");
111
128
  }
112
129
 
113
- Run(Upload(scan, publish));
130
+ foreach (var warning in scan.Warnings) Debug.LogWarning("[SquidHub] " + warning);
114
131
  }
115
132
 
116
133
  // ⚠️ Driven by EditorApplication.update rather than blocking. Sleeping
package/README.md CHANGED
@@ -144,6 +144,11 @@ an upload key is not a person — it sits in CI configs and Editor preferences.
144
144
  That asymmetry is deliberate: it is what keeps a leaked key from replacing the
145
145
  live build for everyone.
146
146
 
147
+ ⚠️ **It does not ask.** Choosing the action is the decision, so there is no
148
+ "upload N files?" confirmation to dismiss — the file count, size, destination and
149
+ any warnings go to the Console instead, where they survive being read. A build
150
+ that *cannot* upload still stops with a dialog naming the fix.
151
+
147
152
  The upload is refused before a byte moves if the build is precompressed or has
148
153
  no `index.html` at its top level, and OS metadata is dropped rather than sent —
149
154
  which is also what makes a build pushed from Unity hash identically to the same
@@ -170,6 +175,7 @@ The package checks these for you, but for reference:
170
175
  | Setting | Value | Why |
171
176
  |---|---|---|
172
177
  | Native C/C++ Multithreading | **off** | SquidHub's default tier is not cross-origin isolated, so `SharedArrayBuffer` does not exist. A pthreads build cannot start. Ask about the isolated tier if you genuinely need threads — it carries no ads |
178
+ | Run In Background | **on** | ⚠️ Unity WebGL pauses when the canvas loses focus, and every control on SquidHub — mute, fullscreen, back — belongs to the portal, not the game. Left off, clicking any of them stops the game; fullscreen then keeps rendering at the pre-fullscreen resolution, so the game is blurry until the player clicks into it |
173
179
  | Compression Format | **Disabled** | ⚠️ Required, and the build is refused otherwise. SquidHub stores assets uncompressed and Cloudflare compresses them at the edge, per client. A precompressed build cannot be served correctly at all |
174
180
 
175
181
  ## Things that will otherwise bite
@@ -184,6 +190,14 @@ data:`. A CDN font, a remote texture or a third-party analytics snippet is
184
190
  blocked at load and shows up as a console error, not as a missing style.
185
191
  Everything must ship inside the build.
186
192
 
193
+ ⚠️ **Fullscreen needs two things, and neither is the Unity fullscreen button.**
194
+ Tick **Fullscreen button** in `SquidHub → Game Manifest…` — `display.fullscreen`
195
+ defaults to false and the portal draws no control without it — and turn on **Run
196
+ In Background**, or the game pauses the moment the player clicks that control and
197
+ stays at the old resolution while the frame grows. The portal fullscreens its own
198
+ container rather than asking your game to do it, so your build needs no fullscreen
199
+ code at all; Unity's own button is hidden for you.
200
+
187
201
  ⚠️ **Do not write your own rotate prompt or call `screen.orientation.lock()`.**
188
202
  Declare the orientations you support in `SquidHub → Game Manifest…` and the
189
203
  portal draws the prompt outside your frame. Two prompts fight, and yours is the one the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.robotsquid.squidhub",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "displayName": "SquidHub",
5
5
  "description": "Cloud saves, analytics and the coin economy for Unity WebGL games published on SquidHub. Installs the C# wrapper, the .jslib half and the page bridge, and rewrites the exported index.html so it survives the platform's CSP.",
6
6
  "unity": "2021.3",