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

nudooo2

parent 444fd54c
No related branches found
No related tags found
No related merge requests found
......@@ -88,18 +88,18 @@ def echo(socket):
# sign out if I am logged in somewhere else
print(session)
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)
lock.acquire()
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
session[myToken] = (myEmail, socket)
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