Move help to JSON and add server docstrings

This commit is contained in:
Jage9
2026-02-21 16:51:07 -05:00
parent 68bd2cf2ce
commit 35f837e96d
11 changed files with 207 additions and 40 deletions

View File

@@ -1,3 +1,5 @@
"""Client connection model used by the signaling server."""
from __future__ import annotations
from dataclasses import dataclass
@@ -7,6 +9,8 @@ from websockets.asyncio.server import ServerConnection
@dataclass
class ClientConnection:
"""Represents one connected websocket client and its world state."""
websocket: ServerConnection
id: str
nickname: str = "user..."
@@ -14,4 +18,6 @@ class ClientConnection:
y: int = 20
def summary(self) -> dict[str, str | int]:
"""Return a compact serializable snapshot for logs/diagnostics."""
return {"id": self.id, "nickname": self.nickname, "x": self.x, "y": self.y}