Initial commit
This commit is contained in:
16
ark@.service
Normal file
16
ark@.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=ARK: Survival Evolved dedicated server
|
||||
Wants=network-online.target
|
||||
After=syslog.target network.target nss-lookup.target network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/steam/ARK/ark_server.py %i
|
||||
WorkingDirectory=/home/steam/ARK
|
||||
LimitNOFILE=100000
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
ExecStop=/bin/kill -s INT $MAINPID
|
||||
User=steam
|
||||
Group=steam
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
60
ark_server.py
Executable file
60
ark_server.py
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
def run_server(config, full_server_id):
|
||||
cluster_id, server_id = full_server_id.split(".")
|
||||
cluster = config["clusters"][cluster_id]
|
||||
server = config[cluster_id][server_id]
|
||||
|
||||
map_name = server["map"]
|
||||
map_title = map_name.replace("_P", "")
|
||||
session_name = f"{cluster['name']}: {map_title}"
|
||||
|
||||
port_index = server["port"]
|
||||
game_port = config["ports"]["game"] + port_index * 2
|
||||
query_port = config["ports"]["query"] + port_index
|
||||
rcon_port = config["ports"]["rcon"] + port_index
|
||||
|
||||
mod_names = cluster["mods"]
|
||||
if "mods" in server:
|
||||
mod_names += server["mods"]
|
||||
|
||||
mod_ids = [str(config["mods"][name]) for name in mod_names]
|
||||
|
||||
game_uri = "?".join([
|
||||
server["map"],
|
||||
"listen",
|
||||
f"SessionName={session_name}",
|
||||
f"AltSaveDirectoryName={full_server_id}",
|
||||
f"Port={game_port}",
|
||||
f"QueryPort={query_port}",
|
||||
f"RCONPORT={rcon_port}",
|
||||
f"GameModIds={','.join(mod_ids)}",
|
||||
])
|
||||
|
||||
args = [
|
||||
config["exe"],
|
||||
game_uri,
|
||||
"-server",
|
||||
"-log",
|
||||
"-NoBattlEye",
|
||||
"-exclusivejoin",
|
||||
"-NoTransferFromFiltering",
|
||||
f"-clusterid={cluster['name']}",
|
||||
]
|
||||
|
||||
from os import execv
|
||||
execv(config["exe"], args)
|
||||
|
||||
if __name__ == "__main__":
|
||||
from argparse import ArgumentParser
|
||||
|
||||
p = ArgumentParser(description="ARK Server launcher script")
|
||||
p.add_argument("--config", "-c", metavar="FILE", default="ark_servers.toml",
|
||||
help="Config file path")
|
||||
p.add_argument("server", metavar="NAME", help="Which server config entry to run")
|
||||
|
||||
args = p.parse_args()
|
||||
|
||||
from toml import load
|
||||
config = load(args.config)
|
||||
run_server(config, args.server)
|
||||
73
ark_servers.toml
Normal file
73
ark_servers.toml
Normal file
@@ -0,0 +1,73 @@
|
||||
exe = "ShooterGame/Binaries/Linux/ShooterGameServer"
|
||||
|
||||
[ports]
|
||||
game = 7777
|
||||
query = 27010
|
||||
rcon = 28010
|
||||
|
||||
[mods]
|
||||
sp = 731604991 # Structures Plus
|
||||
ss = 1999447172 # Super Structures
|
||||
kbd = 1565015734 # Kraken's Better Dinos
|
||||
ds2 = 1609138312 # Dino Storage 2
|
||||
erp = 741203089 # Eco's RP Decor
|
||||
al = 1380777369 # Additional Lighting
|
||||
|
||||
ckfr = 1814953878 # Castles, Forts, and Keeps Remastered
|
||||
egd = 880871931 # Eco's Gargen Decor
|
||||
essd = 1091147617 # Eco's Stable Structures and Decor
|
||||
|
||||
[clusters.moj]
|
||||
name = "MoJ"
|
||||
mods = ["ss", "kbd", "ds2", "erp", "al"]
|
||||
|
||||
[clusters.bw]
|
||||
name = "Brackenwald"
|
||||
mods = ["sp", "ds2"]
|
||||
|
||||
[moj.ragnarok]
|
||||
map = "Ragnarok"
|
||||
port = 0
|
||||
mods = ["ckfr", "egd", "essd"]
|
||||
|
||||
[moj.island]
|
||||
map = "TheIsland"
|
||||
port = 1
|
||||
|
||||
[moj.scorched]
|
||||
map = "ScorchedEarth_P"
|
||||
port = 2
|
||||
|
||||
[moj.aberration]
|
||||
map = "Aberration_P"
|
||||
port = 3
|
||||
|
||||
[moj.fjordur]
|
||||
map = "Fjordur"
|
||||
port = 3
|
||||
|
||||
[moj.valguero]
|
||||
map = "Valguero_P"
|
||||
port = 4
|
||||
mods = ["ckfr"]
|
||||
|
||||
[moj.lost_island]
|
||||
map = "LostIsland"
|
||||
port = 4
|
||||
|
||||
[moj.gen2]
|
||||
map = "Gen2"
|
||||
port = 5
|
||||
|
||||
[moj.crystal_isles]
|
||||
map = "CrystalIsles"
|
||||
port = 5
|
||||
mods = ["ckfr"]
|
||||
|
||||
[moj.extinction]
|
||||
map = "Extinction"
|
||||
port = 6
|
||||
|
||||
[moj.gen1]
|
||||
map = "Genesis"
|
||||
port = 7
|
||||
Reference in New Issue
Block a user