aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.ts
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2026-02-10 23:38:17 +0100
committerDavid Skoland <davidskoland@gmail.com>2026-02-10 23:38:17 +0100
commit020dfcda00ca06b9a06e7076eaf8a0164ae1327e (patch)
tree9fe2a8d9fdf81823e48d9a3795e47d0c59964f69 /webAO/client.ts
parent9c68a1afcf178a86063f094b96471fa73531bd9a (diff)
Refactor playerlist to state-driven rendering with renderPlayerList
handlePR and handlePU now only update client.playerlist state, and renderPlayerList handles all DOM rendering from that state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'webAO/client.ts')
-rw-r--r--webAO/client.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/webAO/client.ts b/webAO/client.ts
index 95df67a..05a40c9 100644
--- a/webAO/client.ts
+++ b/webAO/client.ts
@@ -150,7 +150,8 @@ class Client extends EventEmitter {
connect: () => void;
loadResources: () => void;
isLowMemory: () => void;
- players: Map<number, { charId: number; area: number }>;
+ /** Maps player ID to player data */
+ playerlist: Map<number, { charId: number; charName: string; showName: string; name: string; area: number }>;
charicon_extensions: string[];
emote_extensions: string[];
emotions_extensions: string[];
@@ -212,7 +213,7 @@ class Client extends EventEmitter {
this.temp_packet = "";
loadResources;
isLowMemory;
- this.players = new Map();
+ this.playerlist = new Map();
this.charicon_extensions = [".png", ".webp"];
this.emote_extensions = [".gif", ".png", ".apng", ".webp", ".webp.static"];
this.emotions_extensions = [".png", ".webp"];