[+] Enable query on the right port on server creation

This commit is contained in:
Charles Le Maux 2024-07-14 22:19:33 +02:00
parent 0747e02fce
commit cb04876592

View File

@ -107,7 +107,10 @@ def server_create(user: UserRecord, name: str, version: str, framework: str = "p
file_manager.create_folder(server_path)
file_manager.copy_folder_contents(server_template_path, server_path)
file_manager.copy_folder_contents("servers/shared", server_path)
file_manager.update_server_property(server_path + "/server.properties", "server-port", port)
prop_path: str = server_path + "/server.properties"
file_manager.update_server_property(prop_path, "server-port", port)
file_manager.update_server_property(prop_path, "query.port", port)
file_manager.update_server_property(prop_path, "enable-query", "true")
return HTTPStatus.CREATED, f"Successfully created server '{name}'."
except Exception as e:
file_manager.log_error(type(e).__name__, str(e))