@dreamboard-games/cli 0.1.30-alpha.11 → 0.1.30-alpha.12
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/dist/dev-host/host-main.tsx +10 -4
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
DrawerTrigger,
|
|
22
22
|
} from "./components/drawer.js";
|
|
23
23
|
import { Input } from "./components/input.js";
|
|
24
|
+
import { createGameplayCapability } from "@dreamboard-games/api-client";
|
|
24
25
|
import { client } from "@dreamboard-games/api-client/client.gen";
|
|
25
26
|
import {
|
|
26
27
|
HostFeedbackToaster,
|
|
@@ -61,10 +62,19 @@ import { resolveInitialDevHostPlayerId } from "./dev-host-player-query.js";
|
|
|
61
62
|
const diagnosticsLevel = resolveDevDiagnosticsLevel(devConfig.debug);
|
|
62
63
|
const devLogger = createDevDiagnosticsLogger(diagnosticsLevel);
|
|
63
64
|
const storage = new SessionStorageDevHostStorage(window.sessionStorage);
|
|
65
|
+
// The browser never sees the bearer token. All backend traffic is
|
|
66
|
+
// same-origin and the CLI's reverse-proxy middleware (`/api/*`) injects
|
|
67
|
+
// `Authorization: Bearer <fresh>` on the wire.
|
|
68
|
+
client.setConfig({ baseUrl: "" });
|
|
69
|
+
const createDevHostGameplayCapability = (
|
|
70
|
+
options: Parameters<typeof createGameplayCapability>[0],
|
|
71
|
+
): ReturnType<typeof createGameplayCapability> =>
|
|
72
|
+
createGameplayCapability({ ...options, client });
|
|
64
73
|
// Gameplay streaming and submits go through the Gameplay Authority WebSocket
|
|
65
74
|
// (the backend's event-batches stream is removed); snapshot/start/dev-session
|
|
66
75
|
// requests fall back to the dev-server endpoints.
|
|
67
76
|
const hostSessionTransport = createGameplayAuthorityTransport({
|
|
77
|
+
capabilityRequester: createDevHostGameplayCapability,
|
|
68
78
|
fallbackTransport: createDevHostSessionTransport(),
|
|
69
79
|
getCurrentSessionContext: () =>
|
|
70
80
|
unifiedSessionSelectors.sessionContext(store.getState()),
|
|
@@ -132,10 +142,6 @@ const controller = new DevHostController(
|
|
|
132
142
|
devLogger,
|
|
133
143
|
);
|
|
134
144
|
|
|
135
|
-
// The browser never sees the bearer token. All backend traffic is
|
|
136
|
-
// same-origin and the CLI's reverse-proxy middleware (`/api/*`) injects
|
|
137
|
-
// `Authorization: Bearer <fresh>` on the wire.
|
|
138
|
-
client.setConfig({ baseUrl: "" });
|
|
139
145
|
installProxyAuthErrorInterceptor();
|
|
140
146
|
|
|
141
147
|
const app = document.getElementById("app");
|