aboutsummaryrefslogtreecommitdiff
path: root/api/game/socket.py
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-02-16 16:00:35 +0100
committerlonkaars <l.leblansch@gmail.com>2021-02-16 16:00:35 +0100
commit7986d9560602528ea3034553eb1f0d82267dabbc (patch)
tree8fa7eba5abdc8ce219368d90143264f8c364c60f /api/game/socket.py
parent7a2543051af1d30b62bcf78f0e10b46f80b5d10b (diff)
class namespace in /api/game/socket
Diffstat (limited to 'api/game/socket.py')
-rw-r--r--api/game/socket.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/api/game/socket.py b/api/game/socket.py
index 405d9cd..7931ada 100644
--- a/api/game/socket.py
+++ b/api/game/socket.py
@@ -1,10 +1,12 @@
from flask import Blueprint, request, make_response
-from flask_socketio import SocketIO, emit, disconnect
+from flask_socketio import SocketIO, emit, disconnect, Namespace
from main import socketio
import time
import json
-@socketio.on("connect", namespace="/game/socket")
-def connect():
- print("connected")
+class GameSocketNamespace(Namespace):
+ def connect(self):
+ print("connection")
+
+socketio.on_namespace(GameSocketNamespace("/game/socket"))