Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
26c865f
tree shader
tcm390 Mar 16, 2026
86c9774
refactor: unify sun-shade timing between tree and terrain
tcm390 Mar 16, 2026
4fb5e1a
refactor: use LightingConfig constants in SkySystem
tcm390 Mar 16, 2026
6257ebb
refactor: add reusable applySunShade TSL function to LightingConfig
tcm390 Mar 16, 2026
0a55dcb
fix: use normalWorldGeometry for tree toon lighting
tcm390 Mar 16, 2026
9fff7f0
refactor: unify night brightness with single NIGHT.BRIGHTNESS config
tcm390 Mar 16, 2026
aa95678
fix: remove emissive from arena materials so night blue tint shows th…
tcm390 Mar 17, 2026
02e299d
fix: move lobby/hospital pillars inside floor corners and shrink hosp…
tcm390 Mar 17, 2026
298881f
fix: sharpen leaf alpha to binary cutout to eliminate edge flickering
tcm390 Mar 17, 2026
c556104
refactor: remove coconut tree type from code
tcm390 Mar 17, 2026
cabbb1f
feat: add banana tree type and canyon biome allocation near water
tcm390 Mar 17, 2026
4877301
feat: add yucca tree type and canyon biome allocation
tcm390 Mar 17, 2026
f91e22e
feat: add windswept tree type and canyon biome allocation
tcm390 Mar 17, 2026
ee41359
camera far plane
tcm390 Mar 18, 2026
539f8e1
feat: ceil-based terracing, global elevation offset, and biome profil…
tcm390 Mar 18, 2026
113e19a
refactor: centralize arena positioning into arena-layout.ts
tcm390 Mar 18, 2026
b1c4985
fix: scale terrain shader noise and texture tiling for larger island
tcm390 Mar 18, 2026
4ffe346
feat: dual-scale texture blending to break terrain tiling repetition
tcm390 Mar 18, 2026
28638b5
feat: slope-based terrain coloring, move arena/home, disable skull/road
tcm390 Mar 19, 2026
9bda8b0
fix: reduce elevation noise frequency for smoother terrain variation
tcm390 Mar 19, 2026
bd45a0d
fix: raise water threshold to match elevated terrain
tcm390 Mar 19, 2026
631efb6
slope threshold
tcm390 Mar 19, 2026
acaae4a
feat: extend tree/vegetation generation and visibility distances
tcm390 Mar 19, 2026
d473e51
feat: water proximity weight boost for pond-shore trees and distance-…
tcm390 Mar 19, 2026
8a239e8
feat: update LOD distances, shadow frustum, fog config, and water pla…
tcm390 Mar 19, 2026
2ab13d6
refactor: remove unused tree types from TreeTypes enum
tcm390 Mar 19, 2026
ec42db4
fix: sync-bootstrap nearby terrain chunks to prevent holes on initial…
tcm390 Mar 19, 2026
fca3f25
feat: water depth opacity, reflection distance fade, terrain shader a…
tcm390 Mar 19, 2026
0d240b2
fix: restore TSL reflector for water reflections and overhaul depth c…
tcm390 Mar 21, 2026
982534c
feat: add quadtree-driven water mesh generation
tcm390 Mar 21, 2026
23354fd
style: tune water colors to match portfolio hue ratios
tcm390 Mar 21, 2026
7801dbd
feat: refactor terrain to per-biome independent height generation
tcm390 Mar 23, 2026
733221c
feat: refactor terrain shader coloring to match visualizer thresholds
tcm390 Mar 23, 2026
053d666
feat: port reference distortCoords coloring and extend fog distance
tcm390 Mar 23, 2026
8ec835c
refactor: replace Mountain/Pond landscape features with Lake, enable …
tcm390 Mar 23, 2026
5943970
feat: overhaul water shader and fix sky dome scaling
tcm390 Mar 23, 2026
020c768
feat: overhaul cloud shader with per-fragment horizon fog blend
tcm390 Mar 23, 2026
d9c8aed
fix: decouple wave phase speed from wind and match normal scroll rates
tcm390 Mar 23, 2026
b2d9487
fix: restore reference water color gradient and revert noise scroll s…
tcm390 Mar 23, 2026
39a38c7
fix: darken water color offsets and refactor tree toon to 4-band Ghib…
tcm390 Mar 23, 2026
0acdeeb
feat: add half-lambert anime shade and fresnel rim to terrain
tcm390 Mar 23, 2026
90074f2
merge main: remove landscape features/manual river, adapt docks/bridg…
tcm390 Mar 24, 2026
da6a6ea
refactor: unify water level constants and convert docks to dev-assign…
tcm390 Mar 24, 2026
1d9589b
feat: use rotation angle for docks, add test dock and bridge placements
tcm390 Mar 24, 2026
906707f
night brightness
tcm390 Mar 25, 2026
09a3f66
fix: improve tree vertex-color AO with bark/leaf channel support
tcm390 Mar 25, 2026
88a8579
feat: add dead pine tree type and increase slope limits
tcm390 Mar 25, 2026
e5bfcec
feat: add snow pine tree type with biome-driven snow shader
tcm390 Mar 25, 2026
1b6a97e
refactor: derive snow from biome config instead of hardcoded tundra c…
tcm390 Mar 25, 2026
502a3ef
feat: improve tree placement, LOD, and leaf rendering
tcm390 Mar 25, 2026
77808ff
fix: remove duplicate starter_area causing two home icons
tcm390 Mar 25, 2026
e3c8699
feat: add quad-tree chunk-based grass system with CPU frustum culling
tcm390 Mar 26, 2026
dee9bcd
fix: grass color blending with terrain via sRGB→linear conversion and…
tcm390 Mar 26, 2026
e687efb
fix: add invalidateRegion to TerrainVisualManager for flat zone updates
tcm390 Mar 26, 2026
f912f2f
fix: grass-terrain color matching and unified custom lighting
tcm390 Mar 27, 2026
f440d06
chore: temporarily disable road system
tcm390 Mar 27, 2026
abda52f
feat: biome-specific grass config, fresnel rim, distance fade, and LO…
tcm390 Mar 27, 2026
f1ac41d
feat: offload grass instance generation to web worker
tcm390 Mar 27, 2026
f38858e
fix: exclude grass from flat zones (arenas, hospitals, buildings)
tcm390 Mar 27, 2026
471b016
fix: render sun/moon behind clouds via SKY_RENDER_ORDER constants
tcm390 Mar 27, 2026
b9b78cb
feat: grass slope tilt, PBR shadow, and terrain-grass color blending
tcm390 Mar 27, 2026
6e70b82
night brightness
tcm390 Mar 27, 2026
18c866a
feat: per-biome grass tint with terrain-blended roots
tcm390 Mar 27, 2026
b3413f0
grass config
tcm390 Mar 27, 2026
cb4fb39
grass config
tcm390 Mar 27, 2026
99d90bb
fix: adjust cloud day-dark color to match sky blue hue
tcm390 Mar 27, 2026
c72f0d1
fix: memory leaks, race conditions, and LOD bugs across tree/grass sy…
tcm390 Mar 28, 2026
b5b6897
fog
tcm390 Mar 28, 2026
af4f07c
remove hardcoded river carving from canyon height function
tcm390 Mar 28, 2026
09f2399
water: add flow-mapped normals and shift palette to deep blue
tcm390 Mar 28, 2026
bdb086c
remove unused Fir tree type, add green to water color
tcm390 Mar 28, 2026
dafba7b
Merge remote-tracking branch 'origin/main' into tcm/terrain-water-sha…
tcm390 Mar 28, 2026
f933ed0
fix: move snow weight to batch color G channel to coexist with dissolve
tcm390 Mar 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added packages/client/public/textures/noise28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions packages/client/src/lib/gameClientUi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export function resolveGameClientUiDisplay(
visible: boolean,
): "block" | "none" {
export function resolveGameClientUiDisplay(visible: boolean): "block" | "none" {
return visible ? "block" : "none";
}
4 changes: 3 additions & 1 deletion packages/client/src/lib/streamingAccessToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export function primeStreamingAccessTokenFromWindow(
return cachedStreamingAccessToken;
}

const resolved = resolveStreamingAccessTokenFromHref(targetWindow.location.href);
const resolved = resolveStreamingAccessTokenFromHref(
targetWindow.location.href,
);
cachedStreamingAccessToken = resolved.token;

if (resolved.nextUrl) {
Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/screens/GameClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ export function GameClient({
// Default to game server on 5555, CDN on 8080
const runtimeEnv = await loadRuntimeEnv();
const runtimeWsUrl = normalizeEnvValue(runtimeEnv?.PUBLIC_WS_URL);
const finalWsUrl =
initialWsUrlRef.current || runtimeWsUrl || GAME_WS_URL;
const finalWsUrl = initialWsUrlRef.current || runtimeWsUrl || GAME_WS_URL;
const runtimeCdnUrl = normalizeEnvValue(runtimeEnv?.PUBLIC_CDN_URL);
const buildCdnUrl = normalizeEnvValue(CDN_URL);
const resolvedCdnUrl = resolveCdnUrlForClient(runtimeCdnUrl, buildCdnUrl);
Expand Down
14 changes: 4 additions & 10 deletions packages/client/tests/unit/lib/embeddedAuth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ describe("embeddedAuth", () => {
expect(normalizeTrustedOrigin("javascript:alert(1)")).toBeNull();
});

it(
"builds the trusted embed-origin allowlist from current, app, and configured origins",
() => {
it("builds the trusted embed-origin allowlist from current, app, and configured origins", () => {
expect(
resolveTrustedEmbedOrigins({
currentOrigin: "https://game.example.com",
Expand All @@ -41,8 +39,7 @@ describe("embeddedAuth", () => {
"https://embed.example.com",
"https://partner.example.com",
]);
},
);
});

it("ignores untrusted origins and parses valid bootstrap messages", () => {
const trustedOrigins = resolveTrustedEmbedOrigins({
Expand Down Expand Up @@ -108,9 +105,7 @@ describe("embeddedAuth", () => {
});
});

it(
"targets HYPERSCAPE_READY to a trusted referrer or explicit allowed origin",
() => {
it("targets HYPERSCAPE_READY to a trusted referrer or explicit allowed origin", () => {
const trustedOrigins = resolveTrustedEmbedOrigins({
currentOrigin: "https://game.example.com",
publicAppUrl: "https://app.example.com",
Expand Down Expand Up @@ -165,6 +160,5 @@ describe("embeddedAuth", () => {
allowWildcardFallback: true,
}),
).toBe("*");
},
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ describe("streamingAccessToken", () => {
},
} as unknown as Window;

expect(primeStreamingAccessTokenFromWindow(freshWindow)).toBe("fresh-token");
expect(primeStreamingAccessTokenFromWindow(freshWindow)).toBe(
"fresh-token",
);
});
});
10 changes: 8 additions & 2 deletions packages/client/tests/unit/screens/GameClient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ vi.mock("../../../src/game/CoreUI", () => ({
}));

vi.mock("../../../src/components/common/ErrorBoundary", () => ({
ErrorBoundary: ({ children }: { children: React.ReactNode }) => <>{children}</>,
ErrorBoundary: ({ children }: { children: React.ReactNode }) => (
<>{children}</>
),
}));

vi.mock("../../../src/lib/ThreeResourceManager", () => ({
Expand Down Expand Up @@ -97,7 +99,11 @@ describe("GameClient", () => {
expect(screen.getByTestId("core-ui")).toBeInTheDocument();

rerender(
<GameClient hideUI={true} onSetup={onSetupB} onInitError={onInitErrorB} />,
<GameClient
hideUI={true}
onSetup={onSetupB}
onInitError={onInitErrorB}
/>,
);

await waitFor(() => {
Expand Down
8 changes: 4 additions & 4 deletions packages/client/tests/unit/screens/LoadingScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ describe("LoadingScreen", () => {
);

const progressHandler = (
(world.on as unknown as ReturnType<typeof vi.fn>).mock.calls.find(
([event]) => event === EventType.ASSETS_LOADING_PROGRESS,
)?.[1] as ((payload: unknown) => void) | undefined
);
world.on as unknown as ReturnType<typeof vi.fn>
).mock.calls.find(
([event]) => event === EventType.ASSETS_LOADING_PROGRESS,
)?.[1] as ((payload: unknown) => void) | undefined;

expect(progressHandler).toBeDefined();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,14 @@ vi.mock("../../../src/components/streaming/StreamingOverlay", () => ({
state,
}: {
state: { cycle?: { phase?: string } } | null;
}) => <div data-testid="streaming-overlay">{state?.cycle?.phase ?? "NONE"}</div>,
}) => (
<div data-testid="streaming-overlay">{state?.cycle?.phase ?? "NONE"}</div>
),
}));

function createStreamingState(phase: "ANNOUNCEMENT" | "COUNTDOWN" | "FIGHTING" = "FIGHTING") {
function createStreamingState(
phase: "ANNOUNCEMENT" | "COUNTDOWN" | "FIGHTING" = "FIGHTING",
) {
return {
type: "STREAMING_STATE_UPDATE" as const,
cycle: {
Expand Down Expand Up @@ -196,13 +200,17 @@ describe("StreamingMode component", () => {
json: async () => createStreamingState(),
})),
);
(window as Window & {
__HYPERSCAPE_STREAM_READY__?: boolean;
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: unknown;
}).__HYPERSCAPE_STREAM_READY__ = false;
(window as Window & {
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: unknown;
}).__HYPERSCAPE_STREAM_RENDERER_HEALTH__ = null;
(
window as Window & {
__HYPERSCAPE_STREAM_READY__?: boolean;
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: unknown;
}
).__HYPERSCAPE_STREAM_READY__ = false;
(
window as Window & {
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: unknown;
}
).__HYPERSCAPE_STREAM_RENDERER_HEALTH__ = null;
});

afterEach(() => {
Expand Down Expand Up @@ -240,19 +248,23 @@ describe("StreamingMode component", () => {

await waitFor(() => {
expect(
(window as Window & {
__HYPERSCAPE_STREAM_READY__?: boolean;
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: {
degradedReason?: string | null;
} | null;
}).__HYPERSCAPE_STREAM_READY__,
(
window as Window & {
__HYPERSCAPE_STREAM_READY__?: boolean;
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: {
degradedReason?: string | null;
} | null;
}
).__HYPERSCAPE_STREAM_READY__,
).toBe(false);
expect(
(window as Window & {
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: {
degradedReason?: string | null;
} | null;
}).__HYPERSCAPE_STREAM_RENDERER_HEALTH__?.degradedReason,
(
window as Window & {
__HYPERSCAPE_STREAM_RENDERER_HEALTH__?: {
degradedReason?: string | null;
} | null;
}
).__HYPERSCAPE_STREAM_RENDERER_HEALTH__?.degradedReason,
).toBe("initialization_failed");
});
});
Expand Down
4 changes: 3 additions & 1 deletion packages/procgen/src/building/town/TownGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
WATER_CHECK_DIRECTIONS,
WATER_CHECK_MAX_DISTANCE,
WATER_CHECK_STEP,
DEFAULT_WATER_THRESHOLD,
} from "./constants";

// Import grid alignment utilities from building generator
Expand Down Expand Up @@ -212,7 +213,8 @@ export class TownGenerator {
const terrain = createTerrainProviderFromGenerator(terrainGenerator);

// Extract water threshold from terrain generator if available
const waterThreshold = terrainGenerator.getWaterThreshold?.() ?? 5.4;
const waterThreshold =
terrainGenerator.getWaterThreshold?.() ?? DEFAULT_WATER_THRESHOLD;

return new TownGenerator({
...options,
Expand Down
5 changes: 2 additions & 3 deletions packages/procgen/src/building/town/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ export const DEFAULT_WORLD_SIZE = 10000;
export const DEFAULT_MIN_TOWN_SPACING = 800;
export const DEFAULT_FLATNESS_SAMPLE_RADIUS = 40;
export const DEFAULT_FLATNESS_SAMPLE_COUNT = 16;
// IMPORTANT: Water threshold must match TERRAIN_CONSTANTS.WATER_THRESHOLD (9.0)
// This ensures town candidates are placed on actual land, not underwater areas
export const DEFAULT_WATER_THRESHOLD = 9.0;
import { DEFAULT_WATER_THRESHOLD } from "../../terrain/constants";
export { DEFAULT_WATER_THRESHOLD };
export const DEFAULT_OPTIMAL_WATER_DISTANCE_MIN = 30;
export const DEFAULT_OPTIMAL_WATER_DISTANCE_MAX = 150;

Expand Down
5 changes: 3 additions & 2 deletions packages/procgen/src/items/dock/DockGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ import { createRng, type RNG } from "../../math/Random.js";
// CONSTANTS
// ============================================================================

/** Default water level (Y coordinate) */
const DEFAULT_WATER_LEVEL = 5.0;
import { GAME_WATER_LEVEL } from "../../terrain/constants";

const DEFAULT_WATER_LEVEL = GAME_WATER_LEVEL;

/** Default water floor depth below water level */
const DEFAULT_WATER_FLOOR_DEPTH = 3.0;
Expand Down
5 changes: 3 additions & 2 deletions packages/procgen/src/terrain/TerrainGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { NoiseGenerator, createTileRNG } from "./NoiseGenerator";
import { BiomeSystem } from "./BiomeSystem";
import { IslandMask, DEFAULT_ISLAND_CONFIG } from "./IslandMask";
import { DEFAULT_MAX_HEIGHT, DEFAULT_WATER_THRESHOLD } from "./constants";
import type {
TerrainConfig,
TerrainNoiseConfig,
Expand Down Expand Up @@ -76,8 +77,8 @@ export const DEFAULT_TERRAIN_CONFIG: TerrainConfig = {
tileSize: 100,
worldSize: 100,
tileResolution: 64,
maxHeight: 30,
waterThreshold: 5.4,
maxHeight: DEFAULT_MAX_HEIGHT,
waterThreshold: DEFAULT_WATER_THRESHOLD,
seed: 0,
noise: DEFAULT_NOISE_CONFIG,
biomes: {
Expand Down
2 changes: 1 addition & 1 deletion packages/procgen/src/terrain/TerrainShaderTSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const TERRAIN_CONSTANTS = {
DIRT_THRESHOLD: 0.5,
LOD_FULL_DETAIL: 100.0,
LOD_MEDIUM_DETAIL: 200.0,
WATER_LEVEL: 5.0,
WATER_LEVEL: 16, // Overridden at runtime by game; standalone default for procgen previews
FOG_COLOR: new THREE.Color(0xd4c8b8),
} as const;

Expand Down
26 changes: 26 additions & 0 deletions packages/procgen/src/terrain/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Procgen Terrain Constants — single source of truth for terrain defaults.
*
* These values define the procgen package's default terrain parameters.
* All files in @hyperscape/procgen should reference these instead of
* hardcoding magic numbers.
*
* NOTE: The game runtime in @hyperscape/shared has its own
* TERRAIN_CONSTANTS.WATER_THRESHOLD (= 16) and MAX_HEIGHT (= 50).
* The procgen defaults below use a different height scale (maxHeight=30).
* When procgen is used inside the game, the game passes its own values
* via config overrides — these are just standalone defaults.
*/

/** Default max terrain height in world units */
export const DEFAULT_MAX_HEIGHT = 30;

/** Default water threshold in world units (terrain below this is underwater) */
export const DEFAULT_WATER_THRESHOLD = 5.4;

/**
* Water level in world-space Y for the game runtime.
* Must match TERRAIN_CONSTANTS.WATER_THRESHOLD in @hyperscape/shared.
* Used by systems that need the actual game water Y (e.g. DockGenerator).
*/
export const GAME_WATER_LEVEL = 16;
7 changes: 7 additions & 0 deletions packages/procgen/src/terrain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
* ```
*/

// Shared constants (single source of truth for procgen terrain defaults)
export {
DEFAULT_MAX_HEIGHT,
DEFAULT_WATER_THRESHOLD,
GAME_WATER_LEVEL,
} from "./constants";

// Core generator
export {
TerrainGenerator,
Expand Down
9 changes: 5 additions & 4 deletions packages/procgen/src/terrain/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import type { TerrainConfig, TerrainPreset } from "./types";
import { DEFAULT_TERRAIN_CONFIG } from "./TerrainGenerator";
import { DEFAULT_MAX_HEIGHT, DEFAULT_WATER_THRESHOLD } from "./constants";

/**
* Small Island preset
Expand All @@ -20,8 +21,8 @@ export const SMALL_ISLAND_PRESET: TerrainPreset = {
config: {
tileSize: 100,
worldSize: 10, // 1km x 1km
maxHeight: 30,
waterThreshold: 5.4,
maxHeight: DEFAULT_MAX_HEIGHT,
waterThreshold: DEFAULT_WATER_THRESHOLD,
island: {
enabled: true,
maxWorldSizeTiles: 10,
Expand Down Expand Up @@ -52,8 +53,8 @@ export const LARGE_ISLAND_PRESET: TerrainPreset = {
config: {
tileSize: 100,
worldSize: 100, // 10km x 10km
maxHeight: 30,
waterThreshold: 5.4,
maxHeight: DEFAULT_MAX_HEIGHT,
waterThreshold: DEFAULT_WATER_THRESHOLD,
island: {
enabled: true,
maxWorldSizeTiles: 100,
Expand Down
4 changes: 2 additions & 2 deletions packages/procgen/src/vegetation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ export const DEFAULT_PLACER_CONFIG: VegetationPlacerConfig = {
steepSlopeThreshold: 0.6,
};

/** Default water threshold when not provided */
export const DEFAULT_WATER_THRESHOLD = 5.4;
import { DEFAULT_WATER_THRESHOLD } from "../terrain/constants";
export { DEFAULT_WATER_THRESHOLD };

/** Generator-like interface for terrain provider adapter */
export interface TerrainGeneratorLike {
Expand Down
9 changes: 5 additions & 4 deletions packages/server/scripts/stream-to-rtmp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ function withViewerAccessToken(rawUrl: string): string {
const GAME_URL_CANDIDATES = Array.from(
new Set([GAME_URL, ...GAME_FALLBACK_URLS].map(withViewerAccessToken)),
);
const ALLOWED_CAPTURE_ORIGINS = resolveAllowedCaptureOrigins(
GAME_URL_CANDIDATES,
);
const ALLOWED_CAPTURE_ORIGINS =
resolveAllowedCaptureOrigins(GAME_URL_CANDIDATES);

const BRIDGE_PORT = parseInt(process.env.RTMP_BRIDGE_PORT || "8765", 10);
const BRIDGE_URL = `ws://localhost:${BRIDGE_PORT}`;
Expand Down Expand Up @@ -497,7 +496,9 @@ function assertAllowedCaptureNavigation(rawUrl: string): void {
);
}

async function abortCaptureForUnexpectedNavigation(rawUrl: string): Promise<void> {
async function abortCaptureForUnexpectedNavigation(
rawUrl: string,
): Promise<void> {
if (captureNavigationAbortInFlight) {
return;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/server/src/routes/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ const STREAMING_SSE_MAX_PENDING_BYTES = Math.max(
128 * 1024,
Math.min(
16 * 1024 * 1024,
Number.parseInt(process.env.STREAMING_SSE_MAX_PENDING_BYTES || "1048576", 10),
Number.parseInt(
process.env.STREAMING_SSE_MAX_PENDING_BYTES || "1048576",
10,
),
),
);
const STREAMING_SSE_REPLAY_MAX_BYTES = Math.max(
Expand Down
8 changes: 3 additions & 5 deletions packages/server/src/startup/uws-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ export function createUwsServer(
userData.query,
),
).catch((err: unknown) => {
const msg = err instanceof Error ? err.message : String(err);
console.error(
`[uWS] onConnection error for ${userData.wsId}: ${msg}`,
);
});
const msg = err instanceof Error ? err.message : String(err);
console.error(`[uWS] onConnection error for ${userData.wsId}: ${msg}`);
});
},

message: (ws, message, _isBinary) => {
Expand Down
Loading
Loading