diff --git a/spellmasons.kvp b/spellmasons.kvp new file mode 100644 index 000000000..bbe389ccc --- /dev/null +++ b/spellmasons.kvp @@ -0,0 +1,85 @@ +Meta.DisplayName=Spellmasons Server +Meta.Description=Spellmasons Dedicated Server +Meta.OS=Linux, Windows +Meta.AarchSupport=Native +Meta.Arch=All +Meta.Author=Chain-BC +Meta.URL=https://store.steampowered.com/app/1618380/Spellmasons/ +Meta.DisplayImageSource=steam:1618380 +Meta.ConfigManifest=spellmasonsconfig.json +Meta.MetaConfigManifest= +Meta.ConfigRoot=spellmasons.kvp +Meta.MinAMPVersion=2.5.0.8 +Meta.SpecificDockerImage= +Meta.DockerRequired=False +Meta.ContainerPolicy=Supported +Meta.ContainerPolicyReason= +Meta.ExtraSetupStepsURI= +Meta.AppConfigId=1a088c8c-7fa1-47ce-9a33-003f75905836 +App.DisplayName=Spellmasons Server +App.RootDir=./main/ +App.BaseDirectory=./main/ +App.ExecutableWin=node\node.exe +App.ExecutableLinux=./node/bin/node +App.WorkingDir=spellmasons-server +App.LinuxCommandLineArgs= +App.WindowsCommandLineArgs= +App.CommandLineArgs="src/HeadlessServer.js" +App.UseLinuxIOREDIR=False +App.AppSettings={} +App.EnvironmentVariables={"PORT": "{{$ServerPort}}"} +App.CommandLineParameterFormat=-{0}={1} +App.CommandLineParameterDelimiter= +App.ExitMethod=Kill +App.ExitTimeout=30 +App.ExitString=stop +App.ExitFile=lock +App.HasWriteableConsole=True +App.HasReadableConsole=True +App.SupportsLiveSettingsChanges=False +App.LiveSettingChangeCommandFormat=set {0} "{1}" +App.ApplicationIPBinding=0.0.0.0 +App.Ports=@IncludeJson[spellmasonsports.json] +App.AdminPortRef=ServerPort +App.PrimaryApplicationPortRef=ServerPort +App.UniversalSleepApplicationUDPPortRef=0 +App.UniversalSleepSteamQueryPortRef=0 +App.MaxUsers=0 +App.UseRandomAdminPassword=False +App.RemoteAdminPassword=Password123 +App.AdminMethod=STDIO +App.AdminLoginTransform=None +App.RCONConnectDelaySeconds=5 +App.RCONConnectRetrySeconds=5 +App.RCONHeartbeatMinutes=0 +App.RCONHeartbeatCommand=ping +App.TelnetLoginFormat={0} +App.UpdateSources=@IncludeJson[spellmasonsupdates.json] +App.Compatibility=None +App.SteamUpdateAnonymousLogin=True +App.SteamForceLoginPrompt=False +App.RapidStartup=True +App.MonitorChildProcess=False +App.MonitorChildProcessWaitMs=1000 +App.MonitorChildProcessName= +App.SupportsUniversalSleep=False +App.WakeupMode=Any +App.ApplicationReadyMode=Immediate +Console.FilterMatchRegex=\e\[(\d+;)*(\d+)?[ABCDHJKfmsu]|\e\[?[?\>\=\da-z]+ +Console.FilterMatchReplacement= +Console.ThrowawayMessageRegex= +Console.AppReadyRegex=^$ +Console.UserJoinRegex=^$ +Console.UserLeaveRegex=^$ +Console.UserChatRegex=^$ +Console.UpdateAvailableRegex=^$ +Console.MetricsRegex= +Console.SuppressLogAtStart=False +Console.ActivateLogRegex= +Console.UserActions={} +Limits.SleepMode=False +Limits.SleepOnStart=False +Limits.SleepDelayMinutes=5 +Limits.DozeDelay=2 +Limits.AutoRetryCount=5 +Limits.SleepStartThresholdSeconds=25 diff --git a/spellmasonsconfig.json b/spellmasonsconfig.json new file mode 100644 index 000000000..c31168065 --- /dev/null +++ b/spellmasonsconfig.json @@ -0,0 +1,48 @@ +[ + { + "DisplayName":"Spellmasons Version", + "Category":"Spellmasons Settings", + "Description":"Set what version of the game to download the server for.", + "Keywords":"server,version", + "FieldName":"ServerVersion", + "InputType":"enum", + "IsFlagArgument":false, + "ParamFieldName":"ServerVersion", + "IncludeInCommandLine":false, + "DefaultValue":"Manual", + "EnumValues":{ + "Latest":"Latest/Beta", + "Manual":"Custom Version" + } + }, + { + "DisplayName":"Custom Server Version", + "Category":"Spellmasons Settings", + "Description":"Sets what version of the server to download if \"Custom Version\" is chosen under \"Spellmasons Version\".", + "Keywords":"custom,version", + "FieldName":"CustomVersion", + "InputType":"text", + "IsFlagArgument":false, + "ParamFieldName":"CustomVersion", + "IncludeInCommandLine":false, + "DefaultValue":"v1.43.4", + "Placeholder":"v1.43.4", + "EnumValues":{} + }, + { + "DisplayName":"Disable Node.js Download", + "Category":"Spellmasons Settings", + "Description":"If set, Node.js will not be downloaded and installed when the server is updated. Saves on bandwidth as it is unnecessary to install it again after the first run.", + "Keywords":"node,nodejs,download,update", + "FieldName":"DisableNodeDownload", + "InputType":"checkbox", + "IsFlagArgument":false, + "ParamFieldName":"DisableNodeDownload", + "IncludeInCommandLine":false, + "DefaultValue":"false", + "EnumValues":{ + "False":"false", + "True":"true" + } + } +] diff --git a/spellmasonsports.json b/spellmasonsports.json new file mode 100644 index 000000000..32d51f529 --- /dev/null +++ b/spellmasonsports.json @@ -0,0 +1,9 @@ +[ + { + "Protocol": "Both", + "Port": 9876, + "Ref": "ServerPort", + "Name": "Server Port", + "Description": "Main port used by the game." + } +] diff --git a/spellmasonsupdates.json b/spellmasonsupdates.json new file mode 100644 index 000000000..df6504d2e --- /dev/null +++ b/spellmasonsupdates.json @@ -0,0 +1,152 @@ +[ + { + "UpdateStageName":"Spellmasons Folder Creation", + "UpdateSourcePlatform":"All", + "UpdateSource":"CreateDirectory", + "UpdateSourceArgs":"{{$FullBaseDir}}Spellmasons" + }, + { + "UpdateStageName":"Downloading Server", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'cd {{$FullBaseDir}}Spellmasons && git pull https://github.com/jdoleary/Spellmasons.git || git clone https://github.com/jdoleary/Spellmasons.git {{$FullBaseDir}}Spellmasons'", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"Latest", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Downloading Server", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'cd {{$FullBaseDir}}Spellmasons && git pull https://github.com/jdoleary/Spellmasons.git && git reset --hard {{CustomVersion}} || git clone https://github.com/jdoleary/Spellmasons.git {{$FullBaseDir}}Spellmasons -b {{CustomVersion}}'", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"Manual", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Downloading Server", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C cd {{$FullBaseDir}}Spellmasons && git pull https://github.com/jdoleary/Spellmasons.git || git clone https://github.com/jdoleary/Spellmasons.git {{$FullBaseDir}}Spellmasons", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"Latest", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Downloading Server", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C cd {{$FullBaseDir}}Spellmasons && git pull https://github.com/jdoleary/Spellmasons.git && git reset --hard {{CustomVersion}} || git clone https://github.com/jdoleary/Spellmasons.git {{$FullBaseDir}}Spellmasons -b {{CustomVersion}}", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"Manual", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Node.js Download", + "UpdateSourcePlatform":"Linux", + "UpdateSourceArch":"x86_64", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://nodejs.org/download/release/v20.16.0/node-v20.16.0-linux-x64.tar.gz", + "UpdateSourceTarget":"{{$FullBaseDir}}", + "UpdateSourceConditionSetting":"DisableNodeDownload", + "UpdateSourceConditionValue":"false" + }, + { + "UpdateStageName":"Node.js Extract", + "UpdateSourcePlatform":"Linux", + "UpdateSourceArch":"x86_64", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'cd \"{{$FullBaseDir}}\" && rm -Rf \"{{$FullBaseDir}}node/\" >/dev/null 2>&1 && tar xfv node-v20.16.0-linux-x64.tar.gz > {{$FullBaseDir}}AMPSetupLog.txt 2>&1 && mv -v node-v20.16.0-linux-x64 node >> {{$FullBaseDir}}AMPSetupLog.txt 2>&1 && rm node-v20.16.0-linux-x64.tar.gz'", + "UpdateSourceConditionSetting":"DisableNodeDownload", + "UpdateSourceConditionValue":"false", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Node.js Download", + "UpdateSourcePlatform":"Linux", + "UpdateSourceArch":"aarch64", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://nodejs.org/download/release/v20.16.0/node-v20.16.0-linux-arm64.tar.gz", + "UpdateSourceTarget":"{{$FullBaseDir}}", + "UpdateSourceConditionSetting":"DisableNodeDownload", + "UpdateSourceConditionValue":"false" + }, + { + "UpdateStageName":"Node.js Extract", + "UpdateSourcePlatform":"Linux", + "UpdateSourceArch":"aarch64", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'cd \"{{$FullBaseDir}}\" && rm -Rf \"{{$FullBaseDir}}node/\" >/dev/null 2>&1 && tar xfv node-v20.16.0-linux-arm64.tar.gz && mv -v node-v20.16.0-linux-arm64 node && rm node-v20.16.0-linux-arm64.tar.gz'", + "UpdateSourceConditionSetting":"DisableNodeDownload", + "UpdateSourceConditionValue":"false", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Node.js Download", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://nodejs.org/download/release/v20.16.0/node-v20.16.0-win-x64.zip", + "UpdateSourceTarget":"{{$FullBaseDir}}", + "UnzipUpdateSource":true, + "OverwriteExistingFiles":true, + "DeleteAfterExtract":true, + "UpdateSourceConditionSetting":"DisableNodeDownload", + "UpdateSourceConditionValue":"false" + }, + { + "UpdateStageName":"Node.js Extract", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C cd \"{{$FullBaseDir}}\" & rmdir /S /Q \"{{$FullBaseDir}}node/\" > NUL 2>&1 & rename node-v20.16.0-win-x64 node > {{$FullBaseDir}}AMPSetupLog.txt 2>&1", + "UpdateSourceConditionSetting":"DisableNodeDownload", + "UpdateSourceConditionValue":"false", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Installing Necessary npm Packages", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'export PATH=$PATH:{{$FullBaseDir}}node/bin && cd \"{{$FullBaseDir}}Spellmasons/\" && npm i'", + "UpdateSourceConditionSetting":"", + "UpdateSourceConditionValue":"", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Installing Necessary npm Packages", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C set PATH={{$FullBaseDir}}node;%PATH% && cd \"{{$FullBaseDir}}Spellmasons\\\" && npm i", + "UpdateSourceConditionSetting":"", + "UpdateSourceConditionValue":"", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Building Server", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'export PATH=$PATH:{{$FullBaseDir}}node/bin && cd {{$FullBaseDir}}Spellmasons && \"node_modules/.bin/tsc\" --project tsconfig.headless.json --outDir {{$FullBaseDir}}spellmasons-server/ && cp package-lock.json {{$FullBaseDir}}spellmasons-server/ && cp public/spellmasons-mods/build/SpellmasonsMods.cjs.js {{$FullBaseDir}}spellmasons-server/src/SpellmasonsMods.cjs.js && cd {{$FullBaseDir}}spellmasons-server/ && npm i --omit=dev'", + "UpdateSourceConditionSetting":"", + "UpdateSourceConditionValue":"", + "SkipOnFailure":false + }, + { + "UpdateStageName":"Buiding Server", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C set PATH={{$FullBaseDir}}node;%PATH% && cd \"{{$FullBaseDir}}Spellmasons\\\" && \"node_modules\\.bin\\tsc\" --project tsconfig.headless.json --outDir {{$FullBaseDir}}spellmasons-server\\ && copy package-lock.json {{$FullBaseDir}}spellmasons-server\\ && copy public\\spellmasons-mods\\build\\SpellmasonsMods.cjs.js {{$FullBaseDir}}spellmasons-server\\src\\SpellmasonsMods.cjs.js && cd {{$FullBaseDir}}spellmasons-server\\ && npm i --omit=dev", + "UpdateSourceConditionSetting":"", + "UpdateSourceConditionValue":"", + "SkipOnFailure":false + } +]