Commit graph

8 commits

Author SHA1 Message Date
a0481ed867 Route gameCommand traffic through WebRTC unreliable DataChannel
Socket.IO (TCP) holds back later packets while it retransmits a lost
one, which stalls worldUpdate delivery on lossy long-distance links —
exactly the pattern game state suffers worst from. WebRTC DataChannels
in unreliable mode (ordered:false, maxRetransmits:0) drop late packets
instead of queueing them, which is what we want for high-frequency
state sync.

Adds a per-user WebRTCTransport on top of the existing Socket.IO
connection. Socket.IO stays in charge of bootstrap, signaling
(SDP/ICE exchange), and control messages — only gameCommand payloads
get routed onto the unreliable channel once it's open. If WebRTC
fails to negotiate, gameCommand transparently falls back to
Socket.IO, so the game keeps working unchanged.

A new StatsLogger writes per-session JSONL events (session_start,
webrtc_ready with negotiation time, per-second stats with transport,
RTT samples, recv/send rates, seq gaps) so we can compare real-world
runs (e.g. Germany server <-> Korea client) instead of guessing.
URL flag ?webrtc=0 forces fallback for A/B testing.

scripts/webrtc-browser-test.js spins up a headless Chromium against
a freshly-started server and asserts the unreliable channel opens
and gameCommand traffic actually rides it.
2026-05-11 00:38:18 +00:00
logsol
8d8a55cc8c adds core analyzer script which generates the core/channel/client method overview of a class 2016-08-29 00:33:59 +02:00
Jeena
5a4cec5ae8 added production2 fixes #125 2015-04-02 23:01:02 +02:00
logsol
5f5fec5b10 added optimizer scripts and some code style improvements 2015-03-09 04:56:28 +01:00
logsol
5eeb120799 added chart.js path to build-profile of production env 2015-03-02 19:48:05 +01:00
logsol
9986143dc2 splitted ecosystem config 2014-12-25 11:46:31 +01:00
logsol
300f6e4ae3 set up pm2 deployment 2014-12-25 02:02:26 +01:00
logsol
8dbc088813 restructured scripts for building and some improvements 2014-12-21 23:02:27 +01:00