mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-07 23:24:48 +00:00
.
This commit is contained in:
parent
d554212037
commit
2affbe701e
@ -1,9 +1,14 @@
|
|||||||
// @ts-nocheck
|
import {
|
||||||
import { Router } from 'express';
|
Router,
|
||||||
const indexRouter = Router();
|
type Request,
|
||||||
|
type Response,
|
||||||
|
type NextFunction,
|
||||||
|
} from 'express';
|
||||||
|
|
||||||
indexRouter.get('/', async (req, res) => {
|
const router = Router();
|
||||||
// router for future use
|
|
||||||
|
router.get('/', (_req: Request, _res: Response, next: NextFunction) => {
|
||||||
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
export { indexRouter };
|
export default router;
|
||||||
|
@ -16,7 +16,7 @@ import morgan from 'morgan';
|
|||||||
import serveFavicon from 'serve-favicon';
|
import serveFavicon from 'serve-favicon';
|
||||||
import serveStatic from 'serve-static';
|
import serveStatic from 'serve-static';
|
||||||
|
|
||||||
import { indexRouter } from './routes/index.ts';
|
import indexRouter from './routes/index.ts';
|
||||||
|
|
||||||
const BASE_DIR = join(import.meta.dir, 'public');
|
const BASE_DIR = join(import.meta.dir, 'public');
|
||||||
const PORT = process.env['PORT'] ?? 3000;
|
const PORT = process.env['PORT'] ?? 3000;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script src="/resources/scripts/google-tag.js"></script>
|
<script src="/resources/scripts/google-tag.js"></script>
|
||||||
<script src="/game/web/clients/starlike/classes.js"></script>
|
<script src="/game/web/clients/starlike/classes.js"></script>
|
||||||
<script src="/resources/scripts/eagler-launch/1.8.8/eaglerpocketmobile.js"></script>
|
<script src="/resources/scripts/eagler-launch/1.8.8/eaglerpocketmobile.js"></script>
|
||||||
<script src="/resources/scripts/eagler-launch/1.9.4/main.js"></script>
|
<script src="/resources/scripts/eagler-launch/1.8.8/main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body id="game_frame"></body>
|
<body id="game_frame"></body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<script src="/resources/scripts/google-tag.js"></script>
|
<script src="/resources/scripts/google-tag.js"></script>
|
||||||
<script src="/game/web/main/1.11.2/classes.js"></script>
|
<script src="/game/web/main/1.11.2/classes.js"></script>
|
||||||
<script src="/resources/scripts/eagler-launch/1.8.8/eaglerpocketmobile.js"></script>
|
<script src="/resources/scripts/eagler-launch/1.8.8/eaglerpocketmobile.js"></script>
|
||||||
<script src="/resources/scripts/eagler-launch/1.9.4/main.js"></script>
|
<script src="/resources/scripts/eagler-launch/1.8.8/main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body id="game_frame"></body>
|
<body id="game_frame"></body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<script src="/resources/scripts/google-tag.js"></script>
|
<script src="/resources/scripts/google-tag.js"></script>
|
||||||
<script src="/game/web/main/1.9.4/classes.js"></script>
|
<script src="/game/web/main/1.9.4/classes.js"></script>
|
||||||
<script src="/resources/scripts/eagler-launch/1.8.8/eaglerpocketmobile.js"></script>
|
<script src="/resources/scripts/eagler-launch/1.8.8/eaglerpocketmobile.js"></script>
|
||||||
<script src="/resources/scripts/eagler-launch/1.9.4/main.js"></script>
|
<script src="/resources/scripts/eagler-launch/1.8.8/main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body id="game_frame"></body>
|
<body id="game_frame"></body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,5 +1,41 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import { inflate } from 'pako';
|
import { inflate } from 'pako';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
eaglercraftXOpts: {
|
||||||
|
container: string;
|
||||||
|
assetsURI: string;
|
||||||
|
localesURI?: string;
|
||||||
|
lang?: string;
|
||||||
|
joinServer?: string;
|
||||||
|
worldsDB?: string;
|
||||||
|
resourcePacksDB?: string;
|
||||||
|
demoMode?: boolean;
|
||||||
|
servers: { addr: string; name: string }[];
|
||||||
|
relays: { addr: string; comment: string; primary: boolean }[];
|
||||||
|
checkShaderGLErrors?: boolean;
|
||||||
|
enableDownloadOfflineButton?: boolean;
|
||||||
|
downloadOfflineButtonLink?: string;
|
||||||
|
html5CursorSupport?: boolean;
|
||||||
|
allowUpdateSvc?: boolean;
|
||||||
|
allowUpdateDL?: boolean;
|
||||||
|
logInvalidCerts?: boolean;
|
||||||
|
enableSignatureBadge?: boolean;
|
||||||
|
checkRelaysForUpdates?: boolean;
|
||||||
|
allowVoiceClient?: boolean;
|
||||||
|
allowFNAWSkins?: boolean;
|
||||||
|
localStorageNamespace?: string;
|
||||||
|
enableMinceraft?: boolean;
|
||||||
|
hooks?: {
|
||||||
|
localStorageSaved?: (key: string, data: string) => void;
|
||||||
|
localStorageLoaded?: (key: string) => string | null;
|
||||||
|
};
|
||||||
|
Mods?: string[];
|
||||||
|
};
|
||||||
|
main: () => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const storage = {
|
const storage = {
|
||||||
local: {
|
local: {
|
||||||
get: function (key: string) {
|
get: function (key: string) {
|
||||||
@ -15,6 +51,7 @@ const storage = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const base64Gzip = {
|
const base64Gzip = {
|
||||||
decompress: function (string: string): string {
|
decompress: function (string: string): string {
|
||||||
return inflate(
|
return inflate(
|
||||||
@ -24,42 +61,40 @@ const base64Gzip = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
const randomRelay = Math.floor(Math.random() * 3);
|
||||||
const relayId = Math.floor(Math.random() * 3);
|
window.eaglercraftXOpts = {
|
||||||
window.eaglercraftXOpts = {
|
container: 'game_frame',
|
||||||
container: 'game_frame',
|
assetsURI: 'assets.epk',
|
||||||
assetsURI: `${window.location.pathname}/assets.epk`,
|
servers: [
|
||||||
localesURI: `${window.location.pathname}/lang/`,
|
{ addr: 'wss://temuzx.xyz', name: 'TemuzX' },
|
||||||
servers: [
|
{ addr: 'wss://webmc.xyz/server', name: 'WebMC OneBlock' },
|
||||||
{ addr: 'wss://webmc.xyz/server', name: 'WebMC OneBlock' },
|
{ addr: 'wss://mc.ricenetwork.xyz', name: 'Rice Network' },
|
||||||
{ addr: 'wss://mc.ricenetwork.xyz', name: 'Rice Network' },
|
{ addr: 'wss://mc.lamplifesteal.xyz', name: 'LampLifesteal' },
|
||||||
{ addr: 'wss://mc.lamplifesteal.xyz', name: 'LampLifesteal' },
|
{ addr: 'wss://electronmc.club', name: 'Electron Network' },
|
||||||
{ addr: 'wss://electronmc.club', name: 'Electron Network' },
|
{ addr: 'wss://play.brickmc.net', name: 'BrickMC' },
|
||||||
{ addr: 'wss://play.brickmc.net', name: 'BrickMC' },
|
],
|
||||||
],
|
relays: [
|
||||||
relays: [
|
{
|
||||||
{
|
addr: 'wss://relay.deev.is',
|
||||||
addr: 'wss://relay.deev.is/',
|
comment: 'lax1dude relay #1',
|
||||||
comment: 'lax1dude relay #1',
|
primary: randomRelay === 0,
|
||||||
primary: relayId === 0,
|
},
|
||||||
},
|
{
|
||||||
{
|
addr: 'wss://relay.lax1dude.net',
|
||||||
addr: 'wss://relay.lax1dude.net/',
|
comment: 'lax1dude relay #2',
|
||||||
comment: 'lax1dude relay #2',
|
primary: randomRelay === 1,
|
||||||
primary: relayId === 1,
|
},
|
||||||
},
|
{
|
||||||
{
|
addr: 'wss://relay.shhnowisnottheti.me',
|
||||||
addr: 'wss://relay.shhnowisnottheti.me/',
|
comment: 'ayunami relay #1',
|
||||||
comment: 'ayunami relay #1',
|
primary: randomRelay === 2,
|
||||||
primary: relayId === 2,
|
},
|
||||||
},
|
],
|
||||||
],
|
Mods: storage.local.get('mods') ?? [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
const server = urlParams.get('server');
|
||||||
window.eaglercraftXOpts.Mods = storage.local.get('mods') ?? [];
|
if (server) window.eaglercraftXOpts.joinServer = server;
|
||||||
|
|
||||||
history.replaceState({}, '', '/play');
|
window.onload = () => window.main();
|
||||||
main();
|
|
||||||
});
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
window.addEventListener('load', () => {
|
|
||||||
const relayId = Math.floor(Math.random() * 3);
|
|
||||||
window.eaglercraftXOpts = {
|
|
||||||
container: 'game_frame',
|
|
||||||
assetsURI: `${window.location.pathname}/assets.epk`,
|
|
||||||
localesURI: `${window.location.pathname}/lang/`,
|
|
||||||
servers: [{ addr: 'wss://temuzx.xyz', name: 'TemuzX' }],
|
|
||||||
relays: [
|
|
||||||
{
|
|
||||||
addr: 'wss://relay.deev.is/',
|
|
||||||
comment: 'lax1dude relay #1',
|
|
||||||
primary: relayId === 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
addr: 'wss://relay.lax1dude.net/',
|
|
||||||
comment: 'lax1dude relay #2',
|
|
||||||
primary: relayId === 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
addr: 'wss://relay.shhnowisnottheti.me/',
|
|
||||||
comment: 'ayunami relay #1',
|
|
||||||
primary: relayId === 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
|
||||||
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
|
||||||
|
|
||||||
history.replaceState({}, '', '/play');
|
|
||||||
main();
|
|
||||||
});
|
|
@ -1,4 +1,9 @@
|
|||||||
// @ts-nocheck
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
dataLayer: unknown[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const googleTag = document.createElement('script');
|
const googleTag = document.createElement('script');
|
||||||
googleTag.async = true;
|
googleTag.async = true;
|
||||||
googleTag.src = 'https://www.googletagmanager.com/gtag/js?id=G-GD4SJRCR7Z';
|
googleTag.src = 'https://www.googletagmanager.com/gtag/js?id=G-GD4SJRCR7Z';
|
||||||
@ -6,7 +11,7 @@ document.head.appendChild(googleTag);
|
|||||||
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(...args: unknown[]) {
|
function gtag(...args: unknown[]) {
|
||||||
dataLayer.push(...args);
|
window.dataLayer.push(...args);
|
||||||
}
|
}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
gtag('config', 'G-GD4SJRCR7Z');
|
gtag('config', 'G-GD4SJRCR7Z');
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
// @ts-nocheck
|
/* const cacheVersion = '1.6';
|
||||||
/*
|
|
||||||
const cacheVersion = '1.6';
|
|
||||||
const cacheName = `minexlauncher-full-v${cacheVersion}`;
|
const cacheName = `minexlauncher-full-v${cacheVersion}`;
|
||||||
|
|
||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
@ -57,5 +55,4 @@ self.addEventListener('fetch', (event) => {
|
|||||||
return response ?? fetch(event.request);
|
return response ?? fetch(event.request);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
});
|
}); */
|
||||||
*/
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// @ts-nocheck
|
/* const CACHE_VERSION = '1.6';
|
||||||
/*const CACHE_VERSION = '1.6';
|
|
||||||
const OFFLINE_URL = '/offline/';
|
const OFFLINE_URL = '/offline/';
|
||||||
const CACHE_ASSETS = [
|
const CACHE_ASSETS = [
|
||||||
OFFLINE_URL,
|
OFFLINE_URL,
|
||||||
@ -89,5 +88,4 @@ self.addEventListener('fetch', (event) => {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
}); */
|
||||||
*/
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user