mirror of
https://github.com/greenseeker/t2server.git
synced 2026-01-19 19:24:46 +00:00
Fixed an issue with initial creation of missions.txt
This commit is contained in:
parent
5aa3eb1934
commit
436f7f0ea9
13
dependencies.txt
Normal file
13
dependencies.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
Required OS packages for Ubuntu:
|
||||||
|
# dpkg --add-architecture i386
|
||||||
|
# apt update
|
||||||
|
# apt install unzip xvfb python3-pip wine32 cpulimit
|
||||||
|
# pip3 install tqdm
|
||||||
|
|
||||||
|
Required OS packages for RHEL 8:
|
||||||
|
# dnf install epel-repo
|
||||||
|
# dnf install wine-core unzip xorg-x11-server-Xvfb
|
||||||
|
|
||||||
|
Required OS packages for RHEL 7:
|
||||||
|
# yum install epel-repo
|
||||||
|
# yum install wine-core unzip xorg-x11-server-Xvfb
|
||||||
|
|
@ -18,8 +18,6 @@ RestartSec=15s
|
||||||
TimeoutStopSec=60s
|
TimeoutStopSec=60s
|
||||||
WorkingDirectory=/opt/t2server/GameData
|
WorkingDirectory=/opt/t2server/GameData
|
||||||
LogsDirectory=t2server
|
LogsDirectory=t2server
|
||||||
|
|
||||||
# Below settings help lock down the service for security
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
SystemCallFilter=@system-service
|
SystemCallFilter=@system-service
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,10 @@ def server_files(config):
|
||||||
for mission in config["MapList"]:
|
for mission in config["MapList"]:
|
||||||
mlist.write(f"{config['MissionType']} {mission}\n")
|
mlist.write(f"{config['MissionType']} {mission}\n")
|
||||||
else:
|
else:
|
||||||
if isfile(f"{install_dir}/GameData/base/prefs/missions.txt"):
|
# missions.txt needs to exist or the missioncycle.cs script will hang, so create/overwrite with an empty file
|
||||||
print(f"Purging {install_dir}/GameData/base/prefs/missions.txt")
|
print(f"Purging {install_dir}/GameData/base/prefs/missions.txt")
|
||||||
# missions.txt needs to exist or the missioncycle.cs script will hang, so overwrite with an empty file
|
with open(f"{install_dir}/GameData/base/prefs/missions.txt", 'w') as mlist:
|
||||||
open(f"{install_dir}/GameData/base/prefs/missions.txt", 'w').close()
|
mlist.write("")
|
||||||
|
|
||||||
|
|
||||||
def runaway_control():
|
def runaway_control():
|
||||||
|
|
@ -154,7 +154,6 @@ if __name__ == "__main__":
|
||||||
# Merge config_defaults and loaded_config, with loaded_config taking precedence where there are conflicts.
|
# Merge config_defaults and loaded_config, with loaded_config taking precedence where there are conflicts.
|
||||||
# This ensures there are no undefined values in the case of a user removing one from config.yaml.
|
# This ensures there are no undefined values in the case of a user removing one from config.yaml.
|
||||||
config = {**config_defaults, **loaded_config}
|
config = {**config_defaults, **loaded_config}
|
||||||
print(config)
|
|
||||||
|
|
||||||
# Validate the mod directory and serverprefs file
|
# Validate the mod directory and serverprefs file
|
||||||
if not isdir(f"{install_dir}/GameData/{config['Mod']}"):
|
if not isdir(f"{install_dir}/GameData/{config['Mod']}"):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue