From 2ef41402209b82279656ae4b1affe6484be1ed77 Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Mon, 16 Mar 2026 14:12:22 +0000 Subject: Remove CH-sending timer CH is an application-level keepalive packet that clients periodically send for two reasons: 1. It tells the server they're still connected, preventing timeouts. 2. By measuring latency between sending CH and receiving CHECK, a client can display ping. Keepalive is redundant because WebSocket can handle that via PING frames on a transport layer. WebAO also completely ignores CHECK and sends CH every five seconds, which is superfluous (AO2 Client sends it once every 45 seconds, in comparison). Sending CH via `setInterval` was also problematic: browsers seem to throttle it when the tab becomes inactive, preventing periodic pings and leading to the server disconnecting inactive browser clients. --- webAO/client/sender/sendCheck.ts | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 webAO/client/sender/sendCheck.ts (limited to 'webAO/client/sender/sendCheck.ts') diff --git a/webAO/client/sender/sendCheck.ts b/webAO/client/sender/sendCheck.ts deleted file mode 100644 index 7eb4751..0000000 --- a/webAO/client/sender/sendCheck.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { client } from "../../client"; - -/** - * Sends a keepalive packet. - */ -export const sendCheck = () => { - client.sender.sendServer(`CH#${client.charID}#%`); -}; -- cgit