diff options
| author | David Skoland <davidskoland@gmail.com> | 2026-02-07 13:04:31 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2026-02-07 13:04:31 +0100 |
| commit | 4ab187b991ec40993c4b030e1612d9bb41f18924 (patch) | |
| tree | d715237d1f6a1652e9f157ec2b78b72da309f2e0 /webAO/packets/handlers/handlePV.ts | |
| parent | 7391a61b881af5a515abfbf5905f65e749814fa4 (diff) | |
Defer char.ini loading and use direct img src for char icons
Instead of eagerly fetching char_icon (with HEAD requests per extension)
and char.ini for every character on join, set img.src directly to
char_icon.png and defer char.ini loading until actually needed (character
selection via handlePV, or first IC message via handleMS). This
eliminates thousands of HTTP requests on join for large character lists.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'webAO/packets/handlers/handlePV.ts')
| -rw-r--r-- | webAO/packets/handlers/handlePV.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts index 4ac747f..149d90e 100644 --- a/webAO/packets/handlers/handlePV.ts +++ b/webAO/packets/handlers/handlePV.ts @@ -3,6 +3,7 @@ import fileExists from "../../utils/fileExists"; import { updateActionCommands } from "../../dom/updateActionCommands"; import { pickEmotion } from "../../dom/pickEmotion"; import { AO_HOST } from "../../client/aoHost"; +import { ensureCharIni } from "../../client/handleCharacterInfo"; function addEmoteButton(i: number, imgurl: string, desc: string) { const emotesList = document.getElementById("client_emo"); @@ -34,7 +35,7 @@ export const handlePV = async (args: string[]) => { const emotesList = document.getElementById("client_emo"); emotesList.style.display = ""; emotesList.innerHTML = ""; // Clear emote box - const ini = me.inifile; + const ini = await ensureCharIni(client.charID); me.side = ini.options.side; updateActionCommands(me.side); if (ini.emotions.number === 0) { |
