diff --git a/public/client.html b/public/client.html
index 0a948786..b5eec368 100644
--- a/public/client.html
+++ b/public/client.html
@@ -46,7 +46,6 @@
diff --git a/webAO/packets/handlers/handleCI.ts b/webAO/packets/handlers/handleCI.ts
index cb693bc7..a4e6d602 100644
--- a/webAO/packets/handlers/handleCI.ts
+++ b/webAO/packets/handlers/handleCI.ts
@@ -8,17 +8,13 @@ import { handleCharacterInfo } from '../../client/handleCharacterInfo'
*/
export const handleCI = (args: string[]) => {
// Loop through the 10 characters that were sent
-
+ document.getElementById(
+ "client_loadingtext"
+ )!.innerHTML = `Loading Character ${args[1]}/${client.char_list_length}`;
for (let i = 2; i <= args.length - 2; i++) {
- if (i % 2 === 0) {
- document.getElementById(
- "client_loadingtext"
- )!.innerHTML = `Loading Character ${args[1]}/${client.char_list_length}`;
+ if (i % 2 === 0) {
const chargs = args[i].split("&");
const charid = Number(args[i - 1]);
- ((
- document.getElementById("client_loadingbar")
- )).value = charid;
setTimeout(() => handleCharacterInfo(chargs, charid), 500);
}
}
diff --git a/webAO/packets/handlers/handleEI.ts b/webAO/packets/handlers/handleEI.ts
index 428baf10..b0236820 100644
--- a/webAO/packets/handlers/handleEI.ts
+++ b/webAO/packets/handlers/handleEI.ts
@@ -15,9 +15,6 @@ export const handleEI = (args: string[]) => {
"client_loadingtext"
)!.innerHTML = `Loading Evidence ${args[1]}/${client.evidence_list_length}`;
const evidenceID = Number(args[1]);
- (document.getElementById("client_loadingbar")).value =
- client.char_list_length + evidenceID;
-
const arg = args[2].split("&");
client.evidences[evidenceID] = {
name: prepChat(arg[0]),
diff --git a/webAO/packets/handlers/handleEM.ts b/webAO/packets/handlers/handleEM.ts
index cfe63b72..049ff67e 100644
--- a/webAO/packets/handlers/handleEM.ts
+++ b/webAO/packets/handlers/handleEM.ts
@@ -22,10 +22,6 @@ export const handleEM = (args: string[]) => {
if (i % 2 === 0) {
const trackname = args[i];
const trackindex = Number(args[i - 1]);
- ((
- document.getElementById("client_loadingbar")
- )).value =
- client.char_list_length + client.evidence_list_length + trackindex;
if (client.musics_time) {
addTrack(trackname);
} else if (isAudio(trackname)) {
@@ -37,7 +33,6 @@ export const handleEM = (args: string[]) => {
}
}
}
-
// get the next batch of tracks
client.sender.sendServer(`AM#${Number(args[1]) / 10 + 1}#%`);
}
\ No newline at end of file
diff --git a/webAO/packets/handlers/handleLE.ts b/webAO/packets/handlers/handleLE.ts
index c940b74a..e8c263ba 100644
--- a/webAO/packets/handlers/handleLE.ts
+++ b/webAO/packets/handlers/handleLE.ts
@@ -11,9 +11,6 @@ import { prepChat, safeTags } from '../../encoding';
export const handleLE = (args: string[]) => {
client.evidences = [];
for (let i = 1; i < args.length - 1; i++) {
- ((
- document.getElementById("client_loadingbar")
- )).value = client.char_list_length + i;
const arg = args[i].split("&");
client.evidences[i - 1] = {
name: prepChat(arg[0]),
diff --git a/webAO/packets/handlers/handleSC.ts b/webAO/packets/handlers/handleSC.ts
index b42a4cd7..c4b17acc 100644
--- a/webAO/packets/handlers/handleSC.ts
+++ b/webAO/packets/handlers/handleSC.ts
@@ -10,8 +10,6 @@ let { mode } = queryParser();
* @param {Array} args packet arguments
*/
export const handleSC = async (args: string[]) => {
- const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
-
if (mode === "watch") {
// Spectators don't need to pick a character
document.getElementById("client_charselect")!.style.display = "none";
@@ -22,16 +20,10 @@ export const handleSC = async (args: string[]) => {
document.getElementById("client_loadingtext")!.innerHTML =
"Loading Characters";
for (let i = 1; i < args.length - 1; i++) {
- document.getElementById(
- "client_loadingtext"
- )!.innerHTML = `Loading Character ${i}/${client.char_list_length}`;
const chargs = args[i].split("&");
const charid = i - 1;
- ((
- document.getElementById("client_loadingbar")
- )).value = charid;
- await sleep(0.1); // TODO: Too many network calls without this. net::ERR_INSUFFICIENT_RESOURCES
- handleCharacterInfo(chargs, charid);
+
+ setTimeout(() => handleCharacterInfo(chargs, charid), charid*2);
}
// We're done with the characters, request the music
client.sender.sendServer("RM#%");
diff --git a/webAO/packets/handlers/handleSI.ts b/webAO/packets/handlers/handleSI.ts
index b32fbc1a..958f9475 100644
--- a/webAO/packets/handlers/handleSI.ts
+++ b/webAO/packets/handlers/handleSI.ts
@@ -12,11 +12,6 @@ export const handleSI = (args: string[]) => {
client.evidence_list_length = Number(args[2]);
client.music_list_length = Number(args[3]);
- (document.getElementById("client_loadingbar")).max =
- client.char_list_length +
- client.evidence_list_length +
- client.music_list_length;
-
// create the charselect grid, to be filled by the character loader
document.getElementById("client_chartable")!.innerHTML = "";
diff --git a/webAO/packets/handlers/handleSM.ts b/webAO/packets/handlers/handleSM.ts
index 08bf7e0b..72374906 100644
--- a/webAO/packets/handlers/handleSM.ts
+++ b/webAO/packets/handlers/handleSM.ts
@@ -14,16 +14,15 @@ export const handleSM = (args: string[]) => {
client.musics_time = false;
+ document.getElementById(
+ "client_loadingtext"
+ )!.innerHTML = `Loading Music`;
+
for (let i = 1; i < args.length - 1; i++) {
// Check when found the song for the first time
const trackname = args[i];
const trackindex = i - 1;
- document.getElementById(
- "client_loadingtext"
- )!.innerHTML = `Loading Music ${i}/${client.music_list_length}`;
- ((
- document.getElementById("client_loadingbar")
- )).value = client.char_list_length + client.evidence_list_length + i;
+
if (client.musics_time) {
addTrack(trackname);
} else if (isAudio(trackname)) {