mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[~] Coding style
This commit is contained in:
parent
20047990b5
commit
21fb9f1286
@ -21,7 +21,8 @@ class MinecraftServerManager:
|
||||
self.offline_ports: list[int] = []
|
||||
|
||||
def start_server(self, server_directory: str, port: int, user_id: str, server_name: str,
|
||||
version: str, jar_file: str = 'server.jar', memory_size: str ='4G', modded: bool = False) -> Union[int, None]:
|
||||
version: str, jar_file: str = 'server.jar',
|
||||
memory_size: str ='4G', modded: bool = False) -> Union[int, None]:
|
||||
|
||||
if port in self.servers:
|
||||
return None
|
||||
@ -40,6 +41,7 @@ class MinecraftServerManager:
|
||||
command = f"{java} -Xmx{memory_size} {reg_flags} -jar {jar_file} --nogui"
|
||||
if modded:
|
||||
command = "./start.sh"
|
||||
|
||||
process = subprocess.Popen(shlex.split(command), cwd=server_directory, stdin=subprocess.PIPE)
|
||||
#TODO: Track process behavior and stderr, while excepting Advanced Terminal features not to be avail.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user