diff options
| author | David Skoland <davidskoland@gmail.com> | 2026-02-07 21:53:59 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2026-02-07 21:53:59 +0100 |
| commit | 95e4124b0c02b4e5be383c41ed4241566f40e6e6 (patch) | |
| tree | 0a51910da18759700b9e152aa428e76f055b8af4 /webAO/client.ts | |
| parent | 5eeb7ac9d90137c3b5ce9578c47bcc2ccff21c7e (diff) | |
Prefetch char.ini for characters present in area via playerlist
Store player data (charId, area) in an in-memory Map on the client,
updated by PR/PU packet handlers. Use this to eagerly load char.ini
when a player's character appears in our area or when switching areas,
eliminating the lazy-load delay on first IC message.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'webAO/client.ts')
| -rw-r--r-- | webAO/client.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/webAO/client.ts b/webAO/client.ts index b7a15a4..95df67a 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -150,6 +150,7 @@ class Client extends EventEmitter { connect: () => void; loadResources: () => void; isLowMemory: () => void; + players: Map<number, { charId: number; area: number }>; charicon_extensions: string[]; emote_extensions: string[]; emotions_extensions: string[]; @@ -211,6 +212,7 @@ class Client extends EventEmitter { this.temp_packet = ""; loadResources; isLowMemory; + this.players = new Map(); this.charicon_extensions = [".png", ".webp"]; this.emote_extensions = [".gif", ".png", ".apng", ".webp", ".webp.static"]; this.emotions_extensions = [".png", ".webp"]; |
