diff options
| author | stonedDiscord <stonedDiscord@users.noreply.github.com> | 2024-11-20 13:31:50 +0000 |
|---|---|---|
| committer | GitHub Action <actions@github.com> | 2024-11-20 13:31:50 +0000 |
| commit | 6684f3fce6e90fd0574d7bab63b629554ab03ef6 (patch) | |
| tree | b2a62247d17e23a77af57aea355ba621666817c2 /webAO/packets/handlers/handleCI.ts | |
| parent | 95a2d1361d84c61b454ebe506e6963b93f6d8dee (diff) | |
Prettified Code!
Diffstat (limited to 'webAO/packets/handlers/handleCI.ts')
| -rw-r--r-- | webAO/packets/handlers/handleCI.ts | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/webAO/packets/handlers/handleCI.ts b/webAO/packets/handlers/handleCI.ts index a4e6d60..c0cbd84 100644 --- a/webAO/packets/handlers/handleCI.ts +++ b/webAO/packets/handlers/handleCI.ts @@ -1,23 +1,22 @@ -import { client } from '../../client' -import { handleCharacterInfo } from '../../client/handleCharacterInfo' +import { client } from "../../client"; +import { handleCharacterInfo } from "../../client/handleCharacterInfo"; /** - * Handles incoming character information, bundling multiple characters - * per packet. - * CI#0#Phoenix&description&&&&#Miles ... - * @param {Array} args packet arguments - */ + * Handles incoming character information, bundling multiple characters + * per packet. + * CI#0#Phoenix&description&&&&#Miles ... + * @param {Array} args packet arguments + */ 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) { - const chargs = args[i].split("&"); - const charid = Number(args[i - 1]); - setTimeout(() => handleCharacterInfo(chargs, charid), 500); - } + // 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) { + const chargs = args[i].split("&"); + const charid = Number(args[i - 1]); + setTimeout(() => handleCharacterInfo(chargs, charid), 500); } - // Request the next pack - client.sender.sendServer(`AN#${Number(args[1]) / 10 + 1}#%`); -}
\ No newline at end of file + } + // Request the next pack + client.sender.sendServer(`AN#${Number(args[1]) / 10 + 1}#%`); +}; |
