1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix issue with server

This commit is contained in:
nordsoft 2022-11-07 02:09:05 +04:00
parent 0eb74b85c9
commit 9486373906

View File

@ -1,6 +1,3 @@
from calendar import c
from distutils.command.clean import clean
from pickletools import bytes8
import socket
import re
import uuid
@ -336,7 +333,7 @@ def dispatch(client: socket, sender: dict, arr: bytes):
send(client, f":>>ERROR:Too short username {tag_value}")
return
for user in client_sockets:
for user in client_sockets.values():
if user['username'] == tag_value:
send(client, f":>>ERROR:Can't connect with the name {tag_value}. This login is already occpupied")
return
@ -465,7 +462,7 @@ def listen_for_client(cs):
except Exception as e:
# client no longer connected
print(f"[!] Error: {e}")
handleDisconnection(cs)
handleDisconnection(cs)
return
dispatch(cs, client_sockets[cs], msg)