Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error msges from 225, and small peer improvement #22

Merged
merged 7 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
13 changes: 7 additions & 6 deletions src/js/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/jagex2/config/IdkType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
lesleyrs marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/jagex2/config/MesAnimType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}
}
2 changes: 1 addition & 1 deletion src/js/jagex2/config/SeqType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}
}
2 changes: 1 addition & 1 deletion src/js/jagex2/config/SpotAnimType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/jagex2/config/VarpType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}
}
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ module.exports = () => {
'grow',
'iceServers',
'urls',
'malloc_u8',
'free_u8',
'gzip_decompress',
'gzip_compress',
'error_message',
'error_message_len',
'deallocate_buffer',
]
}
},
Expand Down
Loading