Initial commit
This commit is contained in:
17
server/app/client.py
Normal file
17
server/app/client.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from websockets.asyncio.server import ServerConnection
|
||||
|
||||
|
||||
@dataclass
|
||||
class ClientConnection:
|
||||
websocket: ServerConnection
|
||||
id: str
|
||||
nickname: str = "user..."
|
||||
x: int = 20
|
||||
y: int = 20
|
||||
|
||||
def summary(self) -> dict[str, str | int]:
|
||||
return {"id": self.id, "nickname": self.nickname, "x": self.x, "y": self.y}
|
||||
Reference in New Issue
Block a user