diff options
-rw-r--r-- | swiftstory/SwiftStory.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/swiftstory/SwiftStory.py b/swiftstory/SwiftStory.py index 256c2be..b252040 100644 --- a/swiftstory/SwiftStory.py +++ b/swiftstory/SwiftStory.py @@ -14,7 +14,7 @@ from swiftstory.Status import error game_manager = swiftstory.GameManager.GameManager() -async def message_received_handler(client, websocket, message): +async def message_received_handler(client, message): try: json_msg = json.loads(message) except JSONDecodeError: @@ -57,15 +57,15 @@ async def message_received_handler(client, websocket, message): else: res = error('invalid command') - await websocket.send(res) + await client.socket.send(res) async def swiftstory(websocket, path): client = Client(websocket, game_manager) with contextlib.suppress(websockets.exceptions.ConnectionClosed): - async for message in websocket: - await message_received_handler(client, websocket, message) + async for message in client.socket: + await message_received_handler(client, message) await client.disconnect() |