diff --git a/bin_arc/ussr-ssl.py b/bin_arc/ussr-ssl.py index 404bde3..16f1d87 100644 --- a/bin_arc/ussr-ssl.py +++ b/bin_arc/ussr-ssl.py @@ -24,7 +24,6 @@ app = Flask(__name__) -MC_FOLDER = 'bin/.mc/' DISCORD_WEBHOOK_URL_FILE = '../config/webhook.txt' def get_discord_webhook_url(): @@ -48,9 +47,12 @@ def index(): @app.route('/start') def start(): send_discord_message('``server starting...``') - start_command = ['java', '-jar', '-Xms256M', '-Xmx5G', f'{MC_FOLDER}/server.jar'] - subprocess.Popen(start_command, cwd=MC_FOLDER) - + + script_dir = os.path.dirname(os.path.abspath(__file__)) + mc_dir = os.path.join(script_dir, '../bin/.mc') + start_command = ['java', '-jar', '-Xms256M', '-Xmx5G', 'nogui', os.path.join(mc_dir, 'server.jar')] + subprocess.Popen(start_command, cwd=mc_dir) + time.sleep(27) send_discord_message('``server started``') diff --git a/bin_win/ussr-ssl.py b/bin_win/ussr-ssl.py index 404bde3..16f1d87 100644 --- a/bin_win/ussr-ssl.py +++ b/bin_win/ussr-ssl.py @@ -24,7 +24,6 @@ app = Flask(__name__) -MC_FOLDER = 'bin/.mc/' DISCORD_WEBHOOK_URL_FILE = '../config/webhook.txt' def get_discord_webhook_url(): @@ -48,9 +47,12 @@ def index(): @app.route('/start') def start(): send_discord_message('``server starting...``') - start_command = ['java', '-jar', '-Xms256M', '-Xmx5G', f'{MC_FOLDER}/server.jar'] - subprocess.Popen(start_command, cwd=MC_FOLDER) - + + script_dir = os.path.dirname(os.path.abspath(__file__)) + mc_dir = os.path.join(script_dir, '../bin/.mc') + start_command = ['java', '-jar', '-Xms256M', '-Xmx5G', 'nogui', os.path.join(mc_dir, 'server.jar')] + subprocess.Popen(start_command, cwd=mc_dir) + time.sleep(27) send_discord_message('``server started``')