From 2382ce5e85061b56a4b1b3aa8583d51110de262f Mon Sep 17 00:00:00 2001 From: Nova Cat Date: Wed, 11 Dec 2024 14:59:32 -0800 Subject: [PATCH] stop serrver --- server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index d572abb..f4bcc4e 100644 --- a/server.py +++ b/server.py @@ -61,6 +61,7 @@ tcp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server_address = ('', 6667) tcp_socket.bind(server_address) tcp_socket.listen(1) +opened=True reserved = ["nickserv", "chanserv", "gitserv"] # Reserved nicknames nickname_list = {} # Stores nicknames and the respective sockets lower_nicks = {"gitserv": "GitServ"} # Nicknames in lowercase @@ -350,6 +351,7 @@ def session(connection, client): if "o" in property_list[pending]["modes"]: tcp_socket.shutdown(socket.SHUT_RDWR) tcp_socket.close() + opened = False else: connection.sendall(bytes(f":{server} 481 {pending} :Permission Denied- You're not an IRC operator\r\n","UTF-8")) @@ -413,7 +415,7 @@ def session(connection, client): except: print(traceback.format_exc()) try: - while True: + while opened: connection, client = tcp_socket.accept() threading.Thread(target=session, daemon=True, args=[connection, client]).start() except: