Skip to content
Snippets Groups Projects
Commit 58921c0f authored by Johan Thörnblom's avatar Johan Thörnblom
Browse files

nudooo2

parent 444fd54c
Branches
Tags
No related merge requests found
...@@ -88,18 +88,18 @@ def echo(socket): ...@@ -88,18 +88,18 @@ def echo(socket):
# sign out if I am logged in somewhere else # sign out if I am logged in somewhere else
print(session) print(session)
lock.acquire() lock.acquire()
for token in list(session.keys()):
if session[token][0] == myEmail and token != myToken:
if session[token][1] != "":
session[token][1].send(json.dumps({"action" : "signOut"}))
session[token][1].close()
print("You got kicked out")
session.pop(token)
print(session)
if myToken in session: if myToken in session:
for token in list(session.keys()):
if session[token][0] == myEmail and token != myToken:
if session[token][1] != "":
session[token][1].send(json.dumps({"action" : "signOut"}))
session[token][1].close()
print("You got kicked out")
session.pop(token)
print(session)
# Put socket in global dict so server knows my connection is open # Put socket in global dict so server knows my connection is open
session[myToken] = (myEmail, socket) session[myToken] = (myEmail, socket)
socket.send(json.dumps({"action" : "signIn"})) socket.send(json.dumps({"action" : "signIn"}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment