Update server.py

This commit is contained in:
Nova Cat 2025-01-13 17:24:21 -08:00
parent eda5a0e3da
commit 309d50ec5e

View file

@ -169,6 +169,8 @@ def pinger(nick, connection):
break break
def session(connection, client, ip, ssl=False): def session(connection, client, ip, ssl=False):
global property_list global property_list
global channels_list
global nickname_list
pending = "*" # The nickname of the client pending = "*" # The nickname of the client
already_set = False # If the client gave the server a NICK packet already_set = False # If the client gave the server a NICK packet
ready = False # If the client gave the server a USER packet ready = False # If the client gave the server a USER packet
@ -577,14 +579,17 @@ def session(connection, client, ip, ssl=False):
if target in channels_list: if target in channels_list:
print("Sending to "+ target + " Channel") print("Sending to "+ target + " Channel")
if pending in channels_list[target]: if pending in channels_list[target]:
print(channels_list[target])
for i in channels_list[channel]: for i in channels_list[channel]:
try: try:
if i != pending: if i != pending:
print(i) print(i)
print(f":{pending}!~{username}@{hostname} {text}\r\n") print(f":{pending}!~{username}@{hostname} {text}\r\n")
nickname_list[i].sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8")) nickname_list[i].sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8"))
else:
print(i + " Is the current user!")
except: except:
pass print(traceback.format_exc)
elif target in nickname_list: elif target in nickname_list:
nickname_list[target].sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8")) nickname_list[target].sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8"))
else: else: