mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: separate server and client for cu mode
This commit is contained in:
1 parent
a218c791a9
commit
16c77f587a
7 files changed
+17
-12
No files matched your search
@@ -39,7 +39,7 @@ export function IncrementalLoader<Props extends { key: string }>({
|
|||||||
<Item key={index} rate={rate} setCount={setCount}>
|
<Item key={index} rate={rate} setCount={setCount}>
|
||||||
<Component skeleton />
|
<Component skeleton />
|
||||||
</Item>
|
</Item>
|
||||||
)
|
),
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { api } from "../../core/api/dynamic";
|
import { api } from "../../core/api/dynamic";
|
||||||
import { clientUnmounted } from "../../core/game/game";
|
import { clientUnmounted } from "../../core/game/unmounted";
|
||||||
import { useAwait } from "../../hooks/useAwait";
|
import { useAwait } from "../../hooks/useAwait";
|
||||||
import { useGameStrings } from "../../hooks/useGameStrings";
|
import { useGameStrings } from "../../hooks/useGameStrings";
|
||||||
import { useLocale } from "../../hooks/useLocale";
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
|
import { assertSecret } from "@blitzkit/core";
|
||||||
import { GameInterface } from "@blitzkit/game";
|
import { GameInterface } from "@blitzkit/game";
|
||||||
|
import { clientUnmounted } from "./unmounted";
|
||||||
export const clientUnmounted = !("WOTB_CLIENT" in import.meta.env);
|
|
||||||
|
|
||||||
let _game: GameInterface | null = null;
|
let _game: GameInterface | null = null;
|
||||||
|
|
||||||
if (!clientUnmounted) {
|
if (!clientUnmounted) {
|
||||||
_game = new GameInterface(import.meta.env.WOTB_CLIENT);
|
_game = new GameInterface(assertSecret(import.meta.env.PUBLIC_WOTB_CLIENT));
|
||||||
} else {
|
|
||||||
console.warn("Running in client denied mode...");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const game = _game;
|
export const game = _game;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export const clientUnmounted = !("PUBLIC_WOTB_CLIENT" in import.meta.env);
|
||||||
|
|
||||||
|
if (clientUnmounted) {
|
||||||
|
console.warn("Running in client denied mode...");
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import HomeHero from "../../components/HomeHero.astro";
|
|||||||
import HomePlayers from "../../components/HomePlayers.astro";
|
import HomePlayers from "../../components/HomePlayers.astro";
|
||||||
import HomeTanks from "../../components/HomeTanks.astro";
|
import HomeTanks from "../../components/HomeTanks.astro";
|
||||||
import HomeTechnical from "../../components/HomeTechnical.astro";
|
import HomeTechnical from "../../components/HomeTechnical.astro";
|
||||||
import { clientUnmounted } from "../../core/game/game";
|
import { clientUnmounted } from "../../core/game/unmounted";
|
||||||
import { tools } from "../../core/tools/tools";
|
import { tools } from "../../core/tools/tools";
|
||||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component";
|
import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component";
|
||||||
import type { APIContext, GetStaticPaths } from "astro";
|
import type { APIContext, GetStaticPaths } from "astro";
|
||||||
import { clientUnmountedResponse } from "../../../../core/api/responses";
|
import { clientUnmountedResponse } from "../../../../core/api/responses";
|
||||||
import { clientUnmounted, game } from "../../../../core/game/game";
|
import { game } from "../../../../core/game/game";
|
||||||
|
import { clientUnmounted } from "../../../../core/game/unmounted";
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
return Object.values(Nation)
|
return Object.values(Nation)
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import type { APIContext } from "astro";
|
import type { APIContext } from "astro";
|
||||||
import { api } from "../../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
import {
|
import {
|
||||||
clientUnmountedResponse,
|
clientUnmountedResponse,
|
||||||
notFoundResponse,
|
notFoundResponse,
|
||||||
} from "../../../core/api/responses";
|
} from "../../../core/api/responses";
|
||||||
import { clientUnmounted, game } from "../../../core/game/game";
|
import { game } from "../../../core/game/game";
|
||||||
|
import { clientUnmounted } from "../../../core/game/unmounted";
|
||||||
|
|
||||||
export { getStaticPaths } from "./[id].json";
|
export { getStaticPaths } from "./[id].json";
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user