Skip to content

Commit 372a3b3

Browse files
authored
Unturned: add ServerID option (#1572)
1 parent e6aa316 commit 372a3b3

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

unturned.kvp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Meta.Prerequisites=[]
2121
Meta.ExtraContainerPackages=[]
2222
Meta.ConfigReleaseState=NotSpecified
2323
Meta.NoCommercialUsage=False
24-
Meta.ConfigVersion=1.6
24+
Meta.ConfigVersion=7
2525
Meta.ReleaseNotes=
2626
Meta.BreakingReleaseNotes=
2727
Meta.AppConfigId=1f00f476-2adf-4a4f-a748-846c40fa4f31
@@ -35,7 +35,7 @@ App.ExecutableLinux=1110390/Unturned_Headless.x86_64
3535
App.WorkingDir=1110390
3636
App.LinuxCommandLineArgs=
3737
App.WindowsCommandLineArgs=
38-
App.CommandLineArgs={{$PlatformArgs}} -batchmode -nographics {{$FormattedArgs}} +{{ServerType}}/Unturned
38+
App.CommandLineArgs={{$PlatformArgs}} -batchmode -nographics {{$FormattedArgs}} +{{ServerType}}/{{ServerID}}
3939
App.UseLinuxIOREDIR=False
4040
App.AppSettings={}
4141
App.EnvironmentVariables={"LD_LIBRARY_PATH":"{{$FullBaseDir}}linux64:{{$FullRootDir}}linux64:%LD_LIBRARY_PATH%","SteamAppId":"304930"}

unturnedconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"Hidden": true,
1212
"ParamFieldName": "Port",
1313
"IncludeInCommandLine": false,
14+
"ExcludeFromImport": true,
1415
"EnumValues": {}
1516
},
1617
{
@@ -26,6 +27,7 @@
2627
"ParamFieldName": "/RocketSettings/RCON/@Enabled",
2728
"IncludeInCommandLine": false,
2829
"DefaultValue": "true",
30+
"ExcludeFromImport": true,
2931
"EnumValues": {}
3032
},
3133
{
@@ -40,6 +42,7 @@
4042
"Hidden": true,
4143
"ParamFieldName": "/RocketSettings/RCON/@Port",
4244
"IncludeInCommandLine": false,
45+
"ExcludeFromImport": true,
4346
"EnumValues": {}
4447
},
4548
{
@@ -55,6 +58,7 @@
5558
"ParamFieldName": "permissionSystem",
5659
"IncludeInCommandLine": false,
5760
"DefaultValue": "OpenMod",
61+
"ExcludeFromImport": true,
5862
"EnumValues": {}
5963
},
6064
{
@@ -362,6 +366,22 @@
362366
"Placeholder": "2",
363367
"EnumValues": {}
364368
},
369+
{
370+
"DisplayName": "Server ID",
371+
"Category": "Unturned:stadia_controller",
372+
"Subcategory": "Server:dns:1",
373+
"Description": "Server ID for the directory where savedata and configuration files are stored. WARNING: Do not change unless you know what you are doing! Make sure you update the server if this is changed, and you may also need to reconfigure config files, including for RocketMod and OpenMod, as applicable",
374+
"Keywords": "server,id,serverid",
375+
"FieldName": "ServerID",
376+
"InputType": "text",
377+
"IsFlagArgument": false,
378+
"ParamFieldName": "ServerID",
379+
"IncludeInCommandLine": false,
380+
"DefaultValue": "Unturned",
381+
"Placeholder": "Unturned",
382+
"Required": true,
383+
"EnumValues": {}
384+
},
365385
{
366386
"DisplayName": "Install OpenMod",
367387
"Category": "Updates",

unturnedmetaconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
[
22
{
3-
"ConfigFile": "Servers/Unturned/Server/Commands.dat",
3+
"ConfigFile": "Servers/{{ServerID}}/Server/Commands.dat",
44
"AutoMap": true,
5+
"Importable": true,
56
"ConfigType": "kvp",
67
"ConfigFormat": "{0} {1}",
78
"ConfigFormatRegex": "^(?<key>.+?) (?<value>.*?)$"
89
},
910
{
10-
"ConfigFile": "Servers/Unturned/WorkshopDownloadConfig.json",
11+
"ConfigFile": "Servers/{{ServerID}}/WorkshopDownloadConfig.json",
1112
"AutoMap": true,
13+
"Importable": true,
1214
"ConfigType": "template",
1315
"ConfigFileTemplate": "unturnedworkshopconfig.json"
1416
},
1517
{
16-
"ConfigFile": "Servers/Unturned/Rocket/Rocket.config.xml",
18+
"ConfigFile": "Servers/{{ServerID}}/Rocket/Rocket.config.xml",
1719
"AutoMap": true,
1820
"ConfigType": "xml"
1921
},
2022
{
21-
"ConfigFile": "Servers/Unturned/OpenMod/openmod.unturned.yaml",
23+
"ConfigFile": "Servers/{{ServerID}}/OpenMod/openmod.unturned.yaml",
2224
"AutoMap": true,
2325
"ConfigType": "kvp",
2426
"ConfigFormat": " {0}: {1}",

unturnedupdates.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"UpdateSourcePlatform": "Linux",
55
"UpdateSource": "Executable",
66
"UpdateSourceData": "/bin/bash",
7-
"UpdateSourceArgs": "-c \"cd U3DS/1110390 && rm -rf Modules/OpenMod.Unturned Servers/Unturned/OpenMod >/dev/null 2>&1\"",
7+
"UpdateSourceArgs": "-c \"cd U3DS/1110390 && rm -rf Modules/OpenMod.Unturned \\\"Servers/{{ServerID}}/OpenMod\\\" >/dev/null 2>&1\"",
88
"UpdateSourceConditionSetting": "OpenMod",
99
"UpdateSourceConditionValue": "false",
1010
"SkipOnFailure": true
@@ -14,7 +14,7 @@
1414
"UpdateSourcePlatform": "Windows",
1515
"UpdateSource": "Executable",
1616
"UpdateSourceData": "cmd.exe",
17-
"UpdateSourceArgs": "/C cd U3DS\\1110390 && rd /S /Q Modules\\OpenMod.Unturned Servers\\Unturned\\OpenMod > NUL 2>&1",
17+
"UpdateSourceArgs": "/C cd U3DS\\1110390 && rd /S /Q Modules\\OpenMod.Unturned \"Servers\\{{ServerID}}\\OpenMod\" > NUL 2>&1",
1818
"UpdateSourceConditionSetting": "OpenMod",
1919
"UpdateSourceConditionValue": "false",
2020
"SkipOnFailure": true
@@ -31,7 +31,7 @@
3131
"UpdateStageName": "Config Directory Creation",
3232
"UpdateSourcePlatform": "All",
3333
"UpdateSource": "CreateDirectory",
34-
"UpdateSourceArgs": "{{$FullBaseDir}}Servers/Unturned/Server",
34+
"UpdateSourceArgs": "{{$FullBaseDir}}Servers/{{ServerID}}/Server",
3535
"SkipOnFailure": false
3636
},
3737
{
@@ -40,7 +40,7 @@
4040
"UpdateSource": "FetchURL",
4141
"UpdateSourceData": "https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/unturnedconfigfile.dat",
4242
"UpdateSourceArgs": "Commands.dat",
43-
"UpdateSourceTarget": "{{$FullBaseDir}}Servers/Unturned/Server/",
43+
"UpdateSourceTarget": "{{$FullBaseDir}}Servers/{{ServerID}}/Server/",
4444
"OverwriteExistingFiles": false,
4545
"SkipOnFailure": false
4646
},

0 commit comments

Comments
 (0)