mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add the right env variable for bedrock on linux
This commit is contained in:
parent
92f9bceaf9
commit
733b5c9a2c
@ -240,6 +240,22 @@ 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["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:
|
||||
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