Update server.py
All checks were successful
/ check (push) Successful in 10s

This commit is contained in:
Nova Cat 2025-01-29 20:12:13 -08:00
parent ad7a309c92
commit c9e44686b3

View file

@ -230,7 +230,7 @@ def session(connection, client, ip, isssl=False):
usesIRCv3 = False usesIRCv3 = False
CAPEND = False CAPEND = False
clident = None clident = None
pendingCommands = [] # list of commands that were executed before verification pendingCommands = "" # list of commands that were executed before verification
try: try:
print("Connected to client IP: {}".format(client)) print("Connected to client IP: {}".format(client))
connection.sendall(bytes(f":{server} NOTICE * :*** Looking for your hostname...\r\n","UTF-8")) connection.sendall(bytes(f":{server} NOTICE * :*** Looking for your hostname...\r\n","UTF-8"))
@ -368,8 +368,8 @@ def session(connection, client, ip, isssl=False):
connection.sendall(bytes(f":{server} 372 {pending} :- {i}\r\n", "UTF-8")) connection.sendall(bytes(f":{server} 372 {pending} :- {i}\r\n", "UTF-8"))
connection.sendall(bytes(f":{server} 376 {pending} :End of /MOTD command\r\n", "UTF-8")) connection.sendall(bytes(f":{server} 376 {pending} :End of /MOTD command\r\n", "UTF-8"))
elif finished: elif finished:
pendingCommands.append(text) pendingCommands += text
for comd in pendingCommands: for comd in pendingCommands.split("\r\n"):
command = comd.split(" ")[0].upper() command = comd.split(" ")[0].upper()
args = comd.split(" ")[1:] args = comd.split(" ")[1:]
text = comd text = comd
@ -717,9 +717,9 @@ def session(connection, client, ip, isssl=False):
# Unknown command # Unknown command
cmd = text.split(" ")[0] cmd = text.split(" ")[0]
connection.sendall(bytes(f":{server} 421 {pending} {cmd} :Unknown command\r\n","UTF-8")) connection.sendall(bytes(f":{server} 421 {pending} {cmd} :Unknown command\r\n","UTF-8"))
pendingCommands = [] pendingCommands = ""
else: else:
pendingCommands.append(text) pendingCommands += text
except ssl.SSLEOFError: except ssl.SSLEOFError:
print("EOF occured...") print("EOF occured...")
except Exception as ex: except Exception as ex: