Archived
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import Callable, Any, TYPE_CHECKING, Union
|
||||
from pydantic import ValidationError
|
||||
|
||||
from websockets.server import WebSocketServerProtocol
|
||||
from websockets.exceptions import ConnectionClosedOK
|
||||
from websockets.exceptions import ConnectionClosedOK, ConnectionClosedError
|
||||
|
||||
from netcode.models import Message, LoginMessage, MessageType
|
||||
|
||||
@@ -71,9 +71,11 @@ class LobbyClientController:
|
||||
data="login",
|
||||
)
|
||||
)
|
||||
|
||||
async for message in self.websocket:
|
||||
await self.on_message(message)
|
||||
try:
|
||||
async for message in self.websocket:
|
||||
await self.on_message(message)
|
||||
except ConnectionClosedError:
|
||||
print("Connection Closed Error")
|
||||
|
||||
async def close(self):
|
||||
"""Remove self from Lobby broadcasting list"""
|
||||
|
||||
Reference in New Issue
Block a user