mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Revert to original popen scheme
This commit is contained in:
parent
b6b8a1c14a
commit
92f9bceaf9
@ -240,30 +240,6 @@ class Server:
|
||||
|
||||
logger.info(f"Starting server in {self.server_path} with command: {self.server_command}")
|
||||
|
||||
if not helper.is_os_windows() and servers_helper.get_server_type_by_id(self.server_id) == "minecraft-bedrock":
|
||||
print("in catch")
|
||||
my_env = os.environ
|
||||
my_env["PATH"] = 'LD_LIBRARY_PATH='+self.server_path
|
||||
try:
|
||||
self.process = subprocess.Popen(
|
||||
self.server_command, cwd=self.server_path, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=my_env)
|
||||
except Exception as ex:
|
||||
#Checks for java on initial fail
|
||||
if os.system("java -version") == 32512:
|
||||
if user_id:
|
||||
websocket_helper.broadcast_user(user_id, 'send_start_error',{
|
||||
'error': translation.translate('error', 'noJava', user_lang).format(self.name)
|
||||
})
|
||||
return False
|
||||
else:
|
||||
logger.error(f"Server {self.name} failed to start with error code: {ex}")
|
||||
if user_id:
|
||||
websocket_helper.broadcast_user(user_id, 'send_start_error',{
|
||||
'error': translation.translate('error', 'start-error', user_lang).format(self.name, ex)
|
||||
})
|
||||
return False
|
||||
|
||||
else:
|
||||
try:
|
||||
self.process = subprocess.Popen(
|
||||
self.server_command, cwd=self.server_path, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
|
Loading…
Reference in New Issue
Block a user