Skip to content

Commit

Permalink
fix path to palworld server files
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinnn101 committed Feb 3, 2024
1 parent 7c81cab commit 816e7ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
logger.add(sys.stderr, level="INFO")

# Create PalworldUtil instance with required vars only.
pal = PalworldUtil(STEAMCMD_DIR, SERVER_NAME, SERVER_IP, RCON_PORT, RCON_PASSWORD)
pal = PalworldUtil(STEAMCMD_DIR, SERVER_NAME, SERVER_IP, RCON_PORT, RCON_PASSWORD, operating_system="linux")

# Don't rotate backups.
# pal.rotate_backups = False
Expand Down
12 changes: 8 additions & 4 deletions src/utility/palworld_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __init__(
server_ip: str,
rcon_port: int,
rcon_password: str,
palword_server_dir: str = None, # Path to Palworld server root directory. Tries to find if not provided.
palworld_server_proc_name: str = "PalServer-Win64-Test-Cmd.exe", # Name of the palworld dedicated server process. Used for monitoring, restarting, etc.
wait_before_restart_seconds: int = 30,
steam_app_id: str = "2394010", # Palworld dedicated server.
Expand All @@ -31,10 +32,7 @@ def __init__(
rotate_after_x_backups: int = 5,
operating_system: str = "windows",
) -> None:
self.steamcmd_dir = steamcmd_dir # Path to steamcmd.exe directory.
self.palworld_server_dir = Path(
Path(self.steamcmd_dir) / "steamapps" / "common" / "PalServer"
) # Full path to the root directory of your palworld server files.
self.steamcmd_dir = Path(steamcmd_dir) # Path to steamcmd.exe directory.
self.palworld_server_save_dir = Path(self.palworld_server_dir / "Pal" / "Saved")
self.server_name = server_name # What you want the server name to be.
self.operating_system = operating_system.lower() # "windows" or "linux".
Expand All @@ -55,11 +53,17 @@ def __init__(
self.palworld_server_proc_name = palworld_server_proc_name
self.steamcmd_executable = "steamcmd.exe"
self.palserver_executable = "PalServer.exe"
self.palworld_server_dir = Path(self.steamcmd_dir / "steamapps" / "common" / "PalServer")
self.server_launch_args.append("start")
elif self.operating_system == "linux":
self.palworld_server_proc_name = "./PalServer.sh"
self.steamcmd_executable = "steamcmd"
self.palserver_executable = "./PalServer.sh"
self.palworld_server_dir = Path("/home/steam/Steam/steamapps/common/PalServer")

# Overwrite palworld_server_dir if set by user
if palword_server_dir:
self.palworld_server_dir = palword_server_dir

# Common server launch args
self.server_launch_args.append(self.palserver_executable)
Expand Down

0 comments on commit 816e7ab

Please sign in to comment.