aboutsummaryrefslogtreecommitdiff
path: root/api/game
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-02-16 12:00:36 +0100
committerlonkaars <l.leblansch@gmail.com>2021-02-16 12:00:36 +0100
commitb711f63c4087b3a9f5617af5b55afe93f414ddf5 (patch)
treea4eddad86c3024481b5bf64f6663d3143c0ab3d5 /api/game
parent64f53e70901069aab8344e24ebf0abe603f40ec3 (diff)
working websocket connection
Diffstat (limited to 'api/game')
-rw-r--r--api/game/new.py2
-rw-r--r--api/game/socket.py10
2 files changed, 11 insertions, 1 deletions
diff --git a/api/game/new.py b/api/game/new.py
index 6f777e3..fd65019 100644
--- a/api/game/new.py
+++ b/api/game/new.py
@@ -1,5 +1,5 @@
from flask import Blueprint, request, make_response
-from main import cursor, connection
+from db import cursor, connection
from randid import new_uuid
import time
import json
diff --git a/api/game/socket.py b/api/game/socket.py
new file mode 100644
index 0000000..405d9cd
--- /dev/null
+++ b/api/game/socket.py
@@ -0,0 +1,10 @@
+from flask import Blueprint, request, make_response
+from flask_socketio import SocketIO, emit, disconnect
+from main import socketio
+import time
+import json
+
+@socketio.on("connect", namespace="/game/socket")
+def connect():
+ print("connected")
+