Check for java on forge server creation

This commit is contained in:
amcmanu3 2023-02-14 13:59:53 -05:00
parent 49b412ff83
commit a423cee40b
2 changed files with 9 additions and 0 deletions

View File

@ -404,6 +404,14 @@ class ServerHandler(BaseHandler):
jar_type, server_type, server_version = server_parts
# TODO: add server type check here and call the correct server
# add functions if not a jar
if server_type == "forge" and not self.helper.detect_java():
translation = self.helper.translation.translate(
"error",
"installerJava",
self.controller.users.get_user_lang_by_id(exec_user["user_id"]),
).format(server_name)
self.redirect(f"/panel/error?error={translation}")
return
new_server_id = self.controller.create_jar_server(
jar_type,
server_type,

View File

@ -179,6 +179,7 @@
"internet": "We have detected the machine running Crafty has no connection to the internet. Client connections to the server may be limited.",
"no-file": "We can't seem to locate the requested file. Double check the path. Does Crafty have proper permissions?",
"noJava": "Server {} failed to start with error code: We have detected Java is not installed. Please install java then start the server.",
"installerJava": "Failed to install {} : Forge Server Installs require Java. We have detected Java is not installed. Please install java then install the server.",
"not-downloaded": "We can't seem to find your executable file. Has it finished downloading? Are the permissions set to executable?",
"portReminder": "We have detected this is the first time {} has been run. Make sure to forward port {} through your router/firewall to make this remotely accessible from the internet.",
"start-error": "Server {} failed to start with error code: {}",