def start(self): manager_address = ("127.0.0.1", 27500) manager_password = "" self.server_manager = GameSpyServerDatabase(address = manager_address, authkey= manager_password) self.server_manager.connect() # Start QR server address = ('0.0.0.0', 27900) # accessible to outside connections (use this if you don't know what you're doing) self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket.bind(address) logger.log(logging.INFO, "Server is now listening on %s:%s..." % (address[0], address[1])) # Dependencies! I don't really like this solution but it's easier than trying to manage it another way. server_browser_server = GameSpyServerBrowserServer(self) server_browser_server_thread = threading.Thread(target=server_browser_server.start()) server_browser_server_thread.start() threading.Timer(1, self.keepalive_check).start() while 1: recv_data, address = self.socket.recvfrom(2048) packet_thread = threading.Thread(target=self.handle_packet, args=(self.socket, recv_data, address)) packet_thread.start()
def start(self): manager_address = ("127.0.0.1", 27500) manager_password = "" self.server_manager = GameSpyServerDatabase(address = manager_address, authkey= manager_password) self.server_manager.connect() # Start QR server address = ('0.0.0.0', 27900) # accessible to outside connections (use this if you don't know what you're doing) self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket.bind(address) logger.log(logging.INFO, "Server is now listening on %s:%s..." % (address[0], address[1])) # Dependencies! I don't really like this solution but it's easier than trying to manage it another way. server_browser_server = GameSpyServerBrowserServer(self) server_browser_server_thread = threading.Thread(target=server_browser_server.start()) server_browser_server_thread.start() self.wait_loop()
def start_server_browser_server(): server_browser_server = GameSpyServerBrowserServer() server_browser_server.start()