Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs committed Jul 21, 2024
1 parent 8feb819 commit 0cd62a0
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/public/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -38829,21 +38829,28 @@ async function makeCrcAsync(path4) {
}
const packet = new Packet(new Uint8Array(await file.arrayBuffer()));
const crc = Packet.getcrc(packet.data, 0, packet.data.length);
CrcTable.push(crc);
CrcBuffer.p4(crc);
return crc;
}
async function makeCrcsAsync() {
CrcTable = [];
CrcBuffer.pos = 0;
CrcBuffer.p4(0);
await makeCrcAsync("data/pack/client/title");
await makeCrcAsync("data/pack/client/config");
await makeCrcAsync("data/pack/client/interface");
await makeCrcAsync("data/pack/client/media");
await makeCrcAsync("data/pack/client/models");
await makeCrcAsync("data/pack/client/textures");
await makeCrcAsync("data/pack/client/wordenc");
await makeCrcAsync("data/pack/client/sounds");
const [title, config, iface, media, models, textures, wordenc, sounds] = await Promise.all([
makeCrcAsync("data/pack/client/title"),
makeCrcAsync("data/pack/client/config"),
makeCrcAsync("data/pack/client/interface"),
makeCrcAsync("data/pack/client/media"),
makeCrcAsync("data/pack/client/models"),
makeCrcAsync("data/pack/client/textures"),
makeCrcAsync("data/pack/client/wordenc"),
makeCrcAsync("data/pack/client/sounds")
]);
for (const crc of [title, config, iface, media, models, textures, wordenc, sounds]) {
if (crc) {
CrcTable.push(crc);
CrcBuffer.p4(crc);
}
}
CrcBuffer32 = Packet.getcrc(CrcBuffer.data, 0, CrcBuffer.data.length);
}
if (typeof self === "undefined") {
Expand Down

0 comments on commit 0cd62a0

Please sign in to comment.