left4dead2 different workshop per server

This commit is contained in:
cronekorkn 2022-11-26 15:14:01 +01:00
parent f2b984e238
commit 886a1c4655
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
3 changed files with 53 additions and 28 deletions

View file

@ -15,6 +15,9 @@ directories = {
'owner': 'steam',
'group': 'steam',
'purge': True,
'triggers': [
*[f'svc_systemd:left4dead2-{name}.service:restart' for name in node.metadata.get('left4dead2/servers')],
],
},
# Current zfs doesnt support zfs upperdir. The support was added in October 2022. Move upperdir - unused anyway -
# to another dir. Also move workdir alongside it, as it has to be on same fs.
@ -29,6 +32,30 @@ files = {
'/opt/steam/left4dead2/left4dead2/ems/admin system/admins.txt': {
'owner': 'steam',
'content': '\n'.join(sorted(node.metadata.get('left4dead2/admins'))),
},
'/opt/steam/left4dead2/left4dead2/addons/readme.txt': {
'content_type': 'any',
'owner': 'steam',
'group': 'steam',
}
}
for id in node.metadata.get('left4dead2/workshop'):
files[f'/opt/steam/left4dead2/left4dead2/addons/{id}.vpk'] = {
'content_type': 'any',
'owner': 'steam',
'group': 'steam',
'triggers': [
*[f'svc_systemd:left4dead2-{name}.service:restart' for name in node.metadata.get('left4dead2/servers')],
],
}
# /opt/steam/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
symlinks = {
'/opt/steam/steam/.steam/sdk32': {
'target': '/opt/steam/steam/linux32',
'owner': 'steam',
'group': 'steam',
}
}
@ -61,6 +88,9 @@ for name, config in node.metadata.get('left4dead2/servers').items():
'owner': 'steam',
'group': 'steam',
'purge': True,
'triggers': [
f'svc_systemd:left4dead2-{name}.service:restart',
],
}
files[f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons/readme.txt'] = {
'content_type': 'any',
@ -72,26 +102,8 @@ for name, config in node.metadata.get('left4dead2/servers').items():
'content_type': 'any',
'owner': 'steam',
'group': 'steam',
'triggers': [
f'svc_systemd:left4dead2-{name}.service:restart',
],
}
files[f'/opt/steam/left4dead2/left4dead2/addons/readme.txt'] = {
'content_type': 'any',
'owner': 'steam',
'group': 'steam',
}
for id in node.metadata.get('left4dead2/workshop'):
files[f'/opt/steam/left4dead2/left4dead2/addons/{id}.vpk'] = {
'content_type': 'any',
'owner': 'steam',
'group': 'steam',
}
# /opt/steam/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
symlinks = {
'/opt/steam/steam/.steam/sdk32': {
'target': '/opt/steam/steam/linux32',
'owner': 'steam',
'group': 'steam',
}
}

View file

@ -40,16 +40,26 @@ def workshop_download(metadata):
if not metadata.get('left4dead2/workshop'):
return {}
return {
'steam-workshop-download': {
'left4dead': {
'ids': metadata.get('left4dead2/workshop'),
'path': '/opt/steam/left4dead2/left4dead2/addons',
'user': 'steam',
},
result = {
'left4dead-global': {
'ids': metadata.get('left4dead2/workshop'),
'path': '/opt/steam/left4dead2/left4dead2/addons',
'user': 'steam',
},
}
for name, config in metadata.get('left4dead2/servers').items():
if 'workshop' in config:
result[f'left4dead2-{name}'] = {
'ids': config['workshop'],
'path': f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons',
'user': 'steam',
}
return {
'steam-workshop-download': result,
}
@metadata_reactor.provides(
'systemd/units',

View file

@ -81,6 +81,9 @@
},
'standard-2': {
'port': 27021,
'workshop': {
2256379828, # bhop detect
},
},
},
'admins': {