Compare commits

..

2 commits

Author SHA1 Message Date
Padawan-GM
6a80582fbe Added SERVER_PATH to .env 2025-12-17 17:51:22 +01:00
Padawan-GM
dbc82a3bfa Added debug.log to .gitignore 2025-12-17 17:51:12 +01:00
3 changed files with 4 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
__pycache__/
venv/
.env
debug.log

View file

@ -5,6 +5,7 @@ class Config:
data = dotenv_values()
MINECRAFTD_PASSWORD: str | None = data.get("MINECRAFTD_PASSWORD")
START_COMMAND_FILE: str = data.get("START_COMMAND_FILE") or "start.sh"
SERVER_PATH: str = data.get("SERVER_PATH") or "."
SERVER_HOST: str = data.get("SERVER_HOST") or "localhost"
SERVER_PORT: int = int(data.get("SERVER_PORT") or 25565)
SERVER_RCON_PORT: int = int(data.get("SERVER_RCON_PORT") or 25575)

View file

@ -19,6 +19,7 @@ class ProcessController:
self.start_command: list[str] = shlex.split(
Path(Config.START_COMMAND_FILE).read_text()
)
self.cwd = Config.SERVER_PATH
self.process: Popen | None = None
self.last_status: Literal[ProcessStatus.STOPPED, ProcessStatus.CRASHED] = (
ProcessStatus.STOPPED
@ -43,6 +44,7 @@ class ProcessController:
stderr=None,
stdin=None,
start_new_session=True,
cwd=self.cwd,
)
logger.info(
"ProcessController.start() - Started process with PID: %s",