diff --git a/README.md b/README.md index d7122675..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`. +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). 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); + } } } } diff --git a/src/js/jagex2/config/IdkType.ts b/src/js/jagex2/config/IdkType.ts index 2c3e230d..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(`Unrecognized idk 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 d804eb5b..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(`Unrecognized 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 dd8aa57a..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(`Unrecognized 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 3e38055f..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(`Unrecognized 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 34f672b1..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(`Error unrecognised config code: ${code}`); + console.log('Error unrecognised config code: ', code); } } } 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', ] } },