mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Server Version Changes
This commit is contained in:
parent
0a90a0cfec
commit
ae55d0d1c0
8 changed files with 117 additions and 4 deletions
|
|
@ -341,6 +341,9 @@
|
||||||
<setting name="ServerEngineConfigFile" serializeAs="String">
|
<setting name="ServerEngineConfigFile" serializeAs="String">
|
||||||
<value>Engine.ini</value>
|
<value>Engine.ini</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="VersionFile" serializeAs="String">
|
||||||
|
<value>version.txt</value>
|
||||||
|
</setting>
|
||||||
</ServerManagerTool.Config>
|
</ServerManagerTool.Config>
|
||||||
<ServerManagerTool.Common.CommonConfig>
|
<ServerManagerTool.Common.CommonConfig>
|
||||||
<setting name="DefaultSteamAPIKey" serializeAs="String">
|
<setting name="DefaultSteamAPIKey" serializeAs="String">
|
||||||
|
|
|
||||||
11
src/ARKServerManager/Config.Designer.cs
generated
11
src/ARKServerManager/Config.Designer.cs
generated
|
|
@ -12,7 +12,7 @@ namespace ServerManagerTool {
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
||||||
public sealed partial class Config : global::System.Configuration.ApplicationSettingsBase {
|
public sealed partial class Config : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Config defaultInstance = ((Config)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Config())));
|
private static Config defaultInstance = ((Config)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Config())));
|
||||||
|
|
@ -2530,5 +2530,14 @@ namespace ServerManagerTool {
|
||||||
this["ManagePublicIPAutomatically"] = value;
|
this["ManagePublicIPAutomatically"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("version.txt")]
|
||||||
|
public string VersionFile {
|
||||||
|
get {
|
||||||
|
return ((string)(this["VersionFile"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -707,5 +707,8 @@
|
||||||
<Setting Name="ManagePublicIPAutomatically" Type="System.Boolean" Scope="User">
|
<Setting Name="ManagePublicIPAutomatically" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="VersionFile" Type="System.String" Scope="Application">
|
||||||
|
<Value Profile="(Default)">version.txt</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
|
|
@ -1244,7 +1244,14 @@ namespace ServerManagerTool.Lib
|
||||||
LogProfileMessage("Validated server files (*new*).");
|
LogProfileMessage("Validated server files (*new*).");
|
||||||
}
|
}
|
||||||
|
|
||||||
LogProfileMessage("Updated server from cache. See ARK patch notes.");
|
// update the version number
|
||||||
|
_profile.LastInstalledVersion = GetServerVersion(GetServerVersionFile()).ToString();
|
||||||
|
_profile.ServerUpdated = true;
|
||||||
|
|
||||||
|
LogProfileMessage("Updated server from cache.");
|
||||||
|
LogProfileMessage($"Server version: {_profile.LastInstalledVersion}.");
|
||||||
|
|
||||||
|
LogProfileMessage("See ARK patch notes.");
|
||||||
LogProfileMessage(Config.Default.ArkSE_PatchNotesUrl);
|
LogProfileMessage(Config.Default.ArkSE_PatchNotesUrl);
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(Config.Default.Alert_ServerUpdate))
|
if (!string.IsNullOrWhiteSpace(Config.Default.Alert_ServerUpdate))
|
||||||
|
|
@ -1253,8 +1260,6 @@ namespace ServerManagerTool.Lib
|
||||||
emailMessage.AppendLine();
|
emailMessage.AppendLine();
|
||||||
emailMessage.AppendLine("Updated server from cache. See ARK patch notes.");
|
emailMessage.AppendLine("Updated server from cache. See ARK patch notes.");
|
||||||
emailMessage.AppendLine(Config.Default.ArkSE_PatchNotesUrl);
|
emailMessage.AppendLine(Config.Default.ArkSE_PatchNotesUrl);
|
||||||
|
|
||||||
_profile.ServerUpdated = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1747,6 +1752,9 @@ namespace ServerManagerTool.Lib
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogBranchMessage(branchName, "No new version.");
|
LogBranchMessage(branchName, "No new version.");
|
||||||
|
|
||||||
|
var cacheVersion = GetServerVersion(GetServerCacheVersionFile(branchName)).ToString();
|
||||||
|
LogMessage($"Server cache version: {cacheVersion}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogBranchMessage(branchName, $"Server cache does not exist.");
|
LogBranchMessage(branchName, $"Server cache does not exist.");
|
||||||
|
|
@ -2271,6 +2279,8 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
private static string GetServerCacheTimeFile(string branchName) => IOUtils.NormalizePath(Path.Combine(GetServerCacheFolder(branchName), Config.Default.LastUpdatedTimeFile));
|
private static string GetServerCacheTimeFile(string branchName) => IOUtils.NormalizePath(Path.Combine(GetServerCacheFolder(branchName), Config.Default.LastUpdatedTimeFile));
|
||||||
|
|
||||||
|
private static string GetServerCacheVersionFile(string branchName) => IOUtils.NormalizePath(Path.Combine(GetServerCacheFolder(branchName), Config.Default.VersionFile));
|
||||||
|
|
||||||
private string GetServerExecutableFile() => IOUtils.NormalizePath(Path.Combine(_profile.InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ServerExe));
|
private string GetServerExecutableFile() => IOUtils.NormalizePath(Path.Combine(_profile.InstallDirectory, Config.Default.ServerBinaryRelativePath, Config.Default.ServerExe));
|
||||||
|
|
||||||
private DateTime GetServerLatestTime(string timeFile)
|
private DateTime GetServerLatestTime(string timeFile)
|
||||||
|
|
@ -2313,6 +2323,28 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
private string GetServerSaveFolder() => IOUtils.NormalizePath(ServerProfile.GetProfileSavePath(_profile.InstallDirectory, _profile.AltSaveDirectoryName, _profile.PGM_Enabled, _profile.PGM_Name));
|
private string GetServerSaveFolder() => IOUtils.NormalizePath(ServerProfile.GetProfileSavePath(_profile.InstallDirectory, _profile.AltSaveDirectoryName, _profile.PGM_Enabled, _profile.PGM_Name));
|
||||||
|
|
||||||
|
private string GetServerVersionFile() => IOUtils.NormalizePath(Path.Combine(_profile.InstallDirectory, Config.Default.VersionFile));
|
||||||
|
|
||||||
|
public static Version GetServerVersion(string versionFile)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(versionFile) && File.Exists(versionFile))
|
||||||
|
{
|
||||||
|
var fileValue = File.ReadAllText(versionFile);
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(fileValue))
|
||||||
|
{
|
||||||
|
string versionString = fileValue.ToString();
|
||||||
|
if (versionString.IndexOf('.') == -1)
|
||||||
|
versionString = versionString + ".0";
|
||||||
|
|
||||||
|
if (Version.TryParse(versionString, out Version version))
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Version(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
private string GetServerWorldFile()
|
private string GetServerWorldFile()
|
||||||
{
|
{
|
||||||
var profileSaveFolder = GetServerSaveFolder();
|
var profileSaveFolder = GetServerSaveFolder();
|
||||||
|
|
|
||||||
|
|
@ -5052,6 +5052,7 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
this.ClearValue(EnableAllowCaveFlyersProperty);
|
this.ClearValue(EnableAllowCaveFlyersProperty);
|
||||||
this.ClearValue(AllowFlyingStaminaRecoveryProperty);
|
this.ClearValue(AllowFlyingStaminaRecoveryProperty);
|
||||||
|
this.ClearValue(AllowFlyerSpeedLevelingProperty);
|
||||||
this.ClearValue(PreventMateBoostProperty);
|
this.ClearValue(PreventMateBoostProperty);
|
||||||
|
|
||||||
this.ClearValue(DisableDinoDecayPvEProperty);
|
this.ClearValue(DisableDinoDecayPvEProperty);
|
||||||
|
|
@ -5300,6 +5301,7 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
this.ClearValue(AllowTekSuitPowersInGenesisProperty);
|
this.ClearValue(AllowTekSuitPowersInGenesisProperty);
|
||||||
this.ClearValue(DisableGenesisMissionsProperty);
|
this.ClearValue(DisableGenesisMissionsProperty);
|
||||||
|
this.ClearValue(DisableDefaultMapItemSetsProperty);
|
||||||
|
|
||||||
this.ClearValue(EnableCryoSicknessPVEProperty);
|
this.ClearValue(EnableCryoSicknessPVEProperty);
|
||||||
this.ClearValue(EnableCryopodNerfProperty);
|
this.ClearValue(EnableCryopodNerfProperty);
|
||||||
|
|
@ -5308,7 +5310,10 @@ namespace ServerManagerTool.Lib
|
||||||
this.ClearValue(CryopodNerfIncomingDamageMultiplierPercentProperty);
|
this.ClearValue(CryopodNerfIncomingDamageMultiplierPercentProperty);
|
||||||
|
|
||||||
this.ClearValue(MaxHexagonsPerCharacterProperty);
|
this.ClearValue(MaxHexagonsPerCharacterProperty);
|
||||||
|
this.ClearValue(DisableHexagonStoreProperty);
|
||||||
|
this.ClearValue(HexStoreAllowOnlyEngramTradeOptionProperty);
|
||||||
this.ClearValue(HexagonRewardMultiplierProperty);
|
this.ClearValue(HexagonRewardMultiplierProperty);
|
||||||
|
this.ClearValue(HexagonCostMultiplierProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetSOTFSection()
|
public void ResetSOTFSection()
|
||||||
|
|
@ -5650,6 +5655,8 @@ namespace ServerManagerTool.Lib
|
||||||
|
|
||||||
this.SetValue(EnableAllowCaveFlyersProperty, sourceProfile.EnableAllowCaveFlyers);
|
this.SetValue(EnableAllowCaveFlyersProperty, sourceProfile.EnableAllowCaveFlyers);
|
||||||
this.SetValue(AllowFlyingStaminaRecoveryProperty, sourceProfile.AllowFlyingStaminaRecovery);
|
this.SetValue(AllowFlyingStaminaRecoveryProperty, sourceProfile.AllowFlyingStaminaRecovery);
|
||||||
|
this.SetValue(AllowFlyerSpeedLevelingProperty, sourceProfile.AllowFlyerSpeedLeveling);
|
||||||
|
|
||||||
this.SetValue(PreventMateBoostProperty, sourceProfile.PreventMateBoost);
|
this.SetValue(PreventMateBoostProperty, sourceProfile.PreventMateBoost);
|
||||||
this.SetValue(DisableDinoDecayPvEProperty, sourceProfile.DisableDinoDecayPvE);
|
this.SetValue(DisableDinoDecayPvEProperty, sourceProfile.DisableDinoDecayPvE);
|
||||||
this.SetValue(DisableDinoDecayPvPProperty, sourceProfile.DisableDinoDecayPvP);
|
this.SetValue(DisableDinoDecayPvPProperty, sourceProfile.DisableDinoDecayPvP);
|
||||||
|
|
@ -5959,7 +5966,10 @@ namespace ServerManagerTool.Lib
|
||||||
this.SetValue(CryopodNerfIncomingDamageMultiplierPercentProperty, sourceProfile.CryopodNerfIncomingDamageMultiplierPercent);
|
this.SetValue(CryopodNerfIncomingDamageMultiplierPercentProperty, sourceProfile.CryopodNerfIncomingDamageMultiplierPercent);
|
||||||
|
|
||||||
this.SetValue(MaxHexagonsPerCharacterProperty, sourceProfile.MaxHexagonsPerCharacter);
|
this.SetValue(MaxHexagonsPerCharacterProperty, sourceProfile.MaxHexagonsPerCharacter);
|
||||||
|
this.SetValue(DisableHexagonStoreProperty, sourceProfile.DisableHexagonStore);
|
||||||
|
this.SetValue(HexStoreAllowOnlyEngramTradeOptionProperty, sourceProfile.HexStoreAllowOnlyEngramTradeOption);
|
||||||
this.SetValue(HexagonRewardMultiplierProperty, sourceProfile.HexagonRewardMultiplier);
|
this.SetValue(HexagonRewardMultiplierProperty, sourceProfile.HexagonRewardMultiplier);
|
||||||
|
this.SetValue(HexagonCostMultiplierProperty, sourceProfile.HexagonCostMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SyncServerFiles(ServerProfile sourceProfile)
|
private void SyncServerFiles(ServerProfile sourceProfile)
|
||||||
|
|
|
||||||
|
|
@ -619,6 +619,12 @@ namespace ServerManagerTool.Lib
|
||||||
gotNewVersion = ServerApp.HasNewServerVersion(this.ProfileSnapshot.InstallDirectory, startTime);
|
gotNewVersion = ServerApp.HasNewServerVersion(this.ProfileSnapshot.InstallDirectory, startTime);
|
||||||
|
|
||||||
progressCallback?.Invoke(0, $"{SteamCmdUpdater.OUTPUT_PREFIX} New server version - {gotNewVersion.ToString().ToUpperInvariant()}.");
|
progressCallback?.Invoke(0, $"{SteamCmdUpdater.OUTPUT_PREFIX} New server version - {gotNewVersion.ToString().ToUpperInvariant()}.");
|
||||||
|
|
||||||
|
// update the version number of the server.
|
||||||
|
var versionFile = Path.Combine(this.ProfileSnapshot.InstallDirectory, Config.Default.VersionFile);
|
||||||
|
this.Version = ServerApp.GetServerVersion(versionFile);
|
||||||
|
|
||||||
|
progressCallback?.Invoke(0, $"{SteamCmdUpdater.OUTPUT_PREFIX} Server version: {this.Version}\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
progressCallback?.Invoke(0, "\r\n");
|
progressCallback?.Invoke(0, "\r\n");
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ namespace ServerManagerTool
|
||||||
DinoTamedPerLevelStatMultipliers,
|
DinoTamedPerLevelStatMultipliers,
|
||||||
DinoTamedAddPerLevelStatMultipliers,
|
DinoTamedAddPerLevelStatMultipliers,
|
||||||
DinoTamedAffinityPerLevelStatMultipliers,
|
DinoTamedAffinityPerLevelStatMultipliers,
|
||||||
|
ItemStatClamps,
|
||||||
RCONWindowExtents,
|
RCONWindowExtents,
|
||||||
ServerOptions,
|
ServerOptions,
|
||||||
ServerLogOptions,
|
ServerLogOptions,
|
||||||
|
|
@ -3991,6 +3992,9 @@ namespace ServerManagerTool
|
||||||
this.Settings.PerLevelStatsMultiplier_DinoTamed_Affinity.Reset();
|
this.Settings.PerLevelStatsMultiplier_DinoTamed_Affinity.Reset();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ServerSettingsResetAction.ItemStatClamps:
|
||||||
|
break;
|
||||||
|
|
||||||
case ServerSettingsResetAction.RCONWindowExtents:
|
case ServerSettingsResetAction.RCONWindowExtents:
|
||||||
this.Settings.ResetRCONWindowExtents();
|
this.Settings.ResetRCONWindowExtents();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
46
src/ServerManager.Common/Model/IntegerIniValueArray.cs
Normal file
46
src/ServerManager.Common/Model/IntegerIniValueArray.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
using ServerManagerTool.Common.Interfaces;
|
||||||
|
using ServerManagerTool.Common.Utils;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace ServerManagerTool.Common.Model
|
||||||
|
{
|
||||||
|
public class IntegerIniValueArray : IniValueList<int>, IIniValuesList
|
||||||
|
{
|
||||||
|
public IntegerIniValueArray(string iniKeyName, Func<IEnumerable<int>> resetFunc) :
|
||||||
|
base(iniKeyName, resetFunc, (a, b) => a == b, m => m, ToIniValueInternal, FromIniValueInternal)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsArray => false;
|
||||||
|
|
||||||
|
private static string ToIniValueInternal(int val)
|
||||||
|
{
|
||||||
|
return val.ToString("0", CultureInfo.GetCultureInfo(StringUtils.DEFAULT_CULTURE_CODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int FromIniValueInternal(string iniVal)
|
||||||
|
{
|
||||||
|
return int.Parse(iniVal, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.GetCultureInfo(StringUtils.DEFAULT_CULTURE_CODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<string> ToIniValues(object excludeIfValue)
|
||||||
|
{
|
||||||
|
var excludeIfIntegerValue = excludeIfValue is int ? (int)excludeIfValue : int.MinValue;
|
||||||
|
|
||||||
|
var values = new List<string>();
|
||||||
|
for (var i = 0; i < this.Count; i++)
|
||||||
|
{
|
||||||
|
if (!EquivalencyFunc(this[i], excludeIfIntegerValue))
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(IniCollectionKey))
|
||||||
|
values.Add(this.ToIniValue(this[i]));
|
||||||
|
else
|
||||||
|
values.Add($"{this.IniCollectionKey}[{i}]={this.ToIniValue(this[i])}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue