mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:40:43 +00:00
sticky
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
<script>
|
||||
window.GIT_COMMIT = <%- gitCommit %>;
|
||||
window.ASSET_MANIFEST = <%- assetManifest %>;
|
||||
window.WS_URL = <%- wsUrl %>;
|
||||
window.BOOTSTRAP_CONFIG = {
|
||||
gameEnv: <%- gameEnv %>,
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ export class PublicLobbySocket {
|
||||
}
|
||||
|
||||
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
const wsUrl = `${protocol}//${window.location.host}${this.workerPath}/lobbies`;
|
||||
const wsUrl = `${protocol}//${window.WS_URL}/${this.workerPath}/lobbies`;
|
||||
|
||||
this.ws = new WebSocket(wsUrl);
|
||||
this.wsAttemptCounted = false;
|
||||
|
||||
@@ -163,6 +163,7 @@ function updateAccountNavButton(userMeResponse: UserMeResponse | false) {
|
||||
declare global {
|
||||
interface Window {
|
||||
GIT_COMMIT: string;
|
||||
WS_URL: string;
|
||||
turnstile: any;
|
||||
adsEnabled: boolean;
|
||||
PageOS: {
|
||||
|
||||
@@ -324,7 +324,7 @@ export class Transport {
|
||||
) {
|
||||
this.startPing();
|
||||
this.killExistingSocket();
|
||||
const wsHost = window.location.host;
|
||||
const wsHost = window.WS_URL;
|
||||
const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
const workerPath = this.lobbyConfig.serverConfig.workerPath(
|
||||
this.lobbyConfig.gameID,
|
||||
|
||||
@@ -26,6 +26,7 @@ export async function renderHtmlContent(htmlPath: string): Promise<string> {
|
||||
backgroundImageUrl: buildAssetUrl("images/background.webp", assetManifest),
|
||||
desktopLogoImageUrl: buildAssetUrl("images/OpenFront.webp", assetManifest),
|
||||
mobileLogoImageUrl: buildAssetUrl("images/OF.webp", assetManifest),
|
||||
wsUrl: JSON.stringify(`${process.env.SUBDOMAIN}.${process.env.DOMAIN}`),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ export default defineConfig(({ mode }) => {
|
||||
inject: {
|
||||
data: {
|
||||
gitCommit: JSON.stringify("DEV"),
|
||||
wsUrl: JSON.stringify("localhost:9000"),
|
||||
...htmlAssetData,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user