Fixed an issue with initial creation of missions.txt

This commit is contained in:
Carl Manzi 2021-01-03 14:50:55 -05:00
parent 5aa3eb1934
commit 436f7f0ea9
3 changed files with 17 additions and 7 deletions

13
dependencies.txt Normal file
View 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

View file

@ -18,8 +18,6 @@ RestartSec=15s
TimeoutStopSec=60s
WorkingDirectory=/opt/t2server/GameData
LogsDirectory=t2server
# Below settings help lock down the service for security
ProtectSystem=full
ProtectHome=true
SystemCallFilter=@system-service

View file

@ -73,10 +73,10 @@ def server_files(config):
for mission in config["MapList"]:
mlist.write(f"{config['MissionType']} {mission}\n")
else:
if isfile(f"{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
open(f"{install_dir}/GameData/base/prefs/missions.txt", 'w').close()
# 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")
with open(f"{install_dir}/GameData/base/prefs/missions.txt", 'w') as mlist:
mlist.write("")
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.
# This ensures there are no undefined values in the case of a user removing one from config.yaml.
config = {**config_defaults, **loaded_config}
print(config)
# Validate the mod directory and serverprefs file
if not isdir(f"{install_dir}/GameData/{config['Mod']}"):