Session now runs only the room this screen is in. It plays ahead of the server
with its own controls, guesses everyone else's, confirms ticks against the
server's frames and rewinds on a wrong guess. It keeps its lead by playing a
little faster or slower as the server says how early its controls arrive,
resends an edit the server dropped, and checks the server's checksums.
Gone with the peer-to-peer design: the host's decisions, the second arena game,
the view swapping and spectating (to come back through the server).
SAB_NET_STATS logs how it's keeping up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server answers each player's WebRTC offer (signaled over the socket) with a
connection of its own: frames go on a lossy channel, everything else on a
reliable one, and the socket carries them until both open or where UDP is
blocked. The client's Net now holds one link to the server instead of one per
player. WebRTC takes UDP 47810-47899 by default, set on the command line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server now runs every lobby's sandbox and queued games as rooms, stepped at
the tick rate on one thread. Players send controls ahead of time, late ones repeat
their last, and everyone in a room gets back the controls it played, its events
and checksums. Games start from sandbox queues, players return when they leave,
and play-again moves them to a fresh room. Protocol version 3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Profile, member join/leave and building a fresh game move into the sim library,
and the packet reader and writer into protocol.h, so the server can run lobbies
exactly as clients do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sim holds one whole game (tick, snapshots, checksum) and talks to the screen only
through Cues, which the client's Scene plays and the server ignores. All drawing
moved to scene.cpp. Match takes this screen's wishes as request flags instead of
reading the menu, input and settings. The sim library builds without SDL and the
server links it, ready to run games itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>