Update server.py
This commit is contained in:
parent
3245e9cd98
commit
73f5bf5516
1 changed files with 13 additions and 13 deletions
26
server.py
26
server.py
|
@ -197,6 +197,19 @@ def session(connection, client):
|
||||||
elif pending2.lower() in lower_nicks or pending2 in reserved:
|
elif pending2.lower() in lower_nicks or pending2 in reserved:
|
||||||
connection.sendall(bytes(f":{server} 433 {pending} {pending2} :Nickname is already in use.\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 433 {pending} {pending2} :Nickname is already in use.\r\n","UTF-8"))
|
||||||
else:
|
else:
|
||||||
|
print("Sending nickname change...")
|
||||||
|
conection.sendall(bytes(f":{pending}!~{username}@{hostname} NICK {pending2}\r\n","UTF-8"))
|
||||||
|
print("Moving config...")
|
||||||
|
property_list[pending2] = property_list.pop(pending)
|
||||||
|
nickname_list[pending2] = nickname_list.pop(pending)
|
||||||
|
del lower_nicks[pending.lower()]
|
||||||
|
lower_nicks[pending2.lower()] = pending2
|
||||||
|
print("starting pinger...")
|
||||||
|
pending = pending2
|
||||||
|
property_list[pending2]["ping_pending"] = False
|
||||||
|
property_list[pending2]["last_ping"] = time.time()
|
||||||
|
threading.Thread(target=pinger, args=[pending, connection]).start()
|
||||||
|
print(f"User {pending} set nick")
|
||||||
print("Broadcasting nickname change...")
|
print("Broadcasting nickname change...")
|
||||||
# Broadcast the nickname change
|
# Broadcast the nickname change
|
||||||
done = []
|
done = []
|
||||||
|
@ -214,19 +227,6 @@ def session(connection, client):
|
||||||
channels_list[i].append(pending2)
|
channels_list[i].append(pending2)
|
||||||
except:
|
except:
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
print("Sending nickname change...")
|
|
||||||
conection.sendall(bytes(f":{pending}!~{username}@{hostname} NICK {pending2}\r\n","UTF-8"))
|
|
||||||
print("Moving config...")
|
|
||||||
property_list[pending2] = property_list.pop(pending)
|
|
||||||
nickname_list[pending2] = nickname_list.pop(pending)
|
|
||||||
del lower_nicks[pending.lower()]
|
|
||||||
lower_nicks[pending2.lower()] = pending2
|
|
||||||
print("starting pinger...")
|
|
||||||
pending = pending2
|
|
||||||
property_list[pending2]["ping_pending"] = False
|
|
||||||
property_list[pending2]["last_ping"] = time.time()
|
|
||||||
threading.Thread(target=pinger, args=[pending, connection]).start()
|
|
||||||
print(f"User {pending} set nick")
|
|
||||||
elif command == "PART":
|
elif command == "PART":
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
connection.sendall(bytes(f":{server} 461 {pending} {command} :Not enough parameters\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 461 {pending} {command} :Not enough parameters\r\n","UTF-8"))
|
||||||
|
|
Loading…
Reference in a new issue