From fbc8e7fc2a6decabdd379f6faf7679b33006c8ea Mon Sep 17 00:00:00 2001 From: Phillip Tarrant Date: Thu, 10 Sep 2020 12:03:18 -0400 Subject: [PATCH] fixed broken return / redirect after downloading jar and adding server --- app/classes/minecraft/serverjars.py | 3 ++- app/classes/shared/controller.py | 5 +++-- app/config/serverjars.json | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/classes/minecraft/serverjars.py b/app/classes/minecraft/serverjars.py index ba2b1681..282a55a9 100644 --- a/app/classes/minecraft/serverjars.py +++ b/app/classes/minecraft/serverjars.py @@ -141,7 +141,8 @@ class ServerJars: response = self._get_api_result(url) return response - def download_jar(self, server, version, path): + @staticmethod + def download_jar(server, version, path): base_url = "https://serverjars.com/api/fetchJar/{server}/{version}".format(server=server, version=version) # open a file stream diff --git a/app/classes/shared/controller.py b/app/classes/shared/controller.py index 0e9f2bf0..e27a6de1 100644 --- a/app/classes/shared/controller.py +++ b/app/classes/shared/controller.py @@ -181,9 +181,10 @@ class Controller: server_stop = "stop" # download the jar - server_jar_obj.download_jar(server, version, full_jar_path, server_command, server_file) + server_jar_obj.download_jar(server, version, full_jar_path) - self.register_server(name, server_id, server_dir, server_command, server_file, server_log_file, server_stop) + new_id = self.register_server(name, server_id, server_dir, server_command, server_file, server_log_file, server_stop) + return new_id # todo - Do import server def import_server(self): diff --git a/app/config/serverjars.json b/app/config/serverjars.json index 577ffaed..04fabdb4 100644 --- a/app/config/serverjars.json +++ b/app/config/serverjars.json @@ -1,5 +1,5 @@ { - "last_refreshed": "09/08/2020, 07:56:16", + "last_refreshed": "09/10/2020, 11:57:02", "servers": { "nukkitx": [ "1.14" @@ -177,6 +177,7 @@ "1.1620w08a", "1.1620w07a", "1.1620w06a", + "1.16.3", "1.16.2rc2", "1.16.3rc1", "1.16.2rc1", @@ -269,6 +270,7 @@ "1.14.1pre1" ], "vanilla": [ + "1.16.3", "1.16.2", "1.16.1", "1.16",