Skip to content

Commit

Permalink
fix: set the manifest through code instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraviolet-jordan committed Jan 5, 2025
1 parent ac47971 commit 065cc1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<meta name="viewport" content="width=device-width, initial-scale = 0.86, maximum-scale=3.0, minimum-scale=0.86">

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="manifest" href="/manifest.json">

<style>
body {
Expand Down
10 changes: 8 additions & 2 deletions src/js/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import {setupConfiguration} from './configuration';
import Tile from './jagex2/dash3d/type/Tile';
import DirectionFlag from './jagex2/dash3d/DirectionFlag';
import ClientWorkerStream from './jagex2/io/ClientWorkerStream';
import {Host, Peer} from './jagex2/io/RTCDataChannels';
import {setupManifest} from './manifest';

// noinspection JSSuspiciousNameCombination
class Game extends Client {
Expand Down Expand Up @@ -860,7 +860,12 @@ class Game extends Client {
}
this.stream = new ClientWorkerStream(this.worker!, this.host!.uniqueId);
} else {
this.stream = new ClientStream(await ClientStream.openSocket({host: Client.serverAddress, port: 43594 + Client.portOffset}));
this.stream = new ClientStream(
await ClientStream.openSocket({
host: Client.serverAddress,
port: 43594 + Client.portOffset
})
);
}
await this.stream.readBytes(this.in.data, 0, 8);
this.in.pos = 0;
Expand Down Expand Up @@ -9490,5 +9495,6 @@ class Game extends Client {
}

console.log(`RS2 user client - release #${Client.clientversion}`);
setupManifest();
await setupConfiguration();
new Game().run().then((): void => {});
7 changes: 7 additions & 0 deletions src/js/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function setupManifest(): void {
const location: Location = window.location;
const manifest: HTMLLinkElement = document.createElement('link');
manifest.rel = 'manifest';
manifest.href = `${location.href.substring(0, location.href.indexOf(location.search))}/manifest.json`;
document.head.appendChild(manifest);
}

0 comments on commit 065cc1d

Please sign in to comment.