From dedeb5f85c75a33f0616b95875ef3d1448fb022f Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:45:23 +0200 Subject: [PATCH 1/7] fix: error msges from 225 --- src/js/jagex2/config/FloType.ts | 2 +- src/js/jagex2/config/IdkType.ts | 2 +- src/js/jagex2/config/MesAnimType.ts | 2 +- src/js/jagex2/config/SeqType.ts | 2 +- src/js/jagex2/config/SpotAnimType.ts | 2 +- src/js/jagex2/config/VarpType.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/jagex2/config/FloType.ts b/src/js/jagex2/config/FloType.ts index 70199b67..68271a31 100644 --- a/src/js/jagex2/config/FloType.ts +++ b/src/js/jagex2/config/FloType.ts @@ -94,7 +94,7 @@ export default class FloType extends ConfigType { } else if (code === 6) { this.debugname = dat.gjstr; } else { - console.log('Error unrecognised config code: ', code); + throw new Error(`Unrecognised config code: ${code}`); } } diff --git a/src/js/jagex2/config/IdkType.ts b/src/js/jagex2/config/IdkType.ts index 2c3e230d..50ecd34b 100644 --- a/src/js/jagex2/config/IdkType.ts +++ b/src/js/jagex2/config/IdkType.ts @@ -44,7 +44,7 @@ export default class IdkType extends ConfigType { } else if (code >= 60 && code < 70) { this.heads[code - 60] = dat.g2; } else { - throw new Error(`Unrecognized idk config code: ${code}`); + throw new Error(`Unrecognised config code: ${code}`); } } diff --git a/src/js/jagex2/config/MesAnimType.ts b/src/js/jagex2/config/MesAnimType.ts index d804eb5b..a21f298f 100644 --- a/src/js/jagex2/config/MesAnimType.ts +++ b/src/js/jagex2/config/MesAnimType.ts @@ -24,7 +24,7 @@ export default class MesAnimType extends ConfigType { } else if (code === 250) { this.debugname = dat.gjstr; } else { - throw new Error(`Unrecognized mesanim config code: ${code}`); + throw new Error(`Unrecognised mesanim config code: ${code}`); } } } diff --git a/src/js/jagex2/config/SeqType.ts b/src/js/jagex2/config/SeqType.ts index dd8aa57a..6450a1ed 100644 --- a/src/js/jagex2/config/SeqType.ts +++ b/src/js/jagex2/config/SeqType.ts @@ -93,7 +93,7 @@ export default class SeqType extends ConfigType { } else if (code === 8) { this.replaycount = dat.g1; } else { - throw new Error(`Unrecognized seq config code: ${code}`); + throw new Error(`Unrecognised seq config code: ${code}`); } } } diff --git a/src/js/jagex2/config/SpotAnimType.ts b/src/js/jagex2/config/SpotAnimType.ts index 3e38055f..b4821f80 100644 --- a/src/js/jagex2/config/SpotAnimType.ts +++ b/src/js/jagex2/config/SpotAnimType.ts @@ -58,7 +58,7 @@ export default class SpotAnimType extends ConfigType { } else if (code >= 50 && code < 60) { this.recol_d[code - 50] = dat.g2; } else { - throw new Error(`Unrecognized spotanim config code: ${code}`); + throw new Error(`Unrecognised spotanim config code: ${code}`); } } diff --git a/src/js/jagex2/config/VarpType.ts b/src/js/jagex2/config/VarpType.ts index 34f672b1..afdd9bb0 100644 --- a/src/js/jagex2/config/VarpType.ts +++ b/src/js/jagex2/config/VarpType.ts @@ -48,7 +48,7 @@ export default class VarpType extends ConfigType { } else if (code === 10) { this.debugname = dat.gjstr; } else { - throw new Error(`Error unrecognised config code: ${code}`); + throw new Error(`Unrecognised config code: ${code}`); } } } From b6c00e17507fae01e0503830fb77c12b310c7ca2 Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Wed, 31 Jul 2024 21:03:05 +0200 Subject: [PATCH 2/7] don't need to keep prompt open for peers (just host) --- src/js/client.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/client.ts b/src/js/client.ts index aeabceb1..c4ec8e51 100644 --- a/src/js/client.ts +++ b/src/js/client.ts @@ -786,12 +786,13 @@ export abstract class Client extends GameShell { return; } - let offer: string | null; - try { - while ((offer = prompt('Paste offer here, answer will be copied to clipboard')) === null); - await this.peer.handleOffer(offer); - } catch (e) { - console.error(e); + const offer: string | null = prompt('Paste offer here, answer will be copied to clipboard'); + if (offer) { + try { + await this.peer.handleOffer(offer); + } catch (e) { + console.error(e); + } } } } From fd67bf57b16aaa930db505954d46435443f3b5c6 Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Wed, 31 Jul 2024 23:08:07 +0200 Subject: [PATCH 3/7] add note for prod build, hot-reloading doesn't handle many files too well --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7122675..22e27fa8 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ http://localhost/client?world=0&detail=high&method=0 (Java) A web worker server will start when loading world 999. This works as a no install, offline, singleplayer version of the server. You will need to self host in order to load saves. How to use: -1. Run `npm run build` and then `npm run bundle` in the server, this copies all required files to `../Client2/public`. +1. Run `npm run build` and then `npm run bundle` in the server, this copies all required files to `../Client2/public`. Start it with `npm run prod`. 2. A save dialog will open on logout, you should save to `/public/data/players`. 3. Optional: To host on github uncomment the lines starting with `!/public` in the [.gitignore](.gitignore). From 30ab0fb675be78291a40c4aaf635245e6b8aeb28 Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:39:32 +0200 Subject: [PATCH 4/7] note --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22e27fa8..d2477ee7 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ http://localhost/client?world=0&detail=high&method=0 (Java) A web worker server will start when loading world 999. This works as a no install, offline, singleplayer version of the server. You will need to self host in order to load saves. How to use: -1. Run `npm run build` and then `npm run bundle` in the server, this copies all required files to `../Client2/public`. Start it with `npm run prod`. +1. Run `npm run build` and then `npm run bundle` in the server, this copies all required files to `../Client2/public`. Start client with `npm run prod`. 2. A save dialog will open on logout, you should save to `/public/data/players`. 3. Optional: To host on github uncomment the lines starting with `!/public` in the [.gitignore](.gitignore). From 8250559d880e589f86bf4f7634b5e682f684eb0e Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:37:06 +0200 Subject: [PATCH 5/7] fix gzip on viewer.html --- webpack.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 996f7745..78fd8638 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -391,6 +391,13 @@ module.exports = () => { 'grow', 'iceServers', 'urls', + 'malloc_u8', + 'free_u8', + 'gzip_decompress', + 'gzip_compress', + 'error_message', + 'error_message_len', + 'deallocate_buffer', ] } }, From 56b16b6c74c1f269b6204eecc099a421ddd198f5 Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:54:36 +0200 Subject: [PATCH 6/7] undo error change --- src/js/jagex2/config/FloType.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/jagex2/config/FloType.ts b/src/js/jagex2/config/FloType.ts index 68271a31..70199b67 100644 --- a/src/js/jagex2/config/FloType.ts +++ b/src/js/jagex2/config/FloType.ts @@ -94,7 +94,7 @@ export default class FloType extends ConfigType { } else if (code === 6) { this.debugname = dat.gjstr; } else { - throw new Error(`Unrecognised config code: ${code}`); + console.log('Error unrecognised config code: ', code); } } From 6440805b234a6467a465ed96563a53c881537135 Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:20:34 +0200 Subject: [PATCH 7/7] change errors to logs --- src/js/jagex2/config/IdkType.ts | 2 +- src/js/jagex2/config/MesAnimType.ts | 2 +- src/js/jagex2/config/SeqType.ts | 2 +- src/js/jagex2/config/SpotAnimType.ts | 2 +- src/js/jagex2/config/VarpType.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/jagex2/config/IdkType.ts b/src/js/jagex2/config/IdkType.ts index 50ecd34b..a35b2005 100644 --- a/src/js/jagex2/config/IdkType.ts +++ b/src/js/jagex2/config/IdkType.ts @@ -44,7 +44,7 @@ export default class IdkType extends ConfigType { } else if (code >= 60 && code < 70) { this.heads[code - 60] = dat.g2; } else { - throw new Error(`Unrecognised config code: ${code}`); + console.log('Error unrecognised config code: ', code); } } diff --git a/src/js/jagex2/config/MesAnimType.ts b/src/js/jagex2/config/MesAnimType.ts index a21f298f..935eaba7 100644 --- a/src/js/jagex2/config/MesAnimType.ts +++ b/src/js/jagex2/config/MesAnimType.ts @@ -24,7 +24,7 @@ export default class MesAnimType extends ConfigType { } else if (code === 250) { this.debugname = dat.gjstr; } else { - throw new Error(`Unrecognised mesanim config code: ${code}`); + console.log('Error unrecognised mesanim config code: ', code); } } } diff --git a/src/js/jagex2/config/SeqType.ts b/src/js/jagex2/config/SeqType.ts index 6450a1ed..2487b199 100644 --- a/src/js/jagex2/config/SeqType.ts +++ b/src/js/jagex2/config/SeqType.ts @@ -93,7 +93,7 @@ export default class SeqType extends ConfigType { } else if (code === 8) { this.replaycount = dat.g1; } else { - throw new Error(`Unrecognised seq config code: ${code}`); + console.log('Error unrecognised seq config code: ', code); } } } diff --git a/src/js/jagex2/config/SpotAnimType.ts b/src/js/jagex2/config/SpotAnimType.ts index b4821f80..3055b296 100644 --- a/src/js/jagex2/config/SpotAnimType.ts +++ b/src/js/jagex2/config/SpotAnimType.ts @@ -58,7 +58,7 @@ export default class SpotAnimType extends ConfigType { } else if (code >= 50 && code < 60) { this.recol_d[code - 50] = dat.g2; } else { - throw new Error(`Unrecognised spotanim config code: ${code}`); + console.log('Error unrecognised spotanim config code: ', code); } } diff --git a/src/js/jagex2/config/VarpType.ts b/src/js/jagex2/config/VarpType.ts index afdd9bb0..eb57d680 100644 --- a/src/js/jagex2/config/VarpType.ts +++ b/src/js/jagex2/config/VarpType.ts @@ -48,7 +48,7 @@ export default class VarpType extends ConfigType { } else if (code === 10) { this.debugname = dat.gjstr; } else { - throw new Error(`Unrecognised config code: ${code}`); + console.log('Error unrecognised config code: ', code); } } }