Skip to content

Commit

Permalink
Games now mostly work!
Browse files Browse the repository at this point in the history
  • Loading branch information
MotorTruck1221 committed Dec 23, 2024
1 parent e2795ff commit 45c32de
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 37 deletions.
2 changes: 2 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"build": "deno task check:frontend && astro build",
"start": "deno run --allow-net --allow-read --allow-env --allow-ffi --allow-sys server/server.ts",
"bstart": "deno task build && deno task start",
"bstart:seo": "deno task build:seo && deno task start",
"bstart:standalone": "deno task build && deno task start:standalone",
"bstart:standalone:seo": "deno task build:seo && deno task start:standalone",
"start:standalone": "deno run --allow-net --allow-read --allow-env server/standalone/standalone.ts",
"check:frontend": "astro check",
"check:server": "deno check server/**/*.ts",
Expand Down
26 changes: 1 addition & 25 deletions docker-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,4 @@ services:
context: .
dockerfile: Dockerfile
container_name: incognito
restart: unless-stopped
incognito-seo:
image: motortruck1221/incognito:latest-seo
build:
context: .
dockerfile: Dockerfile
args:
- SEO=true
container_name: incognito
restart: unless-stopped
environment:
- SEO=true
- BOTH=true
incognito-seo-versioned:
image: motortruck1221/incognito:1.1.4-seo
build:
context: .
dockerfile: Dockerfile
args:
- SEO=true
container_name: incognito
restart: unless-stopped
environment:
- SEO=true
- BOTH=true
restart: unless-stopped
25 changes: 13 additions & 12 deletions src/pages/gs/[game].astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,25 @@ export const getStaticPaths = (async () => {
</div>
<script>
import { initServiceWorker } from '@scripts/serviceWorker.ts';
document.addEventListener('DOMContentLoaded', () => {
initServiceWorker().then(() => {
console.log('Service worker active!');
document.addEventListener('DOMContentLoaded', () => {
initServiceWorker().then(() => {
console.log('Service worker active!');
});
});
});
window.fullScreenGame = function () {
const iframe = document.getElementById('gameIframe') as HTMLIFrameElement;
iframe.requestFullscreen();
};
async function prox(term: string) {
async function prox(term: string, iframeId: string) {
console.log(term);
let url;
if (localStorage.getItem('incog||proxy') === 'uv') {
console.log(url);
url = __uv$config!.prefix + __uv$config.encodeUrl!(term);
} else if (localStorage.getItem('incog||proxy') === 'sj') {}
const iframe = document.getElementById('gameIframe-py') as HTMLIFrameElement;
}
else if (localStorage.getItem('incog||proxy') === 'sj') {
url = $scramjet.config.prefix + $scramjet.codec.encode(term);
}
const iframe = document.getElementById(iframeId) as HTMLIFrameElement;
iframe.src = url as string || '/load';
if (!iframe) {
return;
Expand All @@ -93,14 +96,12 @@ export const getStaticPaths = (async () => {
) as HTMLIFrameElement;
if (py && url) {
pyIframe.classList.remove('hidden');
await prox(url);
await prox(url, 'gameIframe-py');
} else {
if (normalIframe) {
normalIframe.classList.remove('hidden');
normalIframe.src = '/load';
normalIframe.src = `/gms/${
atob(game as string)!.toLowerCase().replace(/\s/g, '-')
}/${atob(baseFile as string)}`;
await prox(`https://rawcdn.githack.com/ruby-network/ruby-assets/main/games/${atob(game as string)!.toLowerCase().replace(/\s/g, '-')}/${atob(baseFile as string)}`, 'gameIframe-normal');
}
}
history.pushState({}, '', '/gs');
Expand Down

0 comments on commit 45c32de

Please sign in to comment.