source code checkin

This commit is contained in:
Brett Hewitson 2021-01-07 16:23:23 +10:00
parent 5f8fb2c825
commit 7e57b72e35
675 changed files with 168433 additions and 0 deletions

View file

@ -0,0 +1,630 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{95D4E57F-06F9-4B41-BEBB-2A8E81759BD2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ServerManagerTool</RootNamespace>
<AssemblyName>ARK Server Manager</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ExpressionBlendVersion>12.0.50716.0</ExpressionBlendVersion>
<TargetFrameworkProfile />
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<PublishUrl>publish\</PublishUrl>
<Install>false</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>false</MapFileExtensions>
<SupportUrl>http://arkservermanager.freeforums.net/thread/1194/faq-frequently-asked</SupportUrl>
<ErrorReportUrl>http://arkservermanager.freeforums.net/board/3/tech-support-bug-reports</ErrorReportUrl>
<ProductName>ARK Survival Evolved™ Server Manager</ProductName>
<PublisherName>Bletch1971</PublisherName>
<SuiteName>Server Managers</SuiteName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.1.395.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>false</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>
</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Art\favicon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>ServerManagerTool.App</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ManifestTimestampUrl>
</ManifestTimestampUrl>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetZip, Version=1.13.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.13.8\lib\net40\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="EO.Wpf, Version=4.0.12.0, Culture=neutral, PublicKeyToken=e92353a6bf73fffc, processorArchitecture=MSIL">
<HintPath>..\packages\EO.Wpf.4.0.12\lib\EO.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.8.19.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233, processorArchitecture=MSIL">
<HintPath>..\packages\TaskScheduler.2.8.19\lib\net452\Microsoft.Win32.TaskScheduler.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.7.2\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Management" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Tpl.Dataflow.4.5.24\lib\portable-net45+win8+wpa81\System.Threading.Tasks.Dataflow.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="TinyCsvParser, Version=2.5.2.0, Culture=neutral, PublicKeyToken=d7df35b038077099, processorArchitecture=MSIL">
<HintPath>..\packages\TinyCsvParser.2.5.2\lib\net45\TinyCsvParser.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Enums\LevelProgression.cs" />
<Compile Include="Enums\LogEventType.cs" />
<Compile Include="Enums\NPCSpawnContainerType.cs" />
<Compile Include="Enums\PlayerFilterType.cs" />
<Compile Include="Enums\PlayerSortType.cs" />
<Compile Include="Enums\ServerProcessStatus.cs" />
<Compile Include="Enums\ServerProcessType.cs" />
<Compile Include="Enums\ServerProfileCategory.cs" />
<Compile Include="Enums\ServerStatus.cs" />
<Compile Include="Enums\StatsMultiplier.cs" />
<Compile Include="Enums\AvailabilityStatus.cs" />
<Compile Include="Enums\WatcherServerStatus.cs" />
<Compile Include="Interface\ISpawnIniValue.cs" />
<Compile Include="Interface\ISpawnIniValuesCollection.cs" />
<Compile Include="Lib\Events\ProfileEventArgs.cs" />
<Compile Include="Lib\Model\EngramAutoUnlock.cs" />
<Compile Include="Lib\Model\StackSizeOverride.cs" />
<Compile Include="Lib\Serialization\IniFileEntryAttribute.cs" />
<Compile Include="Lib\Serialization\IniFiles.cs" />
<Compile Include="Lib\Serialization\IniSections.cs" />
<Compile Include="Lib\Serialization\SystemIniFile.cs" />
<Compile Include="Lib\Model\PlayerListParameters.cs" />
<Compile Include="Lib\ServerBranchSnapshot.cs" />
<Compile Include="Lib\ServerPlayers.cs" />
<Compile Include="Lib\ServerProfileSnapshot.cs" />
<Compile Include="Lib\ViewConverters\EnumDescriptionTypeConverter.cs" />
<Compile Include="Lib\ViewConverters\MapNameValueConverter.cs" />
<Compile Include="Lib\ViewModel\Engram.cs" />
<Compile Include="Lib\ViewModel\EngramSettings.cs" />
<Compile Include="Utils\ModUtils.cs" />
<Compile Include="Windows\AddUserWindow.xaml.cs">
<DependentUpon>AddUserWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\Model\StatsMultiplierArray.cs" />
<Compile Include="Windows\PlayerListWindow.xaml.cs">
<DependentUpon>PlayerListWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\GameDataWindow.xaml.cs">
<DependentUpon>GameDataWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\ProcessorAffinityWindow.xaml.cs">
<DependentUpon>ProcessorAffinityWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\ProfileSyncWindow.xaml.cs">
<DependentUpon>ProfileSyncWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\CustomConfigDataWindow.xaml.cs">
<DependentUpon>CustomConfigDataWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\Model\PGMTerrain.cs" />
<Compile Include="Lib\Model\NPCSpawner.cs" />
<Compile Include="Lib\ViewModel\SupplyCrate.cs" />
<Compile Include="Lib\ViewModel\NPCSpawnSettings.cs" />
<Compile Include="Lib\ViewModel\MapSpawner.cs" />
<Compile Include="Lib\ViewConverters\TributeExpirationConverter.cs" />
<Compile Include="Lib\ViewConverters\ExtinctionEventDateConverter.cs" />
<Compile Include="Lib\ViewConverters\OfficialDifficultyValueConverter.cs" />
<Compile Include="Lib\ViewConverters\ExtinctionEventTimeIntervalConverter.cs" />
<Compile Include="Lib\ViewModel\SupplyCrateSettings.cs" />
<Compile Include="Windows\PluginsWindow.xaml.cs">
<DependentUpon>PluginsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\ServerMonitorWindow.xaml.cs">
<DependentUpon>ServerMonitorWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\VersionFeedWindow.xaml.cs">
<DependentUpon>VersionFeedWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\WorldSaveRestoreWindow.xaml.cs">
<DependentUpon>WorldSaveRestoreWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\WorkshopFilesWindow.xaml.cs">
<DependentUpon>WorkshopFilesWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\ShutdownWindow.xaml.cs">
<DependentUpon>ShutdownWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\ModDetailsWindow.xaml.cs">
<DependentUpon>ModDetailsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\Model\PublishedFileDetail.cs" />
<Compile Include="Windows\ProgressWindow.xaml.cs">
<DependentUpon>ProgressWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\Model\CraftingOverride.cs" />
<Compile Include="Lib\Model\ResourceClassMultiplier.cs" />
<Compile Include="Lib\Model\SupplyCrateOverride.cs" />
<Compile Include="Lib\ViewModel\PrimalItem.cs" />
<Compile Include="Lib\ViewConverters\PrimalItemClassNameToDisplayNameConverter.cs" />
<Compile Include="Lib\ViewConverters\SupplyCrateClassNameToDisplayNameConverter.cs" />
<Compile Include="Windows\CommandLineWindow.xaml.cs">
<DependentUpon>CommandLineWindow.xaml</DependentUpon>
</Compile>
<Compile Include="ErrorHandling.cs" />
<Compile Include="Windows\GlobalSettingsControl.xaml.cs">
<DependentUpon>GlobalSettingsControl.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\Model\NPCReplacement.cs" />
<Compile Include="Lib\Model\ClassMultiplier.cs" />
<Compile Include="Lib\Model\DinoSpawn.cs" />
<Compile Include="Lib\Model\EngramEntry.cs" />
<Compile Include="Lib\GameData.cs" />
<Compile Include="Lib\Model\RCONParameters.cs" />
<Compile Include="Lib\Model\StatsMultipliers.cs" />
<Compile Include="Lib\Model\Level.cs" />
<Compile Include="Lib\Server.cs" />
<Compile Include="Lib\ServerProfile.cs" />
<Compile Include="Lib\ServerRCON.cs" />
<Compile Include="Lib\ServerApp.cs" />
<Compile Include="Lib\ServerRuntime.cs" />
<Compile Include="Lib\ViewConverters\DifficultyOffsetValueConverter.cs" />
<Compile Include="Lib\ViewModel\DinoSettings.cs" />
<Compile Include="Lib\ViewModel\DinoSettingsList.cs" />
<Compile Include="Lib\ViewConverters\EngramClassNameToDisplayNameConverter.cs" />
<Compile Include="Lib\ViewConverters\DinoNameValueConverter.cs" />
<Compile Include="Lib\ViewConverters\LevelIndexToDisplayOffsetConverter.cs" />
<Compile Include="Lib\ViewModel\PlayerInfo.cs" />
<Compile Include="Lib\ViewConverters\ResourceNameValueConverter.cs" />
<Compile Include="Windows\OpenRCONWindow.xaml.cs">
<DependentUpon>OpenRCONWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\PlayerProfileWindow.xaml.cs">
<DependentUpon>PlayerProfileWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\RCONWindow.xaml.cs">
<DependentUpon>RCONWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\ServerSettingsControl.xaml.cs">
<DependentUpon>ServerSettingsControl.xaml</DependentUpon>
</Compile>
<Compile Include="Lib\ServerStatusWatcher.cs" />
<Compile Include="Windows\TribeProfileWindow.xaml.cs">
<DependentUpon>TribeProfileWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\SettingsWindow.xaml.cs">
<DependentUpon>SettingsWindow.xaml</DependentUpon>
</Compile>
<None Include="VersionFeed.xml" />
<None Include="VersionFeedBeta.xml" />
<Resource Include="Art\Add.ico" />
<Resource Include="Art\Cancel.ico" />
<Resource Include="Art\Validate.ico" />
<Resource Include="Art\Checked.ico" />
<Resource Include="Art\Unchecked.ico" />
<Resource Include="Art\Command.ico" />
<Resource Include="Art\Copy.ico" />
<Resource Include="Art\Delete.ico" />
<Resource Include="Art\FolderDelete.ico" />
<Resource Include="Art\Down.ico" />
<Resource Include="Art\Up.ico" />
<Resource Include="Art\Drag.ico" />
<Resource Include="Art\Edit.ico" />
<Resource Include="Art\Find.ico" />
<Resource Include="Art\Help.ico" />
<Resource Include="Art\FolderOpen.ico" />
<Resource Include="Art\FolderImport.ico" />
<Resource Include="Art\Logs.ico" />
<Resource Include="Art\Paste.ico" />
<Resource Include="Art\Players.ico" />
<Resource Include="Art\Plugin.ico" />
<Resource Include="Art\Refresh.ico" />
<Resource Include="Art\Reload.ico" />
<Resource Include="Art\Save.ico" />
<Resource Include="Art\FolderExport.ico" />
<Resource Include="Art\Settings.ico" />
<Resource Include="Art\Start.ico" />
<Resource Include="Art\Stop.ico" />
<Resource Include="Art\Steam.ico" />
<Resource Include="Art\Download.ico" />
<Resource Include="Art\Website.ico" />
<Resource Include="Art\ChangeNotes.ico" />
<Resource Include="Art\Zip.ico" />
<Resource Include="Art\StatusOff.ico" />
<Resource Include="Art\StatusOn.ico" />
<Resource Include="Art\StatusStarting.ico" />
<Resource Include="Art\StatusUnknown.ico" />
<Resource Include="Art\Document.ico" />
<Resource Include="Art\Servers.ico" />
<Resource Include="Art\Shortcut.ico" />
<Resource Include="Art\Filter.ico" />
<Resource Include="Art\DropArrow.ico" />
<Content Include="Globalization\ru-RU\ru-RU.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Globalization\es-ES\es-ES.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Globalization\zh-CN\zh-CN.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Globalization\fr-FR\fr-FR.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Globalization\pt-BR\pt-BR.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Globalization\en-AU\en-AU.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="Windows\AddUserWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\PlayerListWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\GameDataWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\ProcessorAffinityWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\ProfileSyncWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\CustomConfigDataWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\PluginsWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\ServerMonitorWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\VersionFeedWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\WorldSaveRestoreWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\WorkshopFilesWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\ShutdownWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\ModDetailsWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\ProgressWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Content Include="GameData\CrystalIsles.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Installer.iss" />
<Content Include="Styles\Default.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="Windows\AutoUpdateWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Content Include="Globalization\de-DE\de-DE.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="Windows\OpenRCONWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\PlayerProfileWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\TribeProfileWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Resource Include="Art\favicon.ico" />
<Resource Include="Art\Donate.png" />
<Resource Include="Art\NoAvatar.png" />
<Content Include="Globalization\en-US\en-US.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="Windows\CommandLineWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\GlobalSettingsControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Windows\AutoUpdateWindow.xaml.cs">
<DependentUpon>AutoUpdateWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Config.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Config.settings</DependentUpon>
</Compile>
<Compile Include="Lib\ServerManager.cs" />
<Compile Include="Windows\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Windows\RCONWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\ServerSettingsControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\SettingsWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<None Include="Config.settings">
<Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Config.Designer.cs</LastGenOutput>
</None>
<Content Include="GameData\Aberration.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\PGM.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\PrimitivePlus.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\Ragnarok.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\ScorchedEarth.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\SurvivalEvolved.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\TheCenter.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\Extinction.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\Genesis.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="GameData\Valguero.gamedata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<AdditionalFiles Include="GameData\Spreadsheets\Aberration.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\Extinction.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\Genesis.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\PGM.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\PrimitivePlus.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\Ragnarok.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\ScorchedEarth.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\SurvivalEvolved.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\TheCenter.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\Valguero.xlsx" />
<AdditionalFiles Include="GameData\Spreadsheets\_Template.xlsx" />
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="DeployBetaToGithub.cmd" />
<None Include="DeployToGithub.cmd" />
<None Include="MakeLatestBetaVersionGithub.ps1" />
<None Include="MakeLatestVersionGithub.ps1" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ArkData\ArkData.csproj">
<Project>{d2ee1483-021f-4900-bbe8-88338d1386f4}</Project>
<Name>ArkData</Name>
</ProjectReference>
<ProjectReference Include="..\ARKServerManager.Common\ARKServerManager.Common.csproj">
<Project>{dd0a2401-99b8-4de1-b8ed-9b075172f8af}</Project>
<Name>ARKServerManager.Common</Name>
</ProjectReference>
<ProjectReference Include="..\NeXtVdf\NeXt.Vdf.csproj">
<Project>{e4eda8b8-006c-4d41-822f-f64b6db0021f}</Project>
<Name>NeXt.Vdf</Name>
</ProjectReference>
<ProjectReference Include="..\Plugin.Common\Plugin.Common.csproj">
<Project>{679fe859-9a82-4ffb-a758-c1e8df915f58}</Project>
<Name>Plugin.Common</Name>
</ProjectReference>
<ProjectReference Include="..\QueryMaster\QueryMaster.csproj">
<Project>{4ca9c894-518f-42d7-bbe2-cfdfe7a03f8a}</Project>
<Name>QueryMaster</Name>
</ProjectReference>
<ProjectReference Include="..\ServerManager.Common\ServerManager.Common.csproj">
<Project>{7c99d9f7-0c65-4116-927a-94eb018c88fd}</Project>
<Name>ServerManager.Common</Name>
</ProjectReference>
<ProjectReference Include="..\ServerManager.Updater\ServerManager.Updater.csproj">
<Project>{3e0c9ee6-780f-4fef-ba03-e38062a5fdb6}</Project>
<Name>ServerManager.Updater</Name>
</ProjectReference>
<ProjectReference Include="..\WPFSharp.Globalizer\WPFSharp.Globalizer.csproj">
<Project>{715461e8-4e54-4993-80a8-8e72892135e0}</Project>
<Name>WPFSharp.Globalizer</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
<Private>False</Private>
</COMReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,737 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ServerManagerTool.Common.CommonConfig" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<section name="ServerManagerTool.Config" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ServerManagerTool.Config" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<applicationSettings>
<ServerManagerTool.Config>
<setting name="SteamCmdUrl" serializeAs="String">
<value>https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip</value>
</setting>
<setting name="SteamCmdExe" serializeAs="String">
<value>SteamCMD.exe</value>
</setting>
<setting name="SteamCmdDir" serializeAs="String">
<value>SteamCMD</value>
</setting>
<setting name="SteamCmdZip" serializeAs="String">
<value>SteamCMD.zip</value>
</setting>
<setting name="SteamCmdInstallArgs" serializeAs="String">
<value>+login anonymous +quit</value>
</setting>
<setting name="SteamCmdInstallServerArgsFormat" serializeAs="String">
<value>+login anonymous +force_install_dir "{0}" "+app_update 376030 {1} {2}" +quit</value>
</setting>
<setting name="ServersInstallDir" serializeAs="String">
<value>Servers</value>
</setting>
<setting name="DefaultServerProfileName" serializeAs="String">
<value>Unnamed Profile</value>
</setting>
<setting name="DefaultServerName" serializeAs="String">
<value>Unnamed Server</value>
</setting>
<setting name="ServerBinaryRelativePath" serializeAs="String">
<value>ShooterGame\Binaries\Win64</value>
</setting>
<setting name="ServerConfigRelativePath" serializeAs="String">
<value>ShooterGame\Saved\Config\WindowsServer</value>
</setting>
<setting name="ServerExe" serializeAs="String">
<value>ShooterGameServer.exe</value>
</setting>
<setting name="ServerCommandLineArgsMatchFormat" serializeAs="String">
<value>?QueryPort={0}</value>
</setting>
<setting name="ServerCommandLineStandardArgs" serializeAs="String">
<value>-nosteamclient -game -server -log</value>
</setting>
<setting name="ProfilesDir" serializeAs="String">
<value>Profiles</value>
</setting>
<setting name="ProfileExtension" serializeAs="String">
<value>.profile</value>
</setting>
<setting name="DefaultDataDir" serializeAs="String">
<value>Ark Server Manager</value>
</setting>
<setting name="ServerProcessName" serializeAs="String">
<value>ShooterGameServer</value>
</setting>
<setting name="ServerGameUserSettingsConfigFile" serializeAs="String">
<value>GameUserSettings.ini</value>
</setting>
<setting name="IniExtension" serializeAs="String">
<value>.ini</value>
</setting>
<setting name="LoadProfileExtensionList" serializeAs="String">
<value>*.profile,*.ini</value>
</setting>
<setting name="PublicIPCheckUrl" serializeAs="String">
<value>http://whatismyip.akamai.com/</value>
</setting>
<setting name="LogsDir" serializeAs="String">
<value>Logs</value>
</setting>
<setting name="ServerCommandLineArgsIPMatchFormat" serializeAs="String">
<value>?MultiHome={0}</value>
</setting>
<setting name="LatestASMVersionUrl" serializeAs="String">
<value>https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/latest.txt</value>
</setting>
<setting name="UpdateCheckTime" serializeAs="String">
<value>1440</value>
</setting>
<setting name="SavedArksRelativePath" serializeAs="String">
<value>ShooterGame\Saved\SavedArks</value>
</setting>
<setting name="HelpUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/thread/1194/faq-frequently-asked</value>
</setting>
<setting name="SteamCmdInstallServerArgsFormat_SotF" serializeAs="String">
<value>+login anonymous +force_install_dir "{0}" "+app_update 445400 {1} {2}" +quit</value>
</setting>
<setting name="ArkSE_PatchNotesUrl" serializeAs="String">
<value>https://survivetheark.com/index.php?/forums/forum/5-changelog-patch-notes/</value>
</setting>
<setting name="ArkSotF_PatchNotesUrl" serializeAs="String">
<value>https://survivetheark.com/index.php?/forums/forum/9-changelog-patch-notes/</value>
</setting>
<setting name="ArkSEUrl" serializeAs="String">
<value>http://store.steampowered.com/app/346110/</value>
</setting>
<setting name="ArkSotfUrl" serializeAs="String">
<value>http://store.steampowered.com/app/407530/</value>
</setting>
<setting name="LastUpdatedTimeFile" serializeAs="String">
<value>LastUpdatedASM.txt</value>
</setting>
<setting name="LauncherFile" serializeAs="String">
<value>RunServer.cmd</value>
</setting>
<setting name="SteamCmdInstallModArgsFormat" serializeAs="String">
<value>+login {0} +workshop_download_item 346110 {1} +quit</value>
</setting>
<setting name="ArkSteamWorkshopFolderRelativePath" serializeAs="String">
<value>steamapps\workshop\content\346110\</value>
</setting>
<setting name="ServerModsRelativePath" serializeAs="String">
<value>ShooterGame\Content\Mods</value>
</setting>
<setting name="WebAlarmFile" serializeAs="String">
<value>AlarmPostCredentials.txt</value>
</setting>
<setting name="SavedRelativePath" serializeAs="String">
<value>ShooterGame\Saved</value>
</setting>
<setting name="WorkshopCacheFile" serializeAs="String">
<value>workshopcache_346110.json</value>
</setting>
<setting name="SteamCmd_AnonymousUsername" serializeAs="String">
<value>anonymous</value>
</setting>
<setting name="SteamCmdAuthenticateArgs" serializeAs="String">
<value>+login {0} {1} +quit</value>
</setting>
<setting name="SteamWorkshopFolderRelativePath" serializeAs="String">
<value>steamapps\workshop</value>
</setting>
<setting name="ArkSteamWorkshopFile" serializeAs="String">
<value>appworkshop_346110.acf</value>
</setting>
<setting name="SteamCmdInstallModArgsFormat_SotF" serializeAs="String">
<value>+login {0} +workshop_download_item 407530 {1} +quit</value>
</setting>
<setting name="ArkSteamWorkshopFile_SotF" serializeAs="String">
<value>appworkshop_407530.acf</value>
</setting>
<setting name="ArkSteamWorkshopFolderRelativePath_SotF" serializeAs="String">
<value>steamapps\workshop\content\407530\</value>
</setting>
<setting name="WorkshopCacheFile_SotF" serializeAs="String">
<value>workshopcache_407530.json</value>
</setting>
<setting name="AppId" serializeAs="String">
<value>346110</value>
</setting>
<setting name="AppId_SotF" serializeAs="String">
<value>407530</value>
</setting>
<setting name="AppIdServer" serializeAs="String">
<value>376030</value>
</setting>
<setting name="AppIdServer_SotF" serializeAs="String">
<value>445400</value>
</setting>
<setting name="ServerAppIdFile" serializeAs="String">
<value>steam_appid.txt</value>
</setting>
<setting name="ClustersDir" serializeAs="String">
<value>Clusters</value>
</setting>
<setting name="LatestASMBetaVersionUrl" serializeAs="String">
<value>https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/beta/latest.txt</value>
</setting>
<setting name="LatestASMBetaDownloadUrl" serializeAs="String">
<value>https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/beta/latest.zip</value>
</setting>
<setting name="LatestASMDownloadUrl" serializeAs="String">
<value>https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/latest.zip</value>
</setting>
<setting name="LatestASMPatchNotesUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/thread/5193/downloads</value>
</setting>
<setting name="LatestASMBetaPatchNotesUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/board/11/beta-testers</value>
</setting>
<setting name="ArkWhitelistFile" serializeAs="String">
<value>PlayersJoinNoCheckList.txt</value>
</setting>
<setting name="ArkAdminFile" serializeAs="String">
<value>AllowedCheaterSteamIDs.txt</value>
</setting>
<setting name="ArkExclusiveFile" serializeAs="String">
<value>PlayersExclusiveJoinList.txt</value>
</setting>
<setting name="DefaultServerFolderName" serializeAs="String">
<value>Server</value>
</setting>
<setting name="ServerStatusUrlFormat" serializeAs="String">
<value />
</setting>
<setting name="DefaultServerMap_PGM" serializeAs="String">
<value>PGARK</value>
</setting>
<setting name="SavedPGMRelativePath" serializeAs="String">
<value>PGArks</value>
</setting>
<setting name="DefaultPGMapName" serializeAs="String">
<value>AsmPGArk</value>
</setting>
<setting name="BackupDir" serializeAs="String">
<value>_backup_</value>
</setting>
<setting name="ServerGameConfigFile" serializeAs="String">
<value>Game.ini</value>
</setting>
<setting name="SteamAPIKeyUrl" serializeAs="String">
<value>https://steamcommunity.com/dev/apikey</value>
</setting>
<setting name="SteamWebAPIKeyHelpUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/thread/3024/get-own-steam-web-api</value>
</setting>
<setting name="BackupServerExtension" serializeAs="String">
<value>.asmbak</value>
</setting>
<setting name="ScheduledTasksCheckTime" serializeAs="String">
<value>1</value>
</setting>
<setting name="ASMPluginUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/board/22/plugins</value>
</setting>
<setting name="PlayerFileExtension" serializeAs="String">
<value>.arkprofile</value>
</setting>
<setting name="TribeFileExtension" serializeAs="String">
<value>.arktribe</value>
</setting>
<setting name="BackupExtension" serializeAs="String">
<value>.zip</value>
</setting>
<setting name="MapExtension" serializeAs="String">
<value>.ark</value>
</setting>
<setting name="UpdaterPrefix" serializeAs="String">
<value>ASM_</value>
</setting>
<setting name="UpdaterFile" serializeAs="String">
<value>ServerManagerUpdater.exe</value>
</setting>
<setting name="PlayerImageFileExtension" serializeAs="String">
<value>.png</value>
</setting>
<setting name="ServerManagerCode" serializeAs="String">
<value>ED89B8FA-0E0B-46CC-A90B-595E69AE9A7E</value>
</setting>
<setting name="GameDataDir" serializeAs="String">
<value>GameData</value>
</setting>
<setting name="GameDataExtension" serializeAs="String">
<value>.gamedata</value>
</setting>
<setting name="FirewallRulePrefix" serializeAs="String">
<value>ARK Server:</value>
</setting>
<setting name="DonationUrl" serializeAs="String">
<value>https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=bletch1971%40hotmail%2ecom&amp;lc=US&amp;item_name=Server%20Manager&amp;currency_code=USD&amp;bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted</value>
</setting>
<setting name="GameDataApplication" serializeAs="String">
<value>ark</value>
</setting>
<setting name="TributeTribeFileExtension" serializeAs="String">
<value>.arktributetribe</value>
</setting>
<setting name="SendMessageDelay" serializeAs="String">
<value>5000</value>
</setting>
<setting name="ServerManagerVersionFeedUrl" serializeAs="String">
<value>https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/VersionFeed.xml</value>
</setting>
<setting name="ServerManagerVersionBetaFeedUrl" serializeAs="String">
<value>https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/beta/VersionFeed.xml</value>
</setting>
<setting name="DefaultServerBranchName" serializeAs="String">
<value>live</value>
</setting>
<setting name="SteamCmdInstallServerBetaNameArgsFormat" serializeAs="String">
<value>-beta {0}</value>
</setting>
<setting name="SteamCmdInstallServerBetaPasswordArgsFormat" serializeAs="String">
<value>-betapassword {0}</value>
</setting>
<setting name="ServerBranchFolderPrefix" serializeAs="String">
<value>__</value>
</setting>
<setting name="ArkSteamManifestFile" serializeAs="String">
<value>appmanifest_376030.acf</value>
</setting>
<setting name="ArkSteamManifestFile_SotF" serializeAs="String">
<value>appmanifest_407530.acf</value>
</setting>
<setting name="SteamManifestFolderRelativePath" serializeAs="String">
<value>steamapps</value>
</setting>
<setting name="DefaultGlobalizationFile" serializeAs="String">
<value>Globalization\en-US\en-US.xaml</value>
</setting>
<setting name="ServerShutdownCommand" serializeAs="String">
<value>doexit</value>
</setting>
<setting name="ServerSaveCommand" serializeAs="String">
<value>saveworld</value>
</setting>
<setting name="DefaultStyleFile" serializeAs="String">
<value>Styles\Default.xaml</value>
</setting>
<setting name="ScheduledTaskFolder" serializeAs="String">
<value>ArkServerManager</value>
</setting>
<setting name="GameDataUrl" serializeAs="String">
<value>http://arkservermanager.freeforums.net/board/25/game-data</value>
</setting>
<setting name="ServerStatusWatcher_LocalStatusQueryDelay" serializeAs="String">
<value>15000</value>
</setting>
<setting name="ServerStatusWatcher_RemoteStatusQueryDelay" serializeAs="String">
<value>120000</value>
</setting>
<setting name="ServerEngineConfigFile" serializeAs="String">
<value>Engine.ini</value>
</setting>
</ServerManagerTool.Config>
<ServerManagerTool.Common.CommonConfig>
<setting name="DefaultSteamAPIKey" serializeAs="String">
<value>41A37E30FCC6A3BBF573E9BFA693DBD9</value>
</setting>
</ServerManagerTool.Common.CommonConfig>
</applicationSettings>
<userSettings>
<ServerManagerTool.Config>
<setting name="ConfigDirectory" serializeAs="String">
<value />
</setting>
<setting name="DataDir" serializeAs="String">
<value />
</setting>
<setting name="MachinePublicIP" serializeAs="String">
<value />
</setting>
<setting name="ManageFirewallAutomatically" serializeAs="String">
<value>True</value>
</setting>
<setting name="UpgradeConfig" serializeAs="String">
<value>True</value>
</setting>
<setting name="RCON_PlayerListSort" serializeAs="String">
<value>1</value>
</setting>
<setting name="RCON_PlayerListFilter" serializeAs="String">
<value>2</value>
</setting>
<setting name="RCON_AdminName" serializeAs="String">
<value />
</setting>
<setting name="OpenRCON_ServerIP" serializeAs="String">
<value />
</setting>
<setting name="OpenRCON_RCONPort" serializeAs="String">
<value>32330</value>
</setting>
<setting name="CultureName" serializeAs="String">
<value>en-US</value>
</setting>
<setting name="SectionAdministrationIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionAutomaticManagementIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionRulesIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionChatAndNotificationsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionHUDAndVisualsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionPlayerSettingsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionDinoSettingsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionEnvironmentIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionStructuresIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionEngramsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionCustomLevelsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionSOTFIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="CustomLevelXPIncrease_Player" serializeAs="String">
<value>1000</value>
</setting>
<setting name="CustomLevelXPIncrease_Dino" serializeAs="String">
<value>1000</value>
</setting>
<setting name="RunAsAdministratorPrompt" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_EnableUpdate" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoUpdate_UpdatePeriod" serializeAs="String">
<value>60</value>
</setting>
<setting name="ServerShutdown_GracePeriod" serializeAs="String">
<value>15</value>
</setting>
<setting name="ServerShutdown_GraceMessage1" serializeAs="String">
<value>Server shutdown required. Server will shutdown in {minutes} minutes. Please logout before shutdown to prevent character corruption.</value>
</setting>
<setting name="ServerShutdown_GraceMessage2" serializeAs="String">
<value>Server shutdown required. Server will shutdown in 1 minute. Please logout before shutdown to prevent character corruption.</value>
</setting>
<setting name="ServerShutdown_GraceMessage3" serializeAs="String">
<value>Server shutdown required. Server is shutting down now.</value>
</setting>
<setting name="ServerShutdown_WorldSaveMessage" serializeAs="String">
<value>Server shutdown required. Server is about to shutdown, performing a world save.</value>
</setting>
<setting name="ServerShutdown_EnableWorldSave" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_CacheDir" serializeAs="String">
<value />
</setting>
<setting name="ServerUpdate_UpdateModsWhenUpdatingServer" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerUpdate_ForceUpdateMods" serializeAs="String">
<value>False</value>
</setting>
<setting name="ServerUpdate_ForceCopyMods" serializeAs="String">
<value>False</value>
</setting>
<setting name="SteamCmdRedirectOutput" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoUpdate_UseSmartCopy" serializeAs="String">
<value>True</value>
</setting>
<setting name="StyleName" serializeAs="String">
<value />
</setting>
<setting name="Email_Host" serializeAs="String">
<value />
</setting>
<setting name="Email_Port" serializeAs="String">
<value>25</value>
</setting>
<setting name="Email_UseSSL" serializeAs="String">
<value>False</value>
</setting>
<setting name="Email_UseDetaultCredentials" serializeAs="String">
<value>False</value>
</setting>
<setting name="Email_Username" serializeAs="String">
<value />
</setting>
<setting name="Email_Password" serializeAs="String">
<value />
</setting>
<setting name="Email_From" serializeAs="String">
<value />
</setting>
<setting name="Email_To" serializeAs="String">
<value />
</setting>
<setting name="EmailNotify_AutoUpdate" serializeAs="String">
<value>False</value>
</setting>
<setting name="EmailNotify_AutoRestart" serializeAs="String">
<value>False</value>
</setting>
<setting name="SteamCmd_Username" serializeAs="String">
<value />
</setting>
<setting name="SteamCmd_UseAnonymousCredentials" serializeAs="String">
<value>True</value>
</setting>
<setting name="SteamCmd_Password" serializeAs="String">
<value />
</setting>
<setting name="ValidateProfileOnServerStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="SectionCustomGameUserSettingsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionCustomGameSettingsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="ServerUpdate_OnServerStart" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionServerFilesIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="EmailNotify_ShutdownRestart" serializeAs="String">
<value>False</value>
</setting>
<setting name="WorkshopCache_ExpiredHours" serializeAs="String">
<value>168</value>
</setting>
<setting name="SectionPGMIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionMapSpawnerOverridesIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="ServerShutdown_CancelMessage" serializeAs="String">
<value>Server shutdown has been cancelled.</value>
</setting>
<setting name="SectionCraftingOverridesIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionSupplyCrateOverridesIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SteamAPIKey" serializeAs="String">
<value />
</setting>
<setting name="ServerUpdate_ForceUpdateModsIfNoSteamInfo" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoBackup_EnableBackup" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoBackup_BackupPeriod" serializeAs="String">
<value>60</value>
</setting>
<setting name="EmailNotify_AutoBackup" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoBackup_DeleteOldFiles" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoBackup_DeleteInterval" serializeAs="String">
<value>30</value>
</setting>
<setting name="ServerBackup_WorldSaveMessage" serializeAs="String">
<value>A world save is about to be performed, you may experience some lag during this process. Please be patient.</value>
</setting>
<setting name="AutoUpdate_RetryOnFail" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoUpdate_ShowUpdateReason" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_ValidateServerFiles" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_OverrideServerStartup" serializeAs="String">
<value>False</value>
</setting>
<setting name="ASMUniqueKey" serializeAs="String">
<value />
</setting>
<setting name="SectionSupplyCrateOverridesEnabled" serializeAs="String">
<value>True</value>
</setting>
<setting name="SectionCraftingOverridesEnabled" serializeAs="String">
<value>True</value>
</setting>
<setting name="SectionMapSpawnerOverridesEnabled" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_ParallelUpdate" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_UpdateReasonPrefix" serializeAs="String">
<value>Server Update Reason:</value>
</setting>
<setting name="Alert_ServerStopMessage" serializeAs="String">
<value>The server is stopping.</value>
</setting>
<setting name="Alert_ServerShutdownMessage" serializeAs="String">
<value>The server is shutting down.</value>
</setting>
<setting name="Alert_ServerStartedMessage" serializeAs="String">
<value>The server is starting.</value>
</setting>
<setting name="Alert_BackupProcessError" serializeAs="String">
<value>The server backup process was performed but an error occurred.</value>
</setting>
<setting name="Alert_ShutdownProcessError" serializeAs="String">
<value>The server shutdown process was performed but an error occurred.</value>
</setting>
<setting name="Alert_RestartProcessError" serializeAs="String">
<value>The server restart process was performed but an error occurred.</value>
</setting>
<setting name="Alert_UpdateProcessError" serializeAs="String">
<value>The server update process was performed but an error occurred.</value>
</setting>
<setting name="Alert_ModUpdateDetected" serializeAs="String">
<value>Mod updates have been detected:</value>
</setting>
<setting name="ServerShutdown_WorldSaveDelay" serializeAs="String">
<value>60</value>
</setting>
<setting name="ServerShutdown_UseShutdownCommand" serializeAs="String">
<value>True</value>
</setting>
<setting name="Alert_ServerStatusChange" serializeAs="String">
<value>Server Status:</value>
</setting>
<setting name="Alert_ServerUpdate" serializeAs="String">
<value>Game Server Update</value>
</setting>
<setting name="Alert_UpdateResults" serializeAs="String">
<value>Update performed, includes:</value>
</setting>
<setting name="Alert_ForceRespawnDinos" serializeAs="String">
<value>A wild dino wipe is scheduled after the server starts and may delay login until it is complete. Please be patient.</value>
</setting>
<setting name="BackupPath" serializeAs="String">
<value />
</setting>
<setting name="ServerShutdown_AllMessagesShowReason" serializeAs="String">
<value>False</value>
</setting>
<setting name="CloseShutdownWindowWhenFinished" serializeAs="String">
<value>True</value>
</setting>
<setting name="PlayerListFilter" serializeAs="String">
<value>63</value>
</setting>
<setting name="PlayerListSort" serializeAs="String">
<value>1</value>
</setting>
<setting name="SectionPGMEnabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionSOTFEnabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="ServerStatus_EnableActions" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerStatus_ShowActionConfirmation" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_SequencialDelayPeriod" serializeAs="String">
<value>0</value>
</setting>
<setting name="SectionStackSizeOverridesEnabled" serializeAs="String">
<value>True</value>
</setting>
<setting name="SectionStackSizeOverridesIsExpanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="BackupWorldFile" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoUpdate_VerifyServerAfterUpdate" serializeAs="String">
<value>False</value>
</setting>
<setting name="MainWindow_Width" serializeAs="String">
<value>1100</value>
</setting>
<setting name="MainWindow_Height" serializeAs="String">
<value>900</value>
</setting>
<setting name="ServerMonitorWindow_Width" serializeAs="String">
<value>900</value>
</setting>
<setting name="ServerMonitorWindow_Height" serializeAs="String">
<value>500</value>
</setting>
<setting name="UpdateDirectoryPermissions" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerShutdown_CheckForOnlinePlayers" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerShutdown_SendShutdownMessages" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoRestart_EnabledGracePeriod" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoRestart_GracePeriod" serializeAs="String">
<value>0</value>
</setting>
<setting name="MainWindow_MinimizeToTray" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionCustomEngineSettingsIsExpanded" serializeAs="String">
<value>False</value>
</setting>
<setting name="SectionCustomEngineSettingsEnabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="ServerMonitorMessageOutput_Height" serializeAs="String">
<value>100</value>
</setting>
<setting name="Alert_ServerStartedMessageIncludeIPandPort" serializeAs="String">
<value>True</value>
</setting>
<setting name="ManagePublicIPAutomatically" serializeAs="String">
<value>True</value>
</setting>
</ServerManagerTool.Config>
</userSettings>
</configuration>

View file

@ -0,0 +1,7 @@
<globalizer:GlobalizedApplication
x:Class="ServerManagerTool.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:globalizer="clr-namespace:WPFSharp.Globalizer;assembly=WPFSharp.Globalizer"
StartupUri="Windows/AutoUpdateWindow.xaml">
</globalizer:GlobalizedApplication>

View file

@ -0,0 +1,550 @@
using ArkData;
using Microsoft.WindowsAPICodePack.Dialogs;
using NLog;
using NLog.Config;
using NLog.Targets;
using ServerManagerTool.Common;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Enums;
using ServerManagerTool.Lib;
using ServerManagerTool.Plugin.Common;
using ServerManagerTool.Windows;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows;
using System.Xml;
using WPFSharp.Globalizer;
namespace ServerManagerTool
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : GlobalizedApplication, INotifyPropertyChanged
{
public new static App Instance
{
get;
private set;
}
public event PropertyChangedEventHandler PropertyChanged;
private GlobalizedApplication _globalizer;
private bool _applicationStarted;
private string _args;
private bool _betaVersion;
private string _title;
private string _version;
public App()
{
if (string.IsNullOrWhiteSpace(Config.Default.ASMUniqueKey))
Config.Default.ASMUniqueKey = Guid.NewGuid().ToString();
App.Instance = this;
ApplicationStarted = false;
Args = string.Empty;
BetaVersion = false;
Title = string.Empty;
Version = AppUtils.GetDeployedVersion(Assembly.GetEntryAssembly());
AppDomain.CurrentDomain.UnhandledException += ErrorHandling.CurrentDomain_UnhandledException;
MigrateSettings();
ReconfigureLogging();
}
public bool ApplicationStarted
{
get
{
return _applicationStarted;
}
set
{
if (!Equals(value, _applicationStarted))
{
_applicationStarted = value;
OnPropertyChanged();
}
}
}
public string Args
{
get
{
return _args;
}
set
{
if (!Equals(value, _args))
{
_args = value;
OnPropertyChanged();
}
}
}
public bool BetaVersion
{
get
{
return _betaVersion;
}
set
{
if (!Equals(value, _betaVersion))
{
_betaVersion = value;
OnPropertyChanged();
}
}
}
public string Title
{
get
{
return _title;
}
set
{
if (!Equals(value, _title))
{
_title = value;
OnPropertyChanged();
}
}
}
public string Version
{
get
{
return _version;
}
set
{
if (!Equals(value, _version))
{
_version = value;
OnPropertyChanged();
}
}
}
public static void DiscoverMachinePublicIP(bool forceOverride)
{
if (forceOverride || string.IsNullOrWhiteSpace(Config.Default.MachinePublicIP))
{
var publicIP = NetworkUtils.DiscoverPublicIP();
if (string.IsNullOrWhiteSpace(publicIP))
return;
if (!Config.Default.MachinePublicIP.Equals(publicIP, StringComparison.OrdinalIgnoreCase))
{
Config.Default.MachinePublicIP = publicIP;
}
}
}
public static async Task DiscoverMachinePublicIPAsync(bool forceOverride)
{
if (forceOverride || string.IsNullOrWhiteSpace(Config.Default.MachinePublicIP))
{
var publicIP = await NetworkUtils.DiscoverPublicIPAsync();
if (string.IsNullOrWhiteSpace(publicIP))
return;
if (!Config.Default.MachinePublicIP.Equals(publicIP, StringComparison.OrdinalIgnoreCase))
{
await App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
Config.Default.MachinePublicIP = publicIP;
}));
}
}
}
private IList<Plugin.Common.Lib.Profile> FetchProfiles()
{
return ServerManager.Instance.Servers.Select(s => new ServerManagerTool.Plugin.Common.Lib.Profile() { ProfileName = s?.Profile?.ProfileName ?? string.Empty, InstallationFolder = s?.Profile?.InstallDirectory ?? string.Empty }).ToList();
}
public static string GetLogFolder() => IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.LogsDir));
public static string GetProfileLogFolder(string profileId) => IOUtils.NormalizePath(Path.Combine(Config.Default.DataDir, Config.Default.LogsDir, profileId.ToLower()));
public static Logger GetProfileLogger(string profileId, string name, LogLevel minLevel, LogLevel maxLevel)
{
if (string.IsNullOrWhiteSpace(profileId) || string.IsNullOrWhiteSpace(name))
return null;
var loggerName = $"{profileId.ToLower()}_{name}".Replace(" ", "_");
if (LogManager.Configuration.FindTargetByName(loggerName) == null)
{
var logFilePath = GetProfileLogFolder(profileId);
if (!System.IO.Directory.Exists(logFilePath))
System.IO.Directory.CreateDirectory(logFilePath);
var logFile = new FileTarget(loggerName)
{
FileName = Path.Combine(logFilePath, $"{name}.log"),
Layout = "${time} ${message}",
ArchiveFileName = Path.Combine(logFilePath, $"{name}.{{#}}.log"),
ArchiveNumbering = ArchiveNumberingMode.DateAndSequence,
ArchiveEvery = FileArchivePeriod.Day,
ArchiveDateFormat = "yyyyMMdd"
};
LogManager.Configuration.AddTarget(loggerName, logFile);
var rule = new LoggingRule(loggerName, minLevel, maxLevel, logFile);
LogManager.Configuration.LoggingRules.Add(rule);
LogManager.ReconfigExistingLoggers();
}
return LogManager.GetLogger(loggerName);
}
private static void MigrateSettings()
{
var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
//
// Migrate settings when we update.
//
if (CommonConfig.Default.UpgradeConfig)
{
var settingsFile = IOUtils.NormalizePath(Path.Combine(installFolder, "commonconfig.json"));
CommonConfig.Default.Upgrade();
CommonConfig.Default.Reload();
SettingsUtils.MigrateSettings(CommonConfig.Default, settingsFile);
CommonConfig.Default.UpgradeConfig = false;
CommonConfig.Default.Save();
}
if (Config.Default.UpgradeConfig)
{
var settingsFile = IOUtils.NormalizePath(Path.Combine(installFolder, "userconfig.json"));
Config.Default.Upgrade();
Config.Default.Reload();
SettingsUtils.MigrateSettings(Config.Default, settingsFile);
Config.Default.UpgradeConfig = false;
Config.Default.Save();
if (string.IsNullOrWhiteSpace(CommonConfig.Default.SteamAPIKey))
{
CommonConfig.Default.SteamAPIKey = Config.Default.SteamAPIKey;
CommonConfig.Default.Save();
}
}
Config.Default.SteamCmdRedirectOutput = false;
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
_globalizer = GlobalizedApplication.Instance;
try
{
if (!string.IsNullOrWhiteSpace(Config.Default.CultureName))
_globalizer.GlobalizationManager.SwitchLanguage(Config.Default.CultureName, true);
}
catch (Exception ex)
{
// just output the exception message, it should default back to the fallback language.
Debug.WriteLine(ex.Message);
}
try
{
if (!string.IsNullOrWhiteSpace(Config.Default.StyleName))
_globalizer.StyleManager.SwitchStyle(Config.Default.StyleName, true);
}
catch (Exception ex)
{
// just output the exception message, it should default back to the fallback style.
Debug.WriteLine(ex.Message);
}
TaskSchedulerUtils.TaskFolder = Config.Default.ScheduledTaskFolder;
Args = string.Join(" ", e.Args);
// check if we are starting server manager in BETA/TEST mode
if (e.Args.Any(a => a.Equals(Constants.ARG_BETA, StringComparison.OrdinalIgnoreCase) || a.Equals(Constants.ARG_TEST, StringComparison.OrdinalIgnoreCase)))
{
BetaVersion = true;
}
// check if we need to set the title
if (e.Args.Any(a => a.Equals(Constants.ARG_TITLE, StringComparison.OrdinalIgnoreCase)))
{
for (int i = 0; i < e.Args.Length - 1; i++)
{
if (e.Args[i].Equals(Constants.ARG_TITLE, StringComparison.OrdinalIgnoreCase) && i < e.Args.Length - 1 && !e.Args[i + 1].StartsWith("-"))
{
Title = e.Args[i + 1].Trim();
}
}
}
// check and update the public IP address
DiscoverMachinePublicIP(Config.Default.ManagePublicIPAutomatically);
var installPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
PluginHelper.Instance.BetaEnabled = this.BetaVersion;
PluginHelper.Instance.LoadPlugins(installPath, true);
PluginHelper.Instance.SetFetchProfileCallback(FetchProfiles);
// check if we are starting ASM for the old server restart - no longer supported
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTORESTART, StringComparison.OrdinalIgnoreCase)))
{
// just exit
Environment.Exit(0);
}
// check if we are starting ASM for server shutdown
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN1, StringComparison.OrdinalIgnoreCase)))
{
var arg = e.Args.FirstOrDefault(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN1, StringComparison.OrdinalIgnoreCase));
var exitCode = ServerApp.PerformAutoShutdown(arg, ServerProcessType.AutoShutdown1);
// once we are finished, just exit
Environment.Exit(exitCode);
}
// check if we are starting ASM for server shutdown
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN2, StringComparison.OrdinalIgnoreCase)))
{
var arg = e.Args.FirstOrDefault(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN2, StringComparison.OrdinalIgnoreCase));
var exitCode = ServerApp.PerformAutoShutdown(arg, ServerProcessType.AutoShutdown2);
// once we are finished, just exit
Environment.Exit(exitCode);
}
// check if we are starting ASM for server updating
if (e.Args.Any(a => a.Equals(Constants.ARG_AUTOUPDATE, StringComparison.OrdinalIgnoreCase)))
{
var exitCode = ServerApp.PerformAutoUpdate();
// once we are finished, just exit
Environment.Exit(exitCode);
}
// check if we are starting ASM for server backups
if (e.Args.Any(a => a.Equals(Constants.ARG_AUTOBACKUP, StringComparison.OrdinalIgnoreCase)))
{
var exitCode = ServerApp.PerformAutoBackup();
// once we are finished, just exit
Environment.Exit(exitCode);
}
if (Config.Default.RunAsAdministratorPrompt && !SecurityUtils.IsAdministrator())
{
var result = MessageBox.Show(_globalizer.GetResourceString("Application_RunAsAdministratorLabel"), _globalizer.GetResourceString("Application_RunAsAdministratorTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
var processInfo = new ProcessStartInfo(Assembly.GetExecutingAssembly().CodeBase)
{
// The following properties run the new process as administrator
UseShellExecute = true,
Verb = "runas",
Arguments = string.Join(" ", e.Args)
};
// Start the new process
try
{
Process.Start(processInfo);
// Shut down the current process
Application.Current.Shutdown(0);
return;
}
catch (Exception)
{
// The user did not allow the application to run as administrator
MessageBox.Show(_globalizer.GetResourceString("Application_RunAsAdministrator_FailedLabel"), _globalizer.GetResourceString("Application_RunAsAdministrator_FailedTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
// check if application is already running
if (ProcessUtils.IsAlreadyRunning())
{
var result = MessageBox.Show(_globalizer.GetResourceString("Application_SingleInstanceLabel"), _globalizer.GetResourceString("Application_SingleInstanceTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
if (ProcessUtils.SwitchToCurrentInstance())
{
// Shut down the current process
Application.Current.Shutdown(0);
return;
}
MessageBox.Show(_globalizer.GetResourceString("Application_SingleInstance_FailedLabel"), _globalizer.GetResourceString("Application_SingleInstance_FailedTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
}
ApplicationStarted = true;
// Initial configuration setting
if (String.IsNullOrWhiteSpace(Config.Default.DataDir))
{
MessageBox.Show(_globalizer.GetResourceString("Application_DataDirectoryLabel"), _globalizer.GetResourceString("Application_DataDirectoryTitle"), MessageBoxButton.OK, MessageBoxImage.Information);
var installationFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
if (!installationFolder.EndsWith(@"\"))
installationFolder += @"\";
while (String.IsNullOrWhiteSpace(Config.Default.DataDir))
{
var dialog = new CommonOpenFileDialog
{
EnsureFileExists = true,
IsFolderPicker = true,
Multiselect = false,
Title = _globalizer.GetResourceString("Application_DataDirectory_DialogTitle"),
InitialDirectory = installationFolder
};
if (dialog.ShowDialog() != CommonFileDialogResult.Ok)
{
Environment.Exit(0);
}
MessageBoxResult confirm = MessageBoxResult.Cancel;
// check if the folder is under the installation folder
var newDataFolder = dialog.FileName;
if (!newDataFolder.EndsWith(@"\"))
newDataFolder += @"\";
if (newDataFolder.StartsWith(installationFolder))
{
confirm = MessageBoxResult.No;
MessageBox.Show(_globalizer.GetResourceString("Application_DataDirectory_WithinInstallFolderErrorLabel"), _globalizer.GetResourceString("Application_DataDirectory_WithinInstallFolderErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
else
{
confirm = MessageBox.Show(String.Format(_globalizer.GetResourceString("Application_DataDirectory_ConfirmLabel"), Path.Combine(newDataFolder, Config.Default.ProfilesDir), Path.Combine(newDataFolder, Config.Default.SteamCmdDir)), _globalizer.GetResourceString("Application_DataDirectory_ConfirmTitle"), MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
}
if (confirm == MessageBoxResult.Cancel)
{
Environment.Exit(0);
}
else if (confirm == MessageBoxResult.Yes)
{
if (newDataFolder.EndsWith(@"\"))
newDataFolder = newDataFolder.Substring(0, newDataFolder.Length -1);
Config.Default.DataDir = newDataFolder;
ReconfigureLogging();
break;
}
}
}
Config.Default.ConfigDirectory = Path.Combine(Config.Default.DataDir, Config.Default.ProfilesDir);
System.IO.Directory.CreateDirectory(Config.Default.ConfigDirectory);
Config.Default.Save();
CommonConfig.Default.Save();
DataFileDetails.PlayerFileExtension = Config.Default.PlayerFileExtension;
DataFileDetails.TribeFileExtension = Config.Default.TribeFileExtension;
if (e.Args.Any(a => a.StartsWith(Constants.ARG_SERVERMONITOR, StringComparison.OrdinalIgnoreCase)))
{
ServerRuntime.EnableUpdateModStatus = false;
ServerProfile.EnableServerFilesWatcher = false;
StartupUri = new Uri("Windows/ServerMonitorWindow.xaml", UriKind.RelativeOrAbsolute);
}
else
{
// initialize all the game data
GameData.Initialize();
StartupUri = new Uri("Windows/AutoUpdateWindow.xaml", UriKind.RelativeOrAbsolute);
}
}
protected override void OnExit(ExitEventArgs e)
{
ShutDownApplication();
base.OnExit(e);
}
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public static void ReconfigureLogging()
{
string logDir = Path.Combine(Config.Default.DataDir, Config.Default.LogsDir);
if (!System.IO.Directory.Exists(logDir))
System.IO.Directory.CreateDirectory(logDir);
LogManager.Configuration.Variables["logDir"] = logDir;
var fileTargets = LogManager.Configuration.AllTargets.OfType<FileTarget>();
foreach (var fileTarget in fileTargets)
{
var fileName = Path.GetFileNameWithoutExtension(fileTarget.FileName.ToString());
fileTarget.FileName = Path.Combine(logDir, $"{fileName}.log");
fileTarget.ArchiveFileName = Path.Combine(logDir, $"{fileName}.{{#}}.log");
}
LogManager.ReconfigExistingLoggers();
}
private void ShutDownApplication()
{
if (ApplicationStarted)
{
foreach (var server in ServerManager.Instance.Servers)
{
try
{
server.Profile.Save(false, false, null);
}
catch (Exception ex)
{
MessageBox.Show(String.Format(_globalizer.GetResourceString("Application_Profile_SaveFailedLabel"), server.Profile.ProfileName, ex.Message, ex.StackTrace), _globalizer.GetResourceString("Application_Profile_SaveFailedTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
}
Config.Default.Save();
CommonConfig.Default.Save();
}
PluginHelper.Instance?.Dispose();
ApplicationStarted = false;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

2534
src/ARKServerManager/Config.Designer.cs generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,711 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ServerManagerTool" GeneratedClassName="Config">
<Profiles />
<Settings>
<Setting Name="SteamCmdUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip</Value>
</Setting>
<Setting Name="SteamCmdExe" Type="System.String" Scope="Application">
<Value Profile="(Default)">SteamCMD.exe</Value>
</Setting>
<Setting Name="SteamCmdDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">SteamCMD</Value>
</Setting>
<Setting Name="SteamCmdZip" Type="System.String" Scope="Application">
<Value Profile="(Default)">SteamCMD.zip</Value>
</Setting>
<Setting Name="SteamCmdInstallArgs" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login anonymous +quit</Value>
</Setting>
<Setting Name="ConfigDirectory" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SteamCmdInstallServerArgsFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login anonymous +force_install_dir "{0}" "+app_update 376030 {1} {2}" +quit</Value>
</Setting>
<Setting Name="ServersInstallDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">Servers</Value>
</Setting>
<Setting Name="DefaultServerProfileName" Type="System.String" Scope="Application">
<Value Profile="(Default)">Unnamed Profile</Value>
</Setting>
<Setting Name="DefaultServerName" Type="System.String" Scope="Application">
<Value Profile="(Default)">Unnamed Server</Value>
</Setting>
<Setting Name="ServerBinaryRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGame\Binaries\Win64</Value>
</Setting>
<Setting Name="ServerConfigRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGame\Saved\Config\WindowsServer</Value>
</Setting>
<Setting Name="ServerExe" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGameServer.exe</Value>
</Setting>
<Setting Name="ServerCommandLineArgsMatchFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">?QueryPort={0}</Value>
</Setting>
<Setting Name="ServerCommandLineStandardArgs" Type="System.String" Scope="Application">
<Value Profile="(Default)">-nosteamclient -game -server -log</Value>
</Setting>
<Setting Name="ProfilesDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">Profiles</Value>
</Setting>
<Setting Name="ProfileExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.profile</Value>
</Setting>
<Setting Name="DataDir" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="DefaultDataDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">Ark Server Manager</Value>
</Setting>
<Setting Name="ServerProcessName" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGameServer</Value>
</Setting>
<Setting Name="ServerGameUserSettingsConfigFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">GameUserSettings.ini</Value>
</Setting>
<Setting Name="IniExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.ini</Value>
</Setting>
<Setting Name="LoadProfileExtensionList" Type="System.String" Scope="Application">
<Value Profile="(Default)">*.profile,*.ini</Value>
</Setting>
<Setting Name="MachinePublicIP" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="PublicIPCheckUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://whatismyip.akamai.com/</Value>
</Setting>
<Setting Name="ManageFirewallAutomatically" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="LogsDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">Logs</Value>
</Setting>
<Setting Name="ServerCommandLineArgsIPMatchFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">?MultiHome={0}</Value>
</Setting>
<Setting Name="LatestASMVersionUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/latest.txt</Value>
</Setting>
<Setting Name="UpdateCheckTime" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">1440</Value>
</Setting>
<Setting Name="SavedArksRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGame\Saved\SavedArks</Value>
</Setting>
<Setting Name="UpgradeConfig" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="RCON_PlayerListSort" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="RCON_PlayerListFilter" Type="System.Int32" Scope="User">
<Value Profile="(Default)">2</Value>
</Setting>
<Setting Name="RCON_AdminName" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="HelpUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/thread/1194/faq-frequently-asked</Value>
</Setting>
<Setting Name="OpenRCON_ServerIP" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="OpenRCON_RCONPort" Type="System.Int32" Scope="User">
<Value Profile="(Default)">32330</Value>
</Setting>
<Setting Name="CultureName" Type="System.String" Scope="User">
<Value Profile="(Default)">en-US</Value>
</Setting>
<Setting Name="SectionAdministrationIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionAutomaticManagementIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionRulesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionChatAndNotificationsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionHUDAndVisualsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionPlayerSettingsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionDinoSettingsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionEnvironmentIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionStructuresIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionEngramsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionCustomLevelsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionSOTFIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="CustomLevelXPIncrease_Player" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1000</Value>
</Setting>
<Setting Name="CustomLevelXPIncrease_Dino" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1000</Value>
</Setting>
<Setting Name="SteamCmdInstallServerArgsFormat_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login anonymous +force_install_dir "{0}" "+app_update 445400 {1} {2}" +quit</Value>
</Setting>
<Setting Name="ArkSE_PatchNotesUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://survivetheark.com/index.php?/forums/forum/5-changelog-patch-notes/</Value>
</Setting>
<Setting Name="ArkSotF_PatchNotesUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://survivetheark.com/index.php?/forums/forum/9-changelog-patch-notes/</Value>
</Setting>
<Setting Name="ArkSEUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://store.steampowered.com/app/346110/</Value>
</Setting>
<Setting Name="ArkSotfUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://store.steampowered.com/app/407530/</Value>
</Setting>
<Setting Name="RunAsAdministratorPrompt" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoUpdate_EnableUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoUpdate_UpdatePeriod" Type="System.Int32" Scope="User">
<Value Profile="(Default)">60</Value>
</Setting>
<Setting Name="ServerShutdown_GracePeriod" Type="System.Int32" Scope="User">
<Value Profile="(Default)">15</Value>
</Setting>
<Setting Name="ServerShutdown_GraceMessage1" Type="System.String" Scope="User">
<Value Profile="(Default)">Server shutdown required. Server will shutdown in {minutes} minutes. Please logout before shutdown to prevent character corruption.</Value>
</Setting>
<Setting Name="ServerShutdown_GraceMessage2" Type="System.String" Scope="User">
<Value Profile="(Default)">Server shutdown required. Server will shutdown in 1 minute. Please logout before shutdown to prevent character corruption.</Value>
</Setting>
<Setting Name="ServerShutdown_GraceMessage3" Type="System.String" Scope="User">
<Value Profile="(Default)">Server shutdown required. Server is shutting down now.</Value>
</Setting>
<Setting Name="LastUpdatedTimeFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">LastUpdatedASM.txt</Value>
</Setting>
<Setting Name="ServerShutdown_WorldSaveMessage" Type="System.String" Scope="User">
<Value Profile="(Default)">Server shutdown required. Server is about to shutdown, performing a world save.</Value>
</Setting>
<Setting Name="ServerShutdown_EnableWorldSave" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="LauncherFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">RunServer.cmd</Value>
</Setting>
<Setting Name="SteamCmdInstallModArgsFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login {0} +workshop_download_item 346110 {1} +quit</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFolderRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps\workshop\content\346110\</Value>
</Setting>
<Setting Name="ServerModsRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGame\Content\Mods</Value>
</Setting>
<Setting Name="AutoUpdate_CacheDir" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="ServerUpdate_UpdateModsWhenUpdatingServer" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ServerUpdate_ForceUpdateMods" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ServerUpdate_ForceCopyMods" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="WebAlarmFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">AlarmPostCredentials.txt</Value>
</Setting>
<Setting Name="SavedRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">ShooterGame\Saved</Value>
</Setting>
<Setting Name="SteamCmdRedirectOutput" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoUpdate_UseSmartCopy" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="StyleName" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="WorkshopCacheFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">workshopcache_346110.json</Value>
</Setting>
<Setting Name="Email_Host" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Email_Port" Type="System.Int32" Scope="User">
<Value Profile="(Default)">25</Value>
</Setting>
<Setting Name="Email_UseSSL" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Email_UseDetaultCredentials" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Email_Username" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Email_Password" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Email_From" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Email_To" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="EmailNotify_AutoUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="EmailNotify_AutoRestart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SteamCmd_Username" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SteamCmd_AnonymousUsername" Type="System.String" Scope="Application">
<Value Profile="(Default)">anonymous</Value>
</Setting>
<Setting Name="SteamCmd_UseAnonymousCredentials" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SteamCmdAuthenticateArgs" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login {0} {1} +quit</Value>
</Setting>
<Setting Name="SteamWorkshopFolderRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps\workshop</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">appworkshop_346110.acf</Value>
</Setting>
<Setting Name="SteamCmd_Password" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="ValidateProfileOnServerStart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SectionCustomGameUserSettingsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionCustomGameSettingsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ServerUpdate_OnServerStart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SteamCmdInstallModArgsFormat_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">+login {0} +workshop_download_item 407530 {1} +quit</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFile_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">appworkshop_407530.acf</Value>
</Setting>
<Setting Name="ArkSteamWorkshopFolderRelativePath_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps\workshop\content\407530\</Value>
</Setting>
<Setting Name="WorkshopCacheFile_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">workshopcache_407530.json</Value>
</Setting>
<Setting Name="AppId" Type="System.String" Scope="Application">
<Value Profile="(Default)">346110</Value>
</Setting>
<Setting Name="AppId_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">407530</Value>
</Setting>
<Setting Name="AppIdServer" Type="System.String" Scope="Application">
<Value Profile="(Default)">376030</Value>
</Setting>
<Setting Name="AppIdServer_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">445400</Value>
</Setting>
<Setting Name="ServerAppIdFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">steam_appid.txt</Value>
</Setting>
<Setting Name="ClustersDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">Clusters</Value>
</Setting>
<Setting Name="LatestASMBetaVersionUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/beta/latest.txt</Value>
</Setting>
<Setting Name="LatestASMBetaDownloadUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/beta/latest.zip</Value>
</Setting>
<Setting Name="LatestASMDownloadUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/latest.zip</Value>
</Setting>
<Setting Name="LatestASMPatchNotesUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/thread/5193/downloads</Value>
</Setting>
<Setting Name="LatestASMBetaPatchNotesUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/board/11/beta-testers</Value>
</Setting>
<Setting Name="ArkWhitelistFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">PlayersJoinNoCheckList.txt</Value>
</Setting>
<Setting Name="ArkAdminFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">AllowedCheaterSteamIDs.txt</Value>
</Setting>
<Setting Name="SectionServerFilesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ArkExclusiveFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">PlayersExclusiveJoinList.txt</Value>
</Setting>
<Setting Name="EmailNotify_ShutdownRestart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="WorkshopCache_ExpiredHours" Type="System.Int32" Scope="User">
<Value Profile="(Default)">168</Value>
</Setting>
<Setting Name="DefaultServerFolderName" Type="System.String" Scope="Application">
<Value Profile="(Default)">Server</Value>
</Setting>
<Setting Name="ServerStatusUrlFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="DefaultServerMap_PGM" Type="System.String" Scope="Application">
<Value Profile="(Default)">PGARK</Value>
</Setting>
<Setting Name="SavedPGMRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">PGArks</Value>
</Setting>
<Setting Name="DefaultPGMapName" Type="System.String" Scope="Application">
<Value Profile="(Default)">AsmPGArk</Value>
</Setting>
<Setting Name="SectionPGMIsExpanded" Type="System.String" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="BackupDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">_backup_</Value>
</Setting>
<Setting Name="ServerGameConfigFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">Game.ini</Value>
</Setting>
<Setting Name="SectionMapSpawnerOverridesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ServerShutdown_CancelMessage" Type="System.String" Scope="User">
<Value Profile="(Default)">Server shutdown has been cancelled.</Value>
</Setting>
<Setting Name="SectionCraftingOverridesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionSupplyCrateOverridesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SteamAPIKey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SteamAPIKeyUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://steamcommunity.com/dev/apikey</Value>
</Setting>
<Setting Name="ServerUpdate_ForceUpdateModsIfNoSteamInfo" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoBackup_EnableBackup" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoBackup_BackupPeriod" Type="System.Int32" Scope="User">
<Value Profile="(Default)">60</Value>
</Setting>
<Setting Name="EmailNotify_AutoBackup" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoBackup_DeleteOldFiles" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoBackup_DeleteInterval" Type="System.Int32" Scope="User">
<Value Profile="(Default)">30</Value>
</Setting>
<Setting Name="ServerBackup_WorldSaveMessage" Type="System.String" Scope="User">
<Value Profile="(Default)">A world save is about to be performed, you may experience some lag during this process. Please be patient.</Value>
</Setting>
<Setting Name="AutoUpdate_RetryOnFail" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SteamWebAPIKeyHelpUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/thread/3024/get-own-steam-web-api</Value>
</Setting>
<Setting Name="AutoUpdate_ShowUpdateReason" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="BackupServerExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.asmbak</Value>
</Setting>
<Setting Name="ScheduledTasksCheckTime" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="AutoUpdate_ValidateServerFiles" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoUpdate_OverrideServerStartup" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ASMUniqueKey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SectionSupplyCrateOverridesEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SectionCraftingOverridesEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SectionMapSpawnerOverridesEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoUpdate_ParallelUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoUpdate_UpdateReasonPrefix" Type="System.String" Scope="User">
<Value Profile="(Default)">Server Update Reason:</Value>
</Setting>
<Setting Name="Alert_ServerStopMessage" Type="System.String" Scope="User">
<Value Profile="(Default)">The server is stopping.</Value>
</Setting>
<Setting Name="Alert_ServerShutdownMessage" Type="System.String" Scope="User">
<Value Profile="(Default)">The server is shutting down.</Value>
</Setting>
<Setting Name="Alert_ServerStartedMessage" Type="System.String" Scope="User">
<Value Profile="(Default)">The server is starting.</Value>
</Setting>
<Setting Name="Alert_BackupProcessError" Type="System.String" Scope="User">
<Value Profile="(Default)">The server backup process was performed but an error occurred.</Value>
</Setting>
<Setting Name="Alert_ShutdownProcessError" Type="System.String" Scope="User">
<Value Profile="(Default)">The server shutdown process was performed but an error occurred.</Value>
</Setting>
<Setting Name="Alert_RestartProcessError" Type="System.String" Scope="User">
<Value Profile="(Default)">The server restart process was performed but an error occurred.</Value>
</Setting>
<Setting Name="Alert_UpdateProcessError" Type="System.String" Scope="User">
<Value Profile="(Default)">The server update process was performed but an error occurred.</Value>
</Setting>
<Setting Name="Alert_ModUpdateDetected" Type="System.String" Scope="User">
<Value Profile="(Default)">Mod updates have been detected:</Value>
</Setting>
<Setting Name="ASMPluginUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/board/22/plugins</Value>
</Setting>
<Setting Name="PlayerFileExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.arkprofile</Value>
</Setting>
<Setting Name="TribeFileExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.arktribe</Value>
</Setting>
<Setting Name="BackupExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.zip</Value>
</Setting>
<Setting Name="MapExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.ark</Value>
</Setting>
<Setting Name="UpdaterPrefix" Type="System.String" Scope="Application">
<Value Profile="(Default)">ASM_</Value>
</Setting>
<Setting Name="UpdaterFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">ServerManagerUpdater.exe</Value>
</Setting>
<Setting Name="PlayerImageFileExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.png</Value>
</Setting>
<Setting Name="ServerShutdown_WorldSaveDelay" Type="System.Int32" Scope="User">
<Value Profile="(Default)">60</Value>
</Setting>
<Setting Name="ServerShutdown_UseShutdownCommand" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Alert_ServerStatusChange" Type="System.String" Scope="User">
<Value Profile="(Default)">Server Status:</Value>
</Setting>
<Setting Name="Alert_ServerUpdate" Type="System.String" Scope="User">
<Value Profile="(Default)">Game Server Update</Value>
</Setting>
<Setting Name="Alert_UpdateResults" Type="System.String" Scope="User">
<Value Profile="(Default)">Update performed, includes:</Value>
</Setting>
<Setting Name="Alert_ForceRespawnDinos" Type="System.String" Scope="User">
<Value Profile="(Default)">A wild dino wipe is scheduled after the server starts and may delay login until it is complete. Please be patient.</Value>
</Setting>
<Setting Name="ServerManagerCode" Type="System.String" Scope="Application">
<Value Profile="(Default)">ED89B8FA-0E0B-46CC-A90B-595E69AE9A7E</Value>
</Setting>
<Setting Name="BackupPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="ServerShutdown_AllMessagesShowReason" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="GameDataDir" Type="System.String" Scope="Application">
<Value Profile="(Default)">GameData</Value>
</Setting>
<Setting Name="GameDataExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.gamedata</Value>
</Setting>
<Setting Name="FirewallRulePrefix" Type="System.String" Scope="Application">
<Value Profile="(Default)">ARK Server:</Value>
</Setting>
<Setting Name="DonationUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=bletch1971%40hotmail%2ecom&amp;lc=US&amp;item_name=Server%20Manager&amp;currency_code=USD&amp;bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted</Value>
</Setting>
<Setting Name="GameDataApplication" Type="System.String" Scope="Application">
<Value Profile="(Default)">ark</Value>
</Setting>
<Setting Name="TributeTribeFileExtension" Type="System.String" Scope="Application">
<Value Profile="(Default)">.arktributetribe</Value>
</Setting>
<Setting Name="SendMessageDelay" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">5000</Value>
</Setting>
<Setting Name="CloseShutdownWindowWhenFinished" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="PlayerListFilter" Type="System.Int32" Scope="User">
<Value Profile="(Default)">63</Value>
</Setting>
<Setting Name="PlayerListSort" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="ServerManagerVersionFeedUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/VersionFeed.xml</Value>
</Setting>
<Setting Name="ServerManagerVersionBetaFeedUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://raw.githubusercontent.com/Bletch1971/ServerManagers/master/ASM/beta/VersionFeed.xml</Value>
</Setting>
<Setting Name="DefaultServerBranchName" Type="System.String" Scope="Application">
<Value Profile="(Default)">live</Value>
</Setting>
<Setting Name="SteamCmdInstallServerBetaNameArgsFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">-beta {0}</Value>
</Setting>
<Setting Name="SteamCmdInstallServerBetaPasswordArgsFormat" Type="System.String" Scope="Application">
<Value Profile="(Default)">-betapassword {0}</Value>
</Setting>
<Setting Name="ServerBranchFolderPrefix" Type="System.String" Scope="Application">
<Value Profile="(Default)">__</Value>
</Setting>
<Setting Name="ArkSteamManifestFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">appmanifest_376030.acf</Value>
</Setting>
<Setting Name="ArkSteamManifestFile_SotF" Type="System.String" Scope="Application">
<Value Profile="(Default)">appmanifest_407530.acf</Value>
</Setting>
<Setting Name="SteamManifestFolderRelativePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">steamapps</Value>
</Setting>
<Setting Name="SectionPGMEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionSOTFEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="DefaultGlobalizationFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">Globalization\en-US\en-US.xaml</Value>
</Setting>
<Setting Name="ServerShutdownCommand" Type="System.String" Scope="Application">
<Value Profile="(Default)">doexit</Value>
</Setting>
<Setting Name="ServerSaveCommand" Type="System.String" Scope="Application">
<Value Profile="(Default)">saveworld</Value>
</Setting>
<Setting Name="ServerStatus_EnableActions" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ServerStatus_ShowActionConfirmation" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="DefaultStyleFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">Styles\Default.xaml</Value>
</Setting>
<Setting Name="ScheduledTaskFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">ArkServerManager</Value>
</Setting>
<Setting Name="AutoUpdate_SequencialDelayPeriod" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="SectionStackSizeOverridesEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SectionStackSizeOverridesIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="BackupWorldFile" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoUpdate_VerifyServerAfterUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="GameDataUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://arkservermanager.freeforums.net/board/25/game-data</Value>
</Setting>
<Setting Name="MainWindow_Width" Type="System.Double" Scope="User">
<Value Profile="(Default)">1100</Value>
</Setting>
<Setting Name="MainWindow_Height" Type="System.Double" Scope="User">
<Value Profile="(Default)">900</Value>
</Setting>
<Setting Name="ServerMonitorWindow_Width" Type="System.Double" Scope="User">
<Value Profile="(Default)">900</Value>
</Setting>
<Setting Name="ServerMonitorWindow_Height" Type="System.Double" Scope="User">
<Value Profile="(Default)">500</Value>
</Setting>
<Setting Name="UpdateDirectoryPermissions" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ServerShutdown_CheckForOnlinePlayers" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ServerShutdown_SendShutdownMessages" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoRestart_EnabledGracePeriod" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoRestart_GracePeriod" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="ServerStatusWatcher_LocalStatusQueryDelay" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">15000</Value>
</Setting>
<Setting Name="ServerStatusWatcher_RemoteStatusQueryDelay" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">120000</Value>
</Setting>
<Setting Name="MainWindow_MinimizeToTray" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ServerEngineConfigFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">Engine.ini</Value>
</Setting>
<Setting Name="SectionCustomEngineSettingsIsExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SectionCustomEngineSettingsEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ServerMonitorMessageOutput_Height" Type="System.Double" Scope="User">
<Value Profile="(Default)">100</Value>
</Setting>
<Setting Name="Alert_ServerStartedMessageIncludeIPandPort" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ManagePublicIPAutomatically" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -0,0 +1,11 @@
namespace ServerManagerTool.Enums
{
public enum AvailabilityStatus
{
Unknown,
NeedPublicIP,
Unavailable,
WaitingForPublication,
Available
}
}

View file

@ -0,0 +1,8 @@
namespace ServerManagerTool.Enums
{
public enum LevelProgression
{
Player,
Dino
};
}

View file

@ -0,0 +1,9 @@
namespace ServerManagerTool.Enums
{
public enum LogEventType
{
All,
Chat,
Event
}
}

View file

@ -0,0 +1,12 @@
using System.ComponentModel;
namespace ServerManagerTool.Enums
{
[DefaultValue(Override)]
public enum NPCSpawnContainerType
{
Add = 1,
Subtract,
Override,
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace ServerManagerTool.Enums
{
[Flags]
public enum PlayerFilterType
{
None = 0,
Offline = 0x1,
Online = 0x2,
Whitelisted = 0x8,
Invalid = 0x10,
Admin = 0x20,
}
}

View file

@ -0,0 +1,10 @@
namespace ServerManagerTool.Enums
{
public enum PlayerSortType
{
Online = 0,
Name = 1,
Tribe = 2,
LastUpdated = 3,
}
}

View file

@ -0,0 +1,25 @@
namespace ServerManagerTool.Enums
{
public enum ServerProcessStatus
{
/// <summary>
/// The server binary could not be found
/// </summary>
NotInstalled,
/// <summary>
/// The server binary was found, but the process was not.
/// </summary>
Stopped,
/// <summary>
/// The server binary was found, the process was found, but no permissions to access the process.
/// </summary>
Unknown,
/// <summary>
/// The server process was found
/// </summary>
Running,
}
}

View file

@ -0,0 +1,14 @@
namespace ServerManagerTool.Enums
{
public enum ServerProcessType
{
Unknown = 0,
AutoBackup,
AutoUpdate,
AutoShutdown1,
AutoShutdown2,
Backup,
Shutdown,
Restart,
}
}

View file

@ -0,0 +1,28 @@
namespace ServerManagerTool.Enums
{
public enum ServerProfileCategory
{
Unknown,
Administration,
AutomaticManagement,
Rules,
ChatAndNotifications,
HudAndVisuals,
Players,
Dinos,
Environment,
Structures,
Engrams,
ServerFiles,
CustomGameUserSettings,
CustomGameSettings,
CustomEngineSettings,
CustomLevels,
MapSpawnerOverrides,
CraftingOverrides,
SupplyCrateOverrides,
StackSizeOverrides,
PGM,
SOTF,
}
}

View file

@ -0,0 +1,13 @@
namespace ServerManagerTool.Enums
{
public enum ServerStatus
{
Unknown,
Stopping,
Stopped,
Initializing,
Running,
Updating,
Uninstalled
}
}

View file

@ -0,0 +1,18 @@
namespace ServerManagerTool.Enums
{
public enum StatsMultiplier
{
Health = 0,
Stamina = 1,
Torpidity = 2,
Oxygen = 3,
Food = 4,
Water = 5,
Temperature = 6,
Weight = 7,
Melee = 8,
Speed = 9,
Fortitude = 10,
Crafting = 11
};
}

View file

@ -0,0 +1,40 @@
namespace ServerManagerTool.Enums
{
public enum WatcherServerStatus
{
/// <summary>
/// The server binary couldnot be found.
/// </summary>
NotInstalled,
/// <summary>
/// The server binary was found, but the process was not
/// </summary>
Stopped,
/// <summary>
/// The server binary was found, the process was found, but no permissions to access the process.
/// </summary>
Unknown,
/// <summary>
/// The server process was found, but the server is not responding on its port
/// </summary>
Initializing,
/// <summary>
/// The server is responding locally on its port, a local check was made
/// </summary>
RunningLocalCheck,
/// <summary>
/// The server is responding locally on its port, a public check was made
/// </summary>
RunningExternalCheck,
/// <summary>
/// The server is responding externally on its port
/// </summary>
Published,
}
}

View file

@ -0,0 +1,117 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Lib;
namespace ServerManagerTool
{
public static class ErrorHandling
{
public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
// Oops! Bad news everyone - the app is going down!
// Write out a log file with all the details so users can send us the info...
var file = Path.GetTempFileName();
var crashFile = file + ".dmp";
try
{
MiniDumpToFile(crashFile);
}
catch { }
try
{
var details = new StringBuilder();
details.AppendLine("ARK Server Manager Crash Report");
details.AppendLine("Please report this crash to the Ark Server Manager forums - http://arkservermanager.freeforums.net");
details.AppendLine();
details.AppendLine($"Assembly: {Assembly.GetExecutingAssembly()}");
details.AppendLine($"Version: {App.Instance.Version}");
details.AppendLine($"IsAdministrator: {SecurityUtils.IsAdministrator()}");
details.AppendLine();
details.AppendLine($"Windows Platform: {Environment.OSVersion.Platform}");
details.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
details.AppendLine();
details.AppendLine($"Crash Dump: {crashFile}");
details.AppendLine();
var exception = e.ExceptionObject as Exception;
if (exception != null)
{
details.AppendLine("Exception Message:");
details.AppendLine(exception.Message);
details.AppendLine();
details.AppendLine("Stack Trace:");
details.AppendLine(exception.StackTrace);
}
File.WriteAllText(file, details.ToString());
var message = new StringBuilder();
message.AppendLine("OOPS! ARK Server Manager has suffered from an internal error and must shut down, this is probably a bug and should be reported. The error files are:");
message.AppendLine($"Error File: {file}");
message.AppendLine($"Crash Dump: {crashFile}");
details.AppendLine();
details.AppendLine();
message.AppendLine("Please report this crash to the Ark Server Manager forums - http://arkservermanager.freeforums.net");
message.AppendLine("The crash log will now be opened in notepad.");
var result = MessageBox.Show(message.ToString(), "ARK Server Manager crashed", MessageBoxButton.OK, MessageBoxImage.Exclamation);
if (result == MessageBoxResult.OK)
{
Process.Start("notepad.exe", file);
}
}
catch (Exception ex)
{
try
{
File.WriteAllText(file, $"Exception trying to write exception: {ex.Message}\r\nStacktrace: {ex.StackTrace}");
}
catch { }
}
}
internal enum MinidumpType
{
MiniDumpNormal = 0x00000000,
MiniDumpWithDataSegs = 0x00000001,
MiniDumpWithFullMemory = 0x00000002,
MiniDumpWithHandleData = 0x00000004,
MiniDumpFilterMemory = 0x00000008,
MiniDumpScanMemory = 0x00000010,
MiniDumpWithUnloadedModules = 0x00000020,
MiniDumpWithIndirectlyReferencedMemory = 0x00000040,
MiniDumpFilterModulePaths = 0x00000080,
MiniDumpWithProcessThreadData = 0x00000100,
MiniDumpWithPrivateReadWriteMemory = 0x00000200,
MiniDumpWithoutOptionalData = 0x00000400,
MiniDumpWithFullMemoryInfo = 0x00000800,
MiniDumpWithThreadInfo = 0x00001000,
MiniDumpWithCodeSegs = 0x00002000
}
[DllImport("dbghelp.dll")]
static extern bool MiniDumpWriteDump(IntPtr hProcess, Int32 ProcessId, IntPtr hFile, MinidumpType DumpType, IntPtr ExceptionParam, IntPtr UserStreamParam, IntPtr CallackParam);
public static void MiniDumpToFile(String fileToDump)
{
var fsToDump = File.Create(fileToDump);
Process thisProcess = Process.GetCurrentProcess();
MiniDumpWriteDump(thisProcess.Handle, thisProcess.Id, fsToDump.SafeFileHandle.DangerousGetHandle(), MinidumpType.MiniDumpWithFullMemory, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
fsToDump.Close();
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,23 @@
{
"Application": "ark",
"Version": "1.0.0",
"Created": "2020-06-11T00:00:00.0000000Z",
"Creatures": [
],
"Engrams": [
],
"Items": [
],
"MapSpawners": [
],
"SupplyCrates": [
],
"GameMaps": [
{
"IsSotF": false,
"ClassName": "CrystalIsles",
"Description": "Crystal Isles",
"Mod": "CrystalIsles"
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,23 @@
{
"Application": "ark",
"Version": "1.1.0",
"Created": "2020-02-25T00:00:00.0000000Z",
"Creatures": [
],
"Engrams": [
],
"Items": [
],
"MapSpawners": [
],
"SupplyCrates": [
],
"GameMaps": [
{
"IsSotF": false,
"ClassName": "Genesis",
"Description": "Genesis",
"Mod": "Genesis"
}
]
}

View file

@ -0,0 +1,77 @@
{
"Application": "ark",
"Version": "1.0.0",
"Created": "2018-04-21T11:00:00.0000000Z",
"MapSpawners": [
{
"ClassName": "DinoSpawnEntries_Deepwater_PGM_C",
"Description": "Deepwater",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntries_InlandWater_PGM_C",
"Description": "InlandWater",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntries_Ocean_PGM_C",
"Description": "Ocean",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntries_TheDeepwater_PGM_C",
"Description": "TheDeepwater",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntries_TheOcean_PGM_C",
"Description": "TheOcean",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesBeach_PGM_C",
"Description": "Beach",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesGrassland_PGM_C",
"Description": "Grassland",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesJungle_PGM_C",
"Description": "Jungle",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesMountain_PGM_C",
"Description": "Mountain",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesRedwoodsPGM_C",
"Description": "Redwoods",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesSnow_PGM_C",
"Description": "Snow",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesSnowMountain_PGM_C",
"Description": "SnowMountain",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesSnowShoreline_PGM_C",
"Description": "SnowShoreline",
"Mod": "PGM"
},
{
"ClassName": "DinoSpawnEntriesSwamp_PGM_C",
"Description": "Swamp",
"Mod": "PGM"
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,260 @@
{
"Application": "ark",
"Version": "1.1.0",
"Created": "2020-05-20T00:00:00.0000000Z",
"Creatures": [
{
"NameTag": "Griffin",
"IsSpawnable": true,
"IsTameable": "True",
"ClassName": "Griffin_Character_BP_C",
"Description": "Griffin",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": true,
"IsTameable": "True",
"ClassName": "Polar_Bear_C",
"Description": "Polar Bear",
"Mod": "Ragnarok"
},
{
"NameTag": "Ice Wyvern",
"IsSpawnable": true,
"IsTameable": "ByBreeding",
"ClassName": "Ragnarok_Wyvern_Override_Ice_C",
"Description": "Ice Wyvern",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": true,
"IsTameable": "False",
"ClassName": "Iceworm_Character_Minion_BP_smaller_C",
"Description": "Iceworm",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Iceworm_Queen_Character_BP_C",
"Description": "Iceworm Queen",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "LavaGolem_Character_BP_C",
"Description": "Lava Golem",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Dragon_Character_BP_Boss_Easy_Ragnarok_C",
"Description": "Dragon (Easy Variant)",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Dragon_Character_BP_Boss_Medium_Ragnarok_C",
"Description": "Dragon (Medium Variant)",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Dragon_Character_BP_Boss_Hard_Ragnarok_C",
"Description": "Dragon (Hard Variant)",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Manticore_Character_BP_Easy_Ragnarok_C",
"Description": "Manticore (Easy Variant)",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Manticore_Character_BP_Medium_Ragnarok_C",
"Description": "Manticore (Medium Variant)",
"Mod": "Ragnarok"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Manticore_Character_BP_Hard_Ragnarok_C",
"Description": "Manticore (Hard Variant)",
"Mod": "Ragnarok"
}
],
"MapSpawners": [
{
"ClassName": "DinoSpawnEntries_Ragnarok_Bear_C",
"Description": "Bear",
"Mod": "Ragnarok"
},
{
"ClassName": "SE_DinoSpawnEntriesOasis_C",
"Description": "Oasis",
"Mod": "Ragnarok"
},
{
"ClassName": "SE_DinoSpawnEntriesGreenDesert_C",
"Description": "GreenDesert",
"Mod": "Ragnarok"
},
{
"ClassName": "SE_DinoSpawnEntriesDunes_C",
"Description": "Dunes",
"Mod": "Ragnarok"
},
{
"ClassName": "SE_DinoSpawnEntriesBadlands_C",
"Description": "Badlands",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntriesSwamp_C",
"Description": "swamp",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntriesSnow_C",
"Description": "snow",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntriesRedwoods_C",
"Description": "Redwoods",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntriesBeach_C",
"Description": "Beach",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Castle_C",
"Description": "Castle",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Center_C",
"Description": "Center",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_CenterWater_C",
"Description": "CenterWater",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_DeepWater_C",
"Description": "DeepWater",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Golem_C",
"Description": "Golem",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Griffin_C",
"Description": "Griffin",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Iceworm_C",
"Description": "Iceworm",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Jerboa_C",
"Description": "Jerboa",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Jungle_C",
"Description": "Jungle",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_MonkeyIsland_C",
"Description": "MonkeyIsland",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Mudslide_C",
"Description": "Mudslide",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Ocean_C",
"Description": "Ocean",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_PolarBear_C",
"Description": "PolarBear",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_Scotland_C",
"Description": "Scotland",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_SnowForest_C",
"Description": "SnowForest",
"Mod": "Ragnarok"
},
{
"ClassName": "DinoSpawnEntries_Ragnarok_SnowPlains_C",
"Description": "SnowPlains",
"Mod": "Ragnarok"
}
],
"SupplyCrates": [
{
"ClassName": "SupplyCreate_OceanInstant_High_C",
"Description": "Deep Sea Loot Crate",
"Mod": "Ragnarok"
},
{
"ClassName": "SupplyCrate_Chest_Treasure_JacksonL_C_C",
"Description": "Treasure Chest",
"Mod": "Ragnarok"
},
{
"ClassName": "SupplyCrateBaseBP_Instantaneous_DamLogs_Child_C",
"Description": "Large Beaver Dam",
"Mod": "Ragnarok"
},
{
"ClassName": "SupplyCrateBaseBP_Instantaneous_DenLogs_Child2_C",
"Description": "Beaver Den",
"Mod": "Ragnarok"
}
],
"GameMaps": [
{
"IsSotF": false,
"ClassName": "Ragnarok",
"Description": "Ragnarok",
"Mod": "Ragnarok"
}
]
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,187 @@
{
"Application": "ark",
"Version": "1.0.0",
"Created": "2018-04-21T11:00:00.0000000Z",
"Creatures": [
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "SpiderL_Character_BP_TheCenter_C",
"Description": "Broodmother Lysrix (Easy Variant)",
"Mod": "TheCenter"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "SpiderL_Character_BP_TheCenterMedium_C",
"Description": "Broodmother Lysrix (Medium Variant)",
"Mod": "TheCenter"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "SpiderL_Character_BP_TheCenterHard_C",
"Description": "Broodmother Lysrix (Hard Variant)",
"Mod": "TheCenter"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Gorilla_Character_BP_TheCenter_C",
"Description": "Megapithecus (Easy Variant)",
"Mod": "TheCenter"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Gorilla_Character_BP_TheCenter_Medium_C",
"Description": "Megapithecus (Medium Variant)",
"Mod": "TheCenter"
},
{
"NameTag": null,
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Gorilla_Character_BP_TheCenter_Hard_C",
"Description": "Megapithecus (Hard Variant)",
"Mod": "TheCenter"
}
],
"MapSpawners": [
{
"ClassName": "CustomAnglerSpawner_C",
"Description": "Angler",
"Mod": "TheCenter"
},
{
"ClassName": "CustomPenguinSpawner_C",
"Description": "Penguin",
"Mod": "TheCenter"
},
{
"ClassName": "DunkEurSpawn_C",
"Description": "DunkEur",
"Mod": "TheCenter"
},
{
"ClassName": "GrasslandsUnderArea_WaterSpawn_C",
"Description": "GrasslandsUnderArea_Water",
"Mod": "TheCenter"
},
{
"ClassName": "IceCave_Spawner_C",
"Description": "IceCave",
"Mod": "TheCenter"
},
{
"ClassName": "IceCaveWater_Spawner_C",
"Description": "IceCaveWater",
"Mod": "TheCenter"
},
{
"ClassName": "Lava_Spawn_C",
"Description": "Lava",
"Mod": "TheCenter"
},
{
"ClassName": "Lava_Upper_Spawn_C",
"Description": "Lava_Upper",
"Mod": "TheCenter"
},
{
"ClassName": "LavaBeach_Spawn_C",
"Description": "LavaBeach",
"Mod": "TheCenter"
},
{
"ClassName": "LavaWater_Spawn_C",
"Description": "LavaWater",
"Mod": "TheCenter"
},
{
"ClassName": "MiniCaveBearSpawner_C",
"Description": "MiniCaveBear",
"Mod": "TheCenter"
},
{
"ClassName": "SnowGrasslands_Spawn_C",
"Description": "SnowGrasslands",
"Mod": "TheCenter"
},
{
"ClassName": "SnowGrasslandsUnderArea_Spawn_C",
"Description": "SnowGrasslandsUnderArea",
"Mod": "TheCenter"
},
{
"ClassName": "SnowyLake_Mosa_C",
"Description": "SnowyLake_Mosa",
"Mod": "TheCenter"
},
{
"ClassName": "SnowyMountain_Spawn_C",
"Description": "SnowyMountain",
"Mod": "TheCenter"
},
{
"ClassName": "SpiderCaveSpawner_C",
"Description": "SpiderCave",
"Mod": "TheCenter"
},
{
"ClassName": "UnderwaterCaveSpawn_C",
"Description": "UnderwaterCave",
"Mod": "TheCenter"
},
{
"ClassName": "DinoSpawnEntries_OceanUnderworld_C",
"Description": "OceanUnderworld",
"Mod": "TheCenter"
}
],
"Inventories": [
{
"ClassName": "DinoDropInventoryComponent_BossSpider_TheCenter_C",
"Description": "Boss Inventory - Broodmother (Easy)",
"Mod": "TheCenter"
},
{
"ClassName": "DinoDropInventoryComponent_BossSpider_TheCenter_Medium_C",
"Description": "Boss Inventory - Broodmother (Medium)",
"Mod": "TheCenter"
},
{
"ClassName": "DinoDropInventoryComponent_BossSpider_TheCenter_Hard_C",
"Description": "Boss Inventory - Broodmother (Hard)",
"Mod": "TheCenter"
},
{
"ClassName": "DinoDropInventoryComponent_BossGorilla_TheCenter_C",
"Description": "Boss Inventory - Megapithecus (Easy)",
"Mod": "TheCenter"
},
{
"ClassName": "DinoDropInventoryComponent_BossGorilla_TheCenter_Medium_C",
"Description": "Boss Inventory - Megapithecus (Medium)",
"Mod": "TheCenter"
},
{
"ClassName": "DinoDropInventoryComponent_BossGorilla_TheCenter_Hard_C",
"Description": "Boss Inventory - Megapithecus (Hard)",
"Mod": "TheCenter"
}
],
"GameMaps": [
{
"IsSotF": false,
"ClassName": "TheCenter",
"Description": "The Center",
"Mod": "TheCenter"
}
]
}

View file

@ -0,0 +1,317 @@
{
"Application": "ark",
"Version": "1.2.0",
"Created": "2020-12-03T00:00:00.0000000Z",
"Creatures": [
{
"NameTag": "Deinonychus",
"IsSpawnable": true,
"IsTameable": "ByBreeding",
"ClassName": "Deinonychus_Character_BP_C",
"Description": "Deinonychus",
"Mod": "Valguero"
},
{
"NameTag": "ChalkRockElemental",
"IsSpawnable": true,
"IsTameable": "True",
"ClassName": "ChalkGolem_Character_BP_C",
"Description": "Chalk Golem",
"Mod": "Valguero"
},
{
"NameTag": "IceRockElemental",
"IsSpawnable": true,
"IsTameable": "True",
"ClassName": "IceGolem_Character_BP_C",
"Description": "Ice Golem",
"Mod": "Valguero"
},
{
"NameTag": "BroodmotherLysrix",
"IsSpawnable": true,
"IsTameable": "False",
"ClassName": "SpiderL_VAL_Character_BP_C",
"Description": "Broodmother Lysrix",
"Mod": "Valguero"
},
{
"NameTag": "Megapithecus",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Gorilla_Character_BP_Easy_C",
"Description": "Megapithecus (Easy Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Megapithecus",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Gorilla_Character_BP_Medium_C",
"Description": "Megapithecus (Medium Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Megapithecus",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Gorilla_Character_BP_Hard_C",
"Description": "Megapithecus (Hard Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Dragon",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Dragon_Character_BP_Boss_Easy_C",
"Description": "Dragon (Easy Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Dragon",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Dragon_Character_BP_Boss_Medium_C",
"Description": "Dragon (Medium Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Dragon",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Dragon_Character_BP_Boss_Hard_C",
"Description": "Dragon (Hard Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Manticore",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Manticore_Character_BP_Easy_C",
"Description": "Manticore (Easy Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Manticore",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Manticore_Character_BP_Medium_C",
"Description": "Manticore (Medium Variant)",
"Mod": "Valguero"
},
{
"NameTag": "Manticore",
"IsSpawnable": false,
"IsTameable": "False",
"ClassName": "Manticore_Character_BP_Hard_C",
"Description": "Manticore (Hard Variant)",
"Mod": "Valguero"
}
],
"Engrams": [
{
"Level": 32,
"Points": 30,
"IsTekGram": false,
"ClassName": "EngramEntry_Saddle_Deinonychus_C",
"Description": "Deinonychus Saddle",
"Mod": "Valguero"
}
],
"Items": [
{
"Category": "Saddles",
"IsHarvestable": false,
"ClassName": "PrimalItemArmor_DeinonychusSaddle_C",
"Description": "Deinonychus Saddle",
"Mod": "Valguero"
}
],
"MapSpawners": [
{
"ClassName": "VAL_DinoSpawnEntries_TwitchFertileLand_C",
"Description": "TwitchFertileLand",
"Mod": "Valguero"
},
{
"ClassName": "VAL_DinoSpawnEntries_TwitchFertileLand_Mix_C",
"Description": "TwitchFertileLandMix",
"Mod": "Valguero"
},
{
"ClassName": "VAL_DinoSpawnEntries_TwitchFertileLandEasy_C",
"Description": "TwitchFertileLandEasy",
"Mod": "Valguero"
},
{
"ClassName": "VAL_DinoSpawnEntries_TwitchBioWater_C",
"Description": "TwitchBioWater",
"Mod": "Valguero"
},
{
"ClassName": "Val_DinoSpawnEntriesBee_C",
"Description": "Bee",
"Mod": "Valguero"
},
{
"ClassName": "Val_DinoSpawnEntries_DrakeTrench_C",
"Description": "DrakeTrench",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntriesCave_JungleTemple_C",
"Description": "JungleTemple",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Eel_CaveWater_C",
"Description": "EelCaveWater",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_SmallLakeWithPiranha_C",
"Description": "SmallLakeWithPiranha",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Deinonychus_C",
"Description": "Deinonychus",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Valguero_Scotland_C",
"Description": "Scotland",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntriesSavana_C",
"Description": "Savana",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntriesTundra_C",
"Description": "Tundra",
"Mod": "Valguero"
},
{
"ClassName": "Val_DinoSpawnEntriesWyvernTrench_C",
"Description": "WyvernTrench",
"Mod": "Valguero"
},
{
"ClassName": "Valguero_IceWyvernEntries_C",
"Description": "IceWyvern",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntriesDeepWater_C",
"Description": "DeepWater",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_NormalLakeWater_C",
"Description": "NormalLakeWater",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_SmallLakeNoPiranha_C",
"Description": "SmallLakeNoPiranha",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_SpiderCave_Entrance_C",
"Description": "SpiderCaveEntrance",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Valguero_SnowForest_C",
"Description": "SnowForest",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Valguero_SnowPlains_C",
"Description": "SnowPlains",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_PolarBear_C",
"Description": "PolarBear",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Valguero_IceDesert_C",
"Description": "IceDesert",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_Iceworm_C",
"Description": "Iceworm",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_ChalkHills_C",
"Description": "ChalkHills",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_ChalkHills_Golem_C",
"Description": "ChalkHillsGolem",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntries_ChalkHills_Plains_C",
"Description": "ChalkHillsPlains",
"Mod": "Valguero"
},
{
"ClassName": "DinoSpawnEntriesBrood_C",
"Description": "Broodmother",
"Mod": "Valguero"
},
{
"ClassName": "Val_FireWyvernEntries_C",
"Description": "FireWyvern",
"Mod": "Valguero"
}
],
"SupplyCrates": [
{
"ClassName": "Val_SupplyCrate_Level35_C",
"Description": "Purple Beacon",
"Mod": "Valguero"
},
{
"ClassName": "Val_SupplyCrate_Level35_Double_C",
"Description": "Purple Beacon (Double items)",
"Mod": "Valguero"
},
{
"ClassName": "Val_SupplyCrate_Level45_C",
"Description": "Yellow Beacon",
"Mod": "Valguero"
},
{
"ClassName": "Val_SupplyCrate_Level45_Double_C",
"Description": "Yellow Beacon (Double items)",
"Mod": "Valguero"
},
{
"ClassName": "Val_SupplyCrate_Level60_C",
"Description": "Red Beacon",
"Mod": "Valguero"
},
{
"ClassName": "Val_SupplyCrate_Level60_Double_C",
"Description": "Red Beacon (Double items)",
"Mod": "Valguero"
}
],
"GameMaps": [
{
"IsSotF": false,
"ClassName": "Valguero_P",
"Description": "Valguero",
"Mod": "Valguero"
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
<Globalization:GlobalizationResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Globalization="clr-namespace:WPFSharp.Globalizer;assembly=WPFSharp.Globalizer"
Name="en-AU"
LinkedStyle="en-AU-style"
>
<sys:String x:Key="Generic_TranslatedBy">Bletch</sys:String>
</Globalization:GlobalizationResourceDictionary>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
using ServerManagerTool.Enums;
namespace ServerManagerTool.Interface
{
public interface ISpawnIniValue
{
string ToIniValue(NPCSpawnContainerType containerType);
}
}

View file

@ -0,0 +1,10 @@
using ServerManagerTool.Enums;
using System.Collections.Generic;
namespace ServerManagerTool.Interface
{
public interface ISpawnIniValuesCollection
{
IEnumerable<string> ToIniValues(NPCSpawnContainerType containerType);
}
}

View file

@ -0,0 +1,14 @@
using System;
namespace ServerManagerTool.Lib
{
public class ProfileEventArgs : EventArgs
{
public ProfileEventArgs(ServerProfile profile)
{
Profile = profile;
}
public ServerProfile Profile;
}
}

View file

@ -0,0 +1,410 @@
using ServerManagerTool.Common.Model;
using ServerManagerTool.Enums;
using ServerManagerTool.Lib.ViewModel;
using ServerManagerTool.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using WPFSharp.Globalizer;
namespace ServerManagerTool.Lib
{
public static class GameData
{
public const string MOD_ALL = "All";
public const string MOD_UNKNOWN = "Unknown";
public static string MainDataFolder = Path.Combine(Environment.CurrentDirectory, Config.Default.GameDataDir);
public static string UserDataFolder = Path.Combine(Config.Default.DataDir, Config.Default.GameDataDir);
public static int DefaultMaxExperiencePointsDino = 10;
public static int DefaultMaxExperiencePointsPlayer = 5;
private static MainGameData gameData = null;
public static void Initialize()
{
// read static game data
GameDataUtils.ReadAllData(out gameData, MainDataFolder, Config.Default.GameDataExtension, Config.Default.GameDataApplication);
// read user game data
MainGameData userGameData = new MainGameData();
if (!UserDataFolder.Equals(MainDataFolder, StringComparison.OrdinalIgnoreCase))
{
GameDataUtils.ReadAllData(out userGameData, UserDataFolder, Config.Default.GameDataExtension, Config.Default.GameDataApplication, true);
}
// creatures
gameData.Creatures.AddRange(userGameData.Creatures);
dinoSpawns = gameData.Creatures.ConvertAll(item => new DinoSpawn { ClassName = item.ClassName, Mod = item.Mod, KnownDino = true, DinoNameTag = item.NameTag }).ToArray();
dinoMultipliers = gameData.Creatures.ConvertAll(item => new ClassMultiplier { ClassName = item.ClassName }).ToArray();
// engrams
gameData.Engrams.AddRange(userGameData.Engrams);
engrams = gameData.Engrams.ConvertAll(item => new Engram { EngramClassName = item.ClassName, EngramLevelRequirement = item.Level, EngramPointsCost = item.Points, Mod = item.Mod, KnownEngram = true, IsTekgram = item.IsTekGram }).ToArray();
// items
gameData.Items.AddRange(userGameData.Items);
items = gameData.Items.ConvertAll(item => new PrimalItem { ClassName = item.ClassName, Mod = item.Mod, KnownItem = true, Category = item.Category }).ToArray();
// resources
resourceMultipliers = gameData.Items.Where(item => item.IsHarvestable).ToList().ConvertAll(item => new ResourceClassMultiplier { ClassName = item.ClassName, Mod = item.Mod, KnownResource = true }).ToArray();
// map spawners
gameData.MapSpawners.AddRange(userGameData.MapSpawners);
mapSpawners = gameData.MapSpawners.ConvertAll(item => new MapSpawner { ClassName = item.ClassName, Mod = item.Mod, KnownSpawner = true }).ToArray();
// supply crates
gameData.SupplyCrates.AddRange(userGameData.SupplyCrates);
var crates = gameData.SupplyCrates.ConvertAll(item => new SupplyCrate { ClassName = item.ClassName, Mod = item.Mod, KnownSupplyCrate = true });
// inventories
gameData.Inventories.AddRange(userGameData.Inventories);
crates.AddRange(gameData.Inventories.ConvertAll(item => new SupplyCrate { ClassName = item.ClassName, Mod = item.Mod, KnownSupplyCrate = true }));
supplyCrates = crates.ToArray();
// game maps
gameData.GameMaps.AddRange(userGameData.GameMaps);
if (gameData.GameMaps.Count > 0)
{
var maps1 = gameMaps.ToList();
maps1.AddRange(gameData.GameMaps.Where(item => !item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.ClassName, DisplayMember = item.Description }));
var maps2 = gameMapsSotF.ToList();
maps2.AddRange(gameData.GameMaps.Where(item => item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.ClassName, DisplayMember = item.Description }));
gameMaps = maps1.ToArray();
gameMapsSotF = maps2.ToArray();
}
// total conversion mods
gameData.Mods.AddRange(userGameData.Mods);
if (gameData.Mods.Count > 0)
{
var mods1 = totalConversions.ToList();
mods1.AddRange(gameData.Mods.Where(item => !item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.ClassName, DisplayMember = item.Description }));
var mods2 = totalConversionsSotF.ToList();
mods2.AddRange(gameData.Mods.Where(item => item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.ClassName, DisplayMember = item.Description }));
totalConversions = mods1.ToArray();
totalConversionsSotF = mods2.ToArray();
}
// creature levels
if (userGameData.CreatureLevels.Count > 0)
gameData.CreatureLevels = userGameData.CreatureLevels;
if (gameData.CreatureLevels.Count > 0)
{
levelsDino = gameData.CreatureLevels.ConvertAll(item => new Level { XPRequired = item.XPRequired }).ToArray();
DefaultMaxExperiencePointsDino = levelsDino.Max(l => l.XPRequired) + 1;
}
// player levels
if (userGameData.PlayerLevels.Count > 0)
gameData.PlayerLevels = userGameData.PlayerLevels;
LevelsPlayerAdditional = userGameData.PlayerAdditionalLevels;
if (gameData.PlayerLevels.Count > 0)
{
levelsPlayer = gameData.PlayerLevels.ConvertAll(item => new Level { EngramPoints = item.EngramPoints, XPRequired = item.XPRequired }).ToArray();
DefaultMaxExperiencePointsPlayer = levelsPlayer.Max(l => l.XPRequired) + 1;
}
if (gameData.PlayerAdditionalLevels > LevelsPlayerAdditional)
LevelsPlayerAdditional = gameData.PlayerAdditionalLevels;
// branches
gameData.Branches.AddRange(userGameData.Branches);
if (gameData.Branches.Count > 0)
{
var branches1 = branches.ToList();
branches1.AddRange(gameData.Branches.Where(item => !item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.BranchName, DisplayMember = item.Description }));
var branches2 = branchesSotF.ToList();
branches2.AddRange(gameData.Branches.Where(item => item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.BranchName, DisplayMember = item.Description }));
branches = branches1.ToArray();
branchesSotF = branches2.ToArray();
}
// events
gameData.Events.AddRange(userGameData.Events);
if (gameData.Events.Count > 0)
{
var events1 = events.ToList();
events1.AddRange(gameData.Events.Where(item => !item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.EventName, DisplayMember = item.Description }));
var events2 = eventsSotF.ToList();
events2.AddRange(gameData.Events.Where(item => item.IsSotF).ToList().ConvertAll(item => new ComboBoxItem { ValueMember = item.EventName, DisplayMember = item.Description }));
events = events1.ToArray();
eventsSotF = events2.ToArray();
}
// official mods
gameData.OfficialMods.AddRange(userGameData.OfficialMods);
if (gameData.OfficialMods.Count > 0)
{
ModUtils.AddOfficialMods(gameData.OfficialMods.Where(m => !string.IsNullOrWhiteSpace(m.ModId)).Select(m => m.ModId));
}
}
public static string FriendlyNameForClass(string className, bool returnNullIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? (returnNullIfNotFound ? null : string.Empty) : GlobalizedApplication.Instance.GetResourceString(className) ?? (returnNullIfNotFound ? null : className);
#region Creatures
private static DinoSpawn[] dinoSpawns = new DinoSpawn[0];
public static IEnumerable<DinoSpawn> GetDinoSpawns() => dinoSpawns.Select(d => d.Duplicate<DinoSpawn>());
public static IEnumerable<NPCReplacement> GetNPCReplacements() => dinoSpawns.Select(d => new NPCReplacement() { FromClassName = d.ClassName, ToClassName = d.ClassName });
public static bool IsSpawnableForClass(string className) => gameData?.Creatures?.FirstOrDefault(c => c.ClassName.Equals(className))?.IsSpawnable ?? true;
public static DinoTamable IsTameableForClass(string className) => gameData?.Creatures?.FirstOrDefault(c => c.ClassName.Equals(className))?.IsTameable ?? DinoTamable.True;
public static string NameTagForClass(string className, bool returnEmptyIfNotFound = false) => gameData?.Creatures?.FirstOrDefault(c => c.ClassName.Equals(className))?.NameTag ?? (returnEmptyIfNotFound ? string.Empty : className);
public static string FriendlyCreatureNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.Creatures?.FirstOrDefault(i => i.ClassName.Equals(className))?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
private static ClassMultiplier[] dinoMultipliers = new ClassMultiplier[0];
public static IEnumerable<ClassMultiplier> GetDinoMultipliers() => dinoMultipliers.Select(d => d.Duplicate<ClassMultiplier>());
#endregion
#region Engrams
private static Engram[] engrams = new Engram[0];
public static IEnumerable<Engram> GetEngrams() => engrams.Select(d => d.Duplicate());
public static IEnumerable<EngramEntry> GetEngramEntries() => engrams.Select(d => new EngramEntry() { EngramClassName = d.EngramClassName, EngramLevelRequirement = d.EngramLevelRequirement, EngramPointsCost = d.EngramPointsCost });
public static Engram GetEngramForClass(string className) => engrams.FirstOrDefault(e => e.EngramClassName.Equals(className));
public static bool HasEngramForClass(string className) => engrams.Any(e => e.EngramClassName.Equals(className));
public static bool IsTekgram(string className) => engrams.Any(e => e.EngramClassName.Equals(className) && e.IsTekgram);
public static string FriendlyEngramNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.Engrams?.FirstOrDefault(i => i.ClassName.Equals(className))?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
#endregion
#region Items
private static PrimalItem[] items = new PrimalItem[0];
public static IEnumerable<PrimalItem> GetItems() => items.Select(d => d.Duplicate());
public static PrimalItem GetItemForClass(string className) => items.FirstOrDefault(e => e.ClassName.Equals(className));
public static bool HasItemForClass(string className) => items.Any(e => e.ClassName.Equals(className));
public static string FriendlyItemNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.Items?.FirstOrDefault(i => i.ClassName.Equals(className))?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
#endregion
#region Resources
private static ResourceClassMultiplier[] resourceMultipliers = new ResourceClassMultiplier[0];
public static IEnumerable<ResourceClassMultiplier> GetResourceMultipliers() => resourceMultipliers.Select(d => d.Duplicate<ResourceClassMultiplier>());
public static ResourceClassMultiplier GetResourceMultiplierForClass(string className) => resourceMultipliers.FirstOrDefault(e => e.ClassName.Equals(className));
public static bool HasResourceMultiplierForClass(string className) => resourceMultipliers.Any(e => e.ClassName.Equals(className));
public static string FriendlyResourceNameForClass(string className) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.Items?.FirstOrDefault(i => i.ClassName.Equals(className) && i.IsHarvestable)?.Description ?? className;
#endregion
#region Map Spawners
private static MapSpawner[] mapSpawners = new MapSpawner[0];
public static IEnumerable<MapSpawner> GetMapSpawners() => mapSpawners.Select(d => d.Duplicate());
public static MapSpawner GetMapSpawnerForClass(string className) => mapSpawners.FirstOrDefault(e => e.ClassName.Equals(className));
public static bool HasMapSpawnerForClass(string className) => mapSpawners.Any(e => e.ClassName.Equals(className));
public static string FriendlyMapSpawnerNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.MapSpawners?.FirstOrDefault(i => i.ClassName.Equals(className))?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
#endregion
#region Supply Crates
private static SupplyCrate[] supplyCrates = new SupplyCrate[0];
public static IEnumerable<SupplyCrate> GetSupplyCrates() => supplyCrates.Select(d => d.Duplicate());
public static SupplyCrate GetSupplyCrateForClass(string className) => supplyCrates.FirstOrDefault(e => e.ClassName.Equals(className));
public static bool HasSupplyCrateForClass(string className) => supplyCrates.Any(e => e.ClassName.Equals(className));
public static string FriendlySupplyCrateNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.SupplyCrates?.FirstOrDefault(i => i.ClassName.Equals(className))?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
#endregion
#region Game Maps
private static ComboBoxItem[] gameMaps = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember="" },
};
public static IEnumerable<ComboBoxItem> GetGameMaps() => gameMaps.Select(d => d.Duplicate());
public static string FriendlyMapNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.GameMaps?.FirstOrDefault(i => i.ClassName.Equals(className) && !i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
private static ComboBoxItem[] gameMapsSotF = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember="" },
};
public static IEnumerable<ComboBoxItem> GetGameMapsSotF() => gameMapsSotF.Select(d => d.Duplicate());
public static string FriendlyMapSotFNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.GameMaps?.FirstOrDefault(i => i.ClassName.Equals(className) && i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
#endregion
#region Total Conversions
private static ComboBoxItem[] totalConversions = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember="" },
};
public static IEnumerable<ComboBoxItem> GetTotalConversions() => totalConversions.Select(d => d.Duplicate());
public static string FriendlyTotalConversionNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.Mods?.FirstOrDefault(i => i.ClassName.Equals(className) && !i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
private static ComboBoxItem[] totalConversionsSotF = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember="" },
};
public static IEnumerable<ComboBoxItem> GetTotalConversionsSotF() => totalConversionsSotF.Select(d => d.Duplicate());
public static string FriendlyTotalConversionSotFNameForClass(string className, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(className) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(className) ?? gameData?.Mods?.FirstOrDefault(i => i.ClassName.Equals(className) && i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : className);
#endregion
#region Stats Multipliers
internal static IEnumerable<float> GetPerLevelStatsMultipliers_DinoWild()
{
return new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
}
internal static IEnumerable<float> GetPerLevelStatsMultipliers_DinoTamed()
{
return new float[] { 0.2f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.17f, 1.0f, 1.0f, 1.0f };
}
internal static IEnumerable<float> GetPerLevelStatsMultipliers_DinoTamedAdd()
{
return new float[] { 0.14f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.14f, 1.0f, 1.0f, 1.0f };
}
internal static IEnumerable<float> GetPerLevelStatsMultipliers_DinoTamedAffinity()
{
return new float[] { 0.44f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.44f, 1.0f, 1.0f, 1.0f };
}
internal static IEnumerable<float> GetBaseStatMultipliers_Player()
{
return new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
}
internal static IEnumerable<float> GetPerLevelStatsMultipliers_Player()
{
return new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
}
internal static bool[] GetStatMultiplierInclusions_DinoWildPerLevel()
{
return new bool[] { true, true, false, true, true, false, true, true, true, true, false, true };
}
internal static bool[] GetStatMultiplierInclusions_DinoTamedPerLevel()
{
return new bool[] { true, true, false, true, true, false, true, true, true, true, false, true };
}
internal static bool[] GetStatMultiplierInclusions_DinoTamedAdd()
{
return new bool[] { true, true, true, true, true, true, true, true, true, true, true, true };
}
internal static bool[] GetStatMultiplierInclusions_DinoTamedAffinity()
{
return new bool[] { true, true, true, true, true, true, true, true, true, true, true, true };
}
internal static bool[] GetStatMultiplierInclusions_PlayerBase()
{
return new bool[] { true, true, true, true, true, true, true, true, true, true, true, true };
}
internal static bool[] GetStatMultiplierInclusions_PlayerPerLevel()
{
return new bool[] { true, true, false, true, true, true, true, true, true, true, true, true };
}
#endregion
#region Levels
private static Level[] levelsDino = new[]
{
new Level { XPRequired=10 },
};
private static Level[] levelsPlayer = new[]
{
new Level { XPRequired=5, EngramPoints=8 },
};
public static IEnumerable<Level> LevelsDino => levelsDino.Select(l => l.Duplicate());
public static IEnumerable<Level> LevelsPlayer => levelsPlayer.Select(l => l.Duplicate());
public static int LevelsPlayerAdditional = 0;
#endregion
#region Branches
private static ComboBoxItem[] branches = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember=FriendlyNameForClass(Config.Default.DefaultServerBranchName) },
};
public static IEnumerable<ComboBoxItem> GetBranches() => branches.Select(d => d.Duplicate());
public static string FriendlyBranchName(string branchName, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(branchName) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(branchName) ?? gameData?.Branches?.FirstOrDefault(i => i.BranchName.Equals(branchName) && !i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : branchName);
private static ComboBoxItem[] branchesSotF = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember=FriendlyNameForClass(Config.Default.DefaultServerBranchName) },
};
public static IEnumerable<ComboBoxItem> GetBranchesSotF() => branchesSotF.Select(d => d.Duplicate());
public static string FriendlyBranchSotFName(string branchName, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(branchName) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(branchName) ?? gameData?.Branches?.FirstOrDefault(i => i.BranchName.Equals(branchName) && i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : branchName);
#endregion
#region Events
private static ComboBoxItem[] events = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember=string.Empty },
};
public static IEnumerable<ComboBoxItem> GetEvents() => events.Select(d => d.Duplicate());
public static string FriendlyEventName(string eventName, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(eventName) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(eventName) ?? gameData?.Events?.FirstOrDefault(i => i.EventName.Equals(eventName) && !i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : eventName);
private static ComboBoxItem[] eventsSotF = new[]
{
new ComboBoxItem { ValueMember="", DisplayMember=string.Empty },
};
public static IEnumerable<ComboBoxItem> GetEventsSotF() => eventsSotF.Select(d => d.Duplicate());
public static string FriendlyEventSotFName(string eventName, bool returnEmptyIfNotFound = false) => string.IsNullOrWhiteSpace(eventName) ? string.Empty : GlobalizedApplication.Instance.GetResourceString(eventName) ?? gameData?.Events?.FirstOrDefault(i => i.EventName.Equals(eventName) && i.IsSotF)?.Description ?? (returnEmptyIfNotFound ? string.Empty : eventName);
#endregion
}
}

View file

@ -0,0 +1,46 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using System;
using System.Runtime.Serialization;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
public class ClassMultiplier : AggregateIniValue
{
public const float DEFAULT_MULTIPLIER = 1.0f;
public static readonly DependencyProperty ClassNameProperty = DependencyProperty.Register(nameof(ClassName), typeof(string), typeof(ClassMultiplier), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty MultiplierProperty = DependencyProperty.Register(nameof(Multiplier), typeof(float), typeof(ClassMultiplier), new PropertyMetadata(DEFAULT_MULTIPLIER));
[DataMember]
[AggregateIniValueEntry]
public string ClassName
{
get { return (string)GetValue(ClassNameProperty); }
set { SetValue(ClassNameProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public float Multiplier
{
get { return (float)GetValue(MultiplierProperty); }
set { SetValue(MultiplierProperty, value); }
}
public virtual string DisplayName => GameData.FriendlyNameForClass(ClassName);
public static ClassMultiplier FromINIValue(string iniValue)
{
var newSpawn = new ClassMultiplier();
newSpawn.InitializeFromINIValue(iniValue);
return newSpawn;
}
public override string GetSortKey() => GameData.FriendlyNameForClass(this.ClassName);
public override bool IsEquivalent(AggregateIniValue other) => String.Equals(this.ClassName, ((ClassMultiplier)other).ClassName, StringComparison.OrdinalIgnoreCase);
}
}

View file

@ -0,0 +1,123 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using System.Runtime.Serialization;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
public class CraftingOverride : AggregateIniValue
{
public CraftingOverride()
{
BaseCraftingResourceRequirements = new AggregateIniValueList<CraftingResourceRequirement>(null, null);
}
public static readonly DependencyProperty ItemClassStringProperty = DependencyProperty.Register(nameof(ItemClassString), typeof(string), typeof(CraftingOverride), new PropertyMetadata(string.Empty));
[DataMember]
[AggregateIniValueEntry]
public string ItemClassString
{
get { return (string)GetValue(ItemClassStringProperty); }
set { SetValue(ItemClassStringProperty, value); }
}
public static readonly DependencyProperty BaseCraftingResourceRequirementsProperty = DependencyProperty.Register(nameof(BaseCraftingResourceRequirements), typeof(AggregateIniValueList<CraftingResourceRequirement>), typeof(CraftingOverride), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry(ValueWithinBrackets = true, ListValueWithinBrackets = true)]
public AggregateIniValueList<CraftingResourceRequirement> BaseCraftingResourceRequirements
{
get { return (AggregateIniValueList<CraftingResourceRequirement>)GetValue(BaseCraftingResourceRequirementsProperty); }
set { SetValue(BaseCraftingResourceRequirementsProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
if (string.IsNullOrWhiteSpace(value))
return;
var kvPair = value.Split(new[] { '=' }, 2);
var kvValue = kvPair[1].Trim(' ');
if (kvValue.StartsWith("("))
kvValue = kvValue.Substring(1);
if (kvValue.EndsWith(")"))
kvValue = kvValue.Substring(0, kvValue.Length - 1);
base.FromComplexINIValue(kvValue);
}
public override string ToINIValue()
{
return base.ToComplexINIValue(true);
}
public string DisplayName => GameData.FriendlyItemNameForClass(ItemClassString);
public bool IsValid => !string.IsNullOrWhiteSpace(ItemClassString) && BaseCraftingResourceRequirements.Count > 0;
}
[DataContract]
public class CraftingResourceRequirement : AggregateIniValue
{
public static readonly DependencyProperty ResourceItemTypeStringProperty = DependencyProperty.Register(nameof(ResourceItemTypeString), typeof(string), typeof(CraftingResourceRequirement), new PropertyMetadata(string.Empty));
[DataMember]
[AggregateIniValueEntry]
public string ResourceItemTypeString
{
get { return (string)GetValue(ResourceItemTypeStringProperty); }
set { SetValue(ResourceItemTypeStringProperty, value); }
}
public static readonly DependencyProperty BaseResourceRequirementProperty = DependencyProperty.Register(nameof(BaseResourceRequirement), typeof(float), typeof(CraftingResourceRequirement), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float BaseResourceRequirement
{
get { return (float)GetValue(BaseResourceRequirementProperty); }
set { SetValue(BaseResourceRequirementProperty, value); }
}
public static readonly DependencyProperty CraftingRequireExactResourceTypeProperty = DependencyProperty.Register(nameof(CraftingRequireExactResourceType), typeof(bool), typeof(CraftingResourceRequirement), new PropertyMetadata(false));
[DataMember]
[AggregateIniValueEntry(Key = "bCraftingRequireExactResourceType")]
public bool CraftingRequireExactResourceType
{
get { return (bool)GetValue(CraftingRequireExactResourceTypeProperty); }
set { SetValue(CraftingRequireExactResourceTypeProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
base.FromComplexINIValue(value);
}
public override string ToINIValue()
{
return base.ToComplexINIValue(false);
}
public string DisplayName => GameData.FriendlyItemNameForClass(ResourceItemTypeString);
public bool IsValid => !string.IsNullOrWhiteSpace(ResourceItemTypeString);
}
}

View file

@ -0,0 +1,101 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using ServerManagerTool.Enums;
using System;
using System.Runtime.Serialization;
using System.Windows;
using System.Xml.Serialization;
namespace ServerManagerTool.Lib
{
[DataContract]
public class DinoSpawn : AggregateIniValue
{
public const bool DEFAULT_OVERRIDE_SPAWN_LIMIT_PERCENTAGE = true;
public const float DEFAULT_SPAWN_LIMIT_PERCENTAGE = ClassMultiplier.DEFAULT_MULTIPLIER;
public const float DEFAULT_SPAWN_WEIGHT_MULTIPLIER = ClassMultiplier.DEFAULT_MULTIPLIER;
public static readonly DependencyProperty ClassNameProperty = DependencyProperty.Register(nameof(ClassName), typeof(string), typeof(DinoSpawn), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty ModProperty = DependencyProperty.Register(nameof(Mod), typeof(string), typeof(DinoSpawn), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty KnownDinoProperty = DependencyProperty.Register(nameof(KnownDino), typeof(bool), typeof(DinoSpawn), new PropertyMetadata(false));
public static readonly DependencyProperty DinoNameTagProperty = DependencyProperty.Register(nameof(DinoNameTag), typeof(string), typeof(DinoSpawn), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty OverrideSpawnLimitPercentageProperty = DependencyProperty.Register(nameof(OverrideSpawnLimitPercentage), typeof(bool), typeof(DinoSpawn), new PropertyMetadata(DEFAULT_OVERRIDE_SPAWN_LIMIT_PERCENTAGE));
public static readonly DependencyProperty SpawnLimitPercentageProperty = DependencyProperty.Register(nameof(SpawnLimitPercentage), typeof(float), typeof(DinoSpawn), new PropertyMetadata(DEFAULT_SPAWN_LIMIT_PERCENTAGE));
public static readonly DependencyProperty SpawnWeightMultiplierProperty = DependencyProperty.Register(nameof(SpawnWeightMultiplier), typeof(float), typeof(DinoSpawn), new PropertyMetadata(DEFAULT_SPAWN_WEIGHT_MULTIPLIER));
[DataMember]
public string ClassName
{
get { return (string)GetValue(ClassNameProperty); }
set { SetValue(ClassNameProperty, value); }
}
[DataMember]
public string Mod
{
get { return (string)GetValue(ModProperty); }
set { SetValue(ModProperty, value); }
}
[DataMember]
public bool KnownDino
{
get { return (bool)GetValue(KnownDinoProperty); }
set { SetValue(KnownDinoProperty, value); }
}
[XmlElement(ElementName="Name")]
[DataMember]
[AggregateIniValueEntry]
public string DinoNameTag
{
get { return (string)GetValue(DinoNameTagProperty); }
set { SetValue(DinoNameTagProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public bool OverrideSpawnLimitPercentage
{
get { return (bool)GetValue(OverrideSpawnLimitPercentageProperty); }
set { SetValue(OverrideSpawnLimitPercentageProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public float SpawnLimitPercentage
{
get { return (float)GetValue(SpawnLimitPercentageProperty); }
set { SetValue(SpawnLimitPercentageProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public float SpawnWeightMultiplier
{
get { return (float)GetValue(SpawnWeightMultiplierProperty); }
set { SetValue(SpawnWeightMultiplierProperty, value); }
}
public string DisplayName => GameData.FriendlyCreatureNameForClass(ClassName);
public string DisplayMod => GameData.FriendlyNameForClass($"Mod_{Mod}", true) ?? Mod;
public static DinoSpawn FromINIValue(string iniValue)
{
var newSpawn = new DinoSpawn();
newSpawn.InitializeFromINIValue(iniValue);
return newSpawn;
}
public override string GetSortKey()
{
return this.DinoNameTag;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return String.Equals(this.DinoNameTag, ((DinoSpawn)other).DinoNameTag, StringComparison.OrdinalIgnoreCase);
}
}
}

View file

@ -0,0 +1,91 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Windows;
namespace ServerManagerTool.Lib
{
public class EngramAutoUnlockList : AggregateIniValueList<EngramAutoUnlock>
{
public EngramAutoUnlockList(string aggregateValueName)
: base(aggregateValueName, null)
{
}
public override void FromIniValues(IEnumerable<string> iniValues)
{
var items = iniValues?.Select(AggregateIniValue.FromINIValue<EngramAutoUnlock>).ToArray();
Clear();
var itemsToAdd = items.Where(i => !this.Any(e => e.IsEquivalent(i))).ToArray();
AddRange(itemsToAdd);
var itemsToUpdate = items.Where(i => this.Any(e => e.IsEquivalent(i))).ToArray();
foreach (var item in itemsToUpdate)
{
var e = this.FirstOrDefault(r => r.IsEquivalent(item));
e.LevelToAutoUnlock = item.LevelToAutoUnlock;
}
IsEnabled = (Count != 0);
Sort(AggregateIniValue.SortKeySelector);
}
public override IEnumerable<string> ToIniValues()
{
if (string.IsNullOrWhiteSpace(IniCollectionKey))
return this.Where(d => d.ShouldSave()).Select(d => d.ToINIValue());
return this.Where(d => d.ShouldSave()).Select(d => $"{this.IniCollectionKey}={d.ToINIValue()}");
}
}
public class EngramAutoUnlock : AggregateIniValue
{
public static readonly DependencyProperty EngramClassNameProperty = DependencyProperty.Register(nameof(EngramClassName), typeof(string), typeof(EngramAutoUnlock), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty LevelToAutoUnlockProperty = DependencyProperty.Register(nameof(LevelToAutoUnlock), typeof(int), typeof(EngramAutoUnlock), new PropertyMetadata(0));
[DataMember]
[AggregateIniValueEntry]
public string EngramClassName
{
get { return (string)GetValue(EngramClassNameProperty); }
set { SetValue(EngramClassNameProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public int LevelToAutoUnlock
{
get { return (int)GetValue(LevelToAutoUnlockProperty); }
set { SetValue(LevelToAutoUnlockProperty, value); }
}
public static EngramAutoUnlock FromINIValue(string iniValue)
{
var engramAutoUnlock = new EngramAutoUnlock();
engramAutoUnlock.InitializeFromINIValue(iniValue);
return engramAutoUnlock;
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return String.Equals(this.EngramClassName, ((EngramAutoUnlock)other).EngramClassName, StringComparison.OrdinalIgnoreCase);
}
public override string ToINIValue()
{
return base.ToINIValue();
}
}
}

View file

@ -0,0 +1,128 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
public class EngramEntryList : AggregateIniValueList<EngramEntry>
{
public EngramEntryList(string aggregateValueName)
: base(aggregateValueName, null)
{
}
public override void FromIniValues(IEnumerable<string> iniValues)
{
var items = iniValues?.Select(AggregateIniValue.FromINIValue<EngramEntry>).ToArray();
Clear();
var itemsToAdd = items.Where(i => !this.Any(e => e.IsEquivalent(i))).ToArray();
AddRange(itemsToAdd);
var itemsToUpdate = items.Where(i => this.Any(e => e.IsEquivalent(i))).ToArray();
foreach (var item in itemsToUpdate)
{
var e = this.FirstOrDefault(r => r.IsEquivalent(item));
e.EngramLevelRequirement = item.EngramLevelRequirement;
e.EngramPointsCost = item.EngramPointsCost;
e.EngramHidden = item.EngramHidden;
e.RemoveEngramPreReq = item.RemoveEngramPreReq;
}
IsEnabled = (Count != 0);
Sort(AggregateIniValue.SortKeySelector);
}
public override IEnumerable<string> ToIniValues()
{
if (string.IsNullOrWhiteSpace(IniCollectionKey))
return this.Where(d => d.ShouldSave()).Select(d => d.ToINIValue());
return this.Where(d => d.ShouldSave()).Select(d => $"{this.IniCollectionKey}={d.ToINIValue()}");
}
}
[DataContract]
public class EngramEntry : AggregateIniValue
{
public static readonly DependencyProperty EngramClassNameProperty = DependencyProperty.Register(nameof(EngramClassName), typeof(string), typeof(EngramEntry), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty EngramLevelRequirementProperty = DependencyProperty.Register(nameof(EngramLevelRequirement), typeof(int), typeof(EngramEntry), new PropertyMetadata(0));
public static readonly DependencyProperty EngramPointsCostProperty = DependencyProperty.Register(nameof(EngramPointsCost), typeof(int), typeof(EngramEntry), new PropertyMetadata(0));
public static readonly DependencyProperty EngramHiddenProperty = DependencyProperty.Register(nameof(EngramHidden), typeof(bool), typeof(EngramEntry), new PropertyMetadata(false));
public static readonly DependencyProperty RemoveEngramPreReqProperty = DependencyProperty.Register(nameof(RemoveEngramPreReq), typeof(bool), typeof(EngramEntry), new PropertyMetadata(false));
[DataMember]
[AggregateIniValueEntry]
public string EngramClassName
{
get { return (string)GetValue(EngramClassNameProperty); }
set { SetValue(EngramClassNameProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public int EngramLevelRequirement
{
get { return (int)GetValue(EngramLevelRequirementProperty); }
set { SetValue(EngramLevelRequirementProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public int EngramPointsCost
{
get { return (int)GetValue(EngramPointsCostProperty); }
set { SetValue(EngramPointsCostProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public bool EngramHidden
{
get { return (bool)GetValue(EngramHiddenProperty); }
set { SetValue(EngramHiddenProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public bool RemoveEngramPreReq
{
get { return (bool)GetValue(RemoveEngramPreReqProperty); }
set { SetValue(RemoveEngramPreReqProperty, value); }
}
public static EngramEntry FromINIValue(string iniValue)
{
var engramEntry = new EngramEntry();
engramEntry.InitializeFromINIValue(iniValue);
return engramEntry;
}
public override string GetSortKey()
{
return null;
}
public override void InitializeFromINIValue(string value)
{
base.InitializeFromINIValue(value);
}
public override bool IsEquivalent(AggregateIniValue other)
{
return String.Equals(this.EngramClassName, ((EngramEntry)other).EngramClassName, StringComparison.OrdinalIgnoreCase);
}
public override string ToINIValue()
{
return base.ToINIValue();
}
}
}

View file

@ -0,0 +1,260 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Xml.Serialization;
using TinyCsvParser.Mapping;
using System.Runtime.Serialization;
using ServerManagerTool.Common.Model;
namespace ServerManagerTool.Lib
{
[DataContract]
public class LevelList : SortableObservableCollection<Level>
{
const bool WORKAROUND_FOR_ENGRAM_LIST = true;
public static readonly Regex XPRegex = new Regex(@"ExperiencePointsForLevel\[(?<level>\d*)]=(?<xp>\d*)", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
public static readonly Regex EngramRegex = new Regex(@"OverridePlayerLevelEngramPoints=(?<points>\d*)", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
public static int AdditionalLevels = GameData.LevelsPlayerAdditional;
public void RemoveLevel(Level level)
{
base.Remove(level);
UpdateTotals();
}
public void AddRange(IEnumerable<Level> levels)
{
foreach (var level in levels)
{
base.Add(level);
}
UpdateTotals();
}
public void AddNewLevel(Level afterLevel)
{
AddNewLevel(afterLevel, 1);
}
public void AddNewLevel(Level afterLevel, int xpIncrease)
{
var newLevel = new Level
{
LevelIndex = 0,
XPRequired = afterLevel.XPRequired + xpIncrease,
EngramPoints = afterLevel.EngramPoints
};
base.Insert(base.IndexOf(afterLevel) + 1, newLevel);
UpdateTotals();
}
public void UpdateTotals()
{
int index = 0;
int xpTotal = 0;
int engramTotal = 0;
foreach (var existingLevel in this.OrderBy(l => l.XPRequired).ToArray())
{
xpTotal += existingLevel.XPRequired;
engramTotal += existingLevel.EngramPoints;
existingLevel.XPTotal = xpTotal;
existingLevel.EngramTotal = engramTotal;
existingLevel.LevelIndex = index;
existingLevel.ShowColored = index >= this.Count - AdditionalLevels;
index++;
}
base.Sort(f => f.LevelIndex);
}
public string ToINIValueForXP()
{
var builder = new StringBuilder();
builder.Append("LevelExperienceRampOverrides=(");
builder.Append(String.Join(",", this.OrderBy(l => l.XPRequired).Select(l => l.GetINISubValueForXP())));
builder.Append(')');
return builder.ToString();
}
public List<string> ToINIValuesForEngramPoints()
{
var entries = new List<string>();
if (WORKAROUND_FOR_ENGRAM_LIST)
{
entries.Add(new Level().GetINIValueForEngramPointsEarned());
}
foreach (var level in this.OrderBy(l => l.XPRequired))
{
entries.Add(level.GetINIValueForEngramPointsEarned());
}
return entries;
}
public static LevelList FromINIValues(string xpValue, IEnumerable<string> engramValues = null)
{
var levels = new LevelList();
var xpResult = XPRegex.Match(xpValue);
var engramResult = engramValues == null ? null : EngramRegex.Match(String.Join(" ", engramValues));
if (WORKAROUND_FOR_ENGRAM_LIST)
{
if (engramResult != null)
{
engramResult = engramResult.NextMatch();
}
}
while (xpResult.Success && (engramValues == null || engramResult.Success))
{
int levelIndex;
if (!int.TryParse(xpResult.Groups["level"].Value, out levelIndex))
{
Debug.WriteLine(String.Format("Invalid level index value: '{0}'", xpResult.Groups["level"].Value));
break;
}
int xpRequired;
if (!int.TryParse(xpResult.Groups["xp"].Value, out xpRequired))
{
Debug.WriteLine(String.Format("Invalid xm required value: '{0}'", xpResult.Groups["xp"].Value));
break;
}
int engramPoints = 0;
if (engramResult != null)
{
if (!int.TryParse(engramResult.Groups["points"].Value, out engramPoints))
{
Debug.WriteLine(String.Format("Invalid engram points value: '{0}'", engramResult.Groups["points"].Value));
break;
}
}
levels.Add(new Level { LevelIndex = levelIndex, XPRequired = xpRequired, EngramPoints = engramPoints });
xpResult = xpResult.NextMatch();
if (engramResult != null)
{
engramResult = engramResult.NextMatch();
}
}
levels.UpdateTotals();
return levels;
}
}
[DataContract]
public class Level : DependencyObject
{
public static readonly DependencyProperty LevelIndexProperty = DependencyProperty.Register(nameof(LevelIndex), typeof(int), typeof(Level), new PropertyMetadata(0));
public static readonly DependencyProperty XPRequiredProperty = DependencyProperty.Register(nameof(XPRequired), typeof(int), typeof(Level), new PropertyMetadata(0));
public static readonly DependencyProperty EngramPointsProperty = DependencyProperty.Register(nameof(EngramPoints), typeof(int), typeof(Level), new PropertyMetadata(0));
public static readonly DependencyProperty XPTotalProperty = DependencyProperty.Register(nameof(XPTotal), typeof(int), typeof(Level), new PropertyMetadata(0));
public static readonly DependencyProperty EngramTotalProperty = DependencyProperty.Register(nameof(EngramTotal), typeof(int), typeof(Level), new PropertyMetadata(0));
public static readonly DependencyProperty ShowColoredProperty = DependencyProperty.Register(nameof(ShowColored), typeof(bool), typeof(Level), new PropertyMetadata(false));
[DataMember]
public int LevelIndex
{
get { return (int)GetValue(LevelIndexProperty); }
set { SetValue(LevelIndexProperty, value); }
}
[DataMember]
public int XPRequired
{
get { return (int)GetValue(XPRequiredProperty); }
set { SetValue(XPRequiredProperty, value); }
}
[DataMember]
public int EngramPoints
{
get { return (int)GetValue(EngramPointsProperty); }
set { SetValue(EngramPointsProperty, value); }
}
[XmlIgnore()]
public int XPTotal
{
get { return (int)GetValue(XPTotalProperty); }
set { SetValue(XPTotalProperty, value); }
}
[XmlIgnore()]
public int EngramTotal
{
get { return (int)GetValue(EngramTotalProperty); }
set { SetValue(EngramTotalProperty, value); }
}
public string GetINISubValueForXP()
{
return String.Format("ExperiencePointsForLevel[{0}]={1}", this.LevelIndex, this.XPRequired);
}
public string GetINIValueForEngramPointsEarned()
{
return String.Format("OverridePlayerLevelEngramPoints={0}", this.EngramPoints);
}
internal Level Duplicate()
{
return new Level { XPRequired = this.XPRequired, EngramPoints = this.EngramPoints };
}
public bool ShowColored
{
get { return (bool)GetValue(ShowColoredProperty); }
set { SetValue(ShowColoredProperty, value); }
}
}
public class CsvPlayerLevelMapping : CsvMapping<ImportLevel>
{
public CsvPlayerLevelMapping()
: base()
{
MapProperty(0, x => x.LevelIndex);
MapProperty(1, x => x.XPRequired);
MapProperty(2, x => x.EngramPoints);
}
}
public class CsvDinoLevelMapping : CsvMapping<ImportLevel>
{
public CsvDinoLevelMapping()
: base()
{
MapProperty(0, x => x.LevelIndex);
MapProperty(1, x => x.XPRequired);
}
}
public class ImportLevel
{
public int LevelIndex { get; set; }
public int XPRequired { get; set; }
public int EngramPoints { get; set; }
public Level AsLevel()
{
return new Level() { LevelIndex = LevelIndex, XPRequired = XPRequired, EngramPoints = EngramPoints };
}
}
}

View file

@ -0,0 +1,53 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using System;
using System.Runtime.Serialization;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
public class NPCReplacement : AggregateIniValue
{
public static readonly DependencyProperty FromClassNameProperty = DependencyProperty.Register(nameof(FromClassName), typeof(string), typeof(NPCReplacement), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty ToClassNameProperty = DependencyProperty.Register(nameof(ToClassName), typeof(string), typeof(NPCReplacement), new PropertyMetadata(String.Empty));
[DataMember]
[AggregateIniValueEntry]
public string FromClassName
{
get { return (string)GetValue(FromClassNameProperty); }
set { SetValue(FromClassNameProperty, value); }
}
[DataMember]
[AggregateIniValueEntry]
public string ToClassName
{
get { return (string)GetValue(ToClassNameProperty); }
set { SetValue(ToClassNameProperty, value); }
}
public static NPCReplacement FromINIValue(string iniValue)
{
var newSpawn = new NPCReplacement();
newSpawn.InitializeFromINIValue(iniValue);
return newSpawn;
}
public override string GetSortKey()
{
return this.FromClassName;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return String.Equals(this.FromClassName, ((NPCReplacement)other).FromClassName, StringComparison.OrdinalIgnoreCase);
}
public override bool ShouldSave()
{
return (!String.Equals(FromClassName, ToClassName, StringComparison.OrdinalIgnoreCase));
}
}
}

View file

@ -0,0 +1,509 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Interfaces;
using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Utils;
using ServerManagerTool.Enums;
using ServerManagerTool.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class NPCSpawnAttribute : Attribute
{
/// <summary>
/// Attribute for the NPCSpawn value
/// </summary>
public NPCSpawnAttribute(NPCSpawnContainerType[] containerTypes)
{
this.ContainerTypes = containerTypes.ToList();
}
/// <summary>
/// The ContainerTypes that are valid for the property.
/// </summary>
[DataMember]
public List<NPCSpawnContainerType> ContainerTypes;
}
[DataContract]
public class NPCSpawnContainerList<T> : AggregateIniValueList<T>, ISpawnIniValuesCollection
where T : AggregateIniValue, new()
{
public NPCSpawnContainerList(string aggregateValueName, NPCSpawnContainerType containerType)
: base(aggregateValueName, null)
{
ContainerType = containerType;
}
[DataMember]
public NPCSpawnContainerType ContainerType
{
get;
set;
}
public override IEnumerable<string> ToIniValues()
{
return this.ToIniValues(ContainerType);
}
public IEnumerable<string> ToIniValues(NPCSpawnContainerType containerType)
{
if (string.IsNullOrWhiteSpace(IniCollectionKey))
return this.Where(d => d.ShouldSave()).Cast<ISpawnIniValue>().Select(d => d.ToIniValue(containerType));
return this.Where(d => d.ShouldSave()).Cast<ISpawnIniValue>().Select(d => $"{this.IniCollectionKey}={d.ToIniValue(containerType)}");
}
}
[DataContract]
public class NPCSpawnContainer : AggregateIniValue, ISpawnIniValue
{
public NPCSpawnContainer()
{
NPCSpawnEntries = new NPCSpawnList<NPCSpawnEntry>(null);
NPCSpawnLimits = new NPCSpawnList<NPCSpawnLimit>(null);
}
[DataMember]
public Guid UniqueId = Guid.NewGuid();
public static readonly DependencyProperty NPCSpawnEntriesContainerClassStringProperty = DependencyProperty.Register(nameof(NPCSpawnEntriesContainerClassString), typeof(string), typeof(NPCSpawnContainer), new PropertyMetadata(string.Empty));
[DataMember]
[AggregateIniValueEntry]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Subtract, NPCSpawnContainerType.Override })]
public string NPCSpawnEntriesContainerClassString
{
get { return (string)GetValue(NPCSpawnEntriesContainerClassStringProperty); }
set { SetValue(NPCSpawnEntriesContainerClassStringProperty, value); }
}
public static readonly DependencyProperty NPCSpawnEntriesProperty = DependencyProperty.Register(nameof(NPCSpawnEntries), typeof(NPCSpawnList<NPCSpawnEntry>), typeof(NPCSpawnContainer), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry(ValueWithinBrackets = true, ListValueWithinBrackets = true)]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Subtract, NPCSpawnContainerType.Override })]
public NPCSpawnList<NPCSpawnEntry> NPCSpawnEntries
{
get { return (NPCSpawnList<NPCSpawnEntry>)GetValue(NPCSpawnEntriesProperty); }
set { SetValue(NPCSpawnEntriesProperty, value); }
}
public static readonly DependencyProperty NPCSpawnLimitsProperty = DependencyProperty.Register(nameof(NPCSpawnLimits), typeof(NPCSpawnList<NPCSpawnLimit>), typeof(NPCSpawnContainer), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry(ValueWithinBrackets = true, ListValueWithinBrackets = true)]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Subtract, NPCSpawnContainerType.Override })]
public NPCSpawnList<NPCSpawnLimit> NPCSpawnLimits
{
get { return (NPCSpawnList<NPCSpawnLimit>)GetValue(NPCSpawnLimitsProperty); }
set { SetValue(NPCSpawnLimitsProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
if (string.IsNullOrWhiteSpace(value))
return;
var kvPair = value.Split(new[] { '=' }, 2);
var kvValue = kvPair[1].Trim(' ');
if (kvValue.StartsWith("("))
kvValue = kvValue.Substring(1);
if (kvValue.EndsWith(")"))
kvValue = kvValue.Substring(0, kvValue.Length - 1);
base.FromComplexINIValue(kvValue);
}
public override string ToINIValue()
{
throw new NotImplementedException();
}
public string ToIniValue(NPCSpawnContainerType containerType)
{
GetPropertyInfos();
if (this.Properties.Count == 0)
return string.Empty;
var result = new StringBuilder();
result.Append("(");
var delimiter = "";
foreach (var prop in this.Properties)
{
var attrSpawn = prop.GetCustomAttributes(typeof(NPCSpawnAttribute), false).OfType<NPCSpawnAttribute>().FirstOrDefault();
if (!attrSpawn?.ContainerTypes?.Contains(containerType) ?? false)
continue;
result.Append(delimiter);
var attr = prop.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().FirstOrDefault();
var propName = string.IsNullOrWhiteSpace(attr?.Key) ? prop.Name : attr.Key;
result.Append($"{propName}=");
if (attr?.ValueWithinBrackets ?? false)
result.Append("(");
var val = prop.GetValue(this);
var spawnCollection = val as ISpawnIniValuesCollection;
if (spawnCollection != null)
{
var iniVals = spawnCollection.ToIniValues(containerType);
var delimiter2 = "";
foreach (var iniVal in iniVals)
{
result.Append(delimiter2);
if (attr?.ListValueWithinBrackets ?? false)
result.Append($"({iniVal})");
else
result.Append(iniVal);
delimiter2 = DELIMITER.ToString();
}
}
else
{
var collection = val as IIniValuesCollection;
if (collection != null)
{
var iniVals = collection.ToIniValues();
var delimiter2 = "";
foreach (var iniVal in iniVals)
{
result.Append(delimiter2);
if (attr?.ListValueWithinBrackets ?? false)
result.Append($"({iniVal})");
else
result.Append(iniVal);
delimiter2 = DELIMITER.ToString();
}
}
else
{
var propValue = StringUtils.GetPropertyValue(val, prop);
result.Append(propValue);
}
}
if (attr?.ValueWithinBrackets ?? false)
result.Append(")");
delimiter = DELIMITER.ToString();
}
result.Append(")");
return result.ToString();
}
public override string ToString()
{
return $"{NPCSpawnEntriesContainerClassString}; NPCSpawnEntries={NPCSpawnEntries.Count}; NPCSpawnLimits={NPCSpawnLimits.Count}";
}
public bool IsValid => !string.IsNullOrWhiteSpace(NPCSpawnEntriesContainerClassString) && NPCSpawnEntries.Count == NPCSpawnLimits.Count;
}
[DataContract]
public class NPCSpawnList<T> : AggregateIniValueList<T>, ISpawnIniValuesCollection
where T : AggregateIniValue, new()
{
public NPCSpawnList(string aggregateValueName)
: base(aggregateValueName, null)
{
}
public override IEnumerable<string> ToIniValues()
{
throw new NotImplementedException();
}
public IEnumerable<string> ToIniValues(NPCSpawnContainerType containerType)
{
if (string.IsNullOrWhiteSpace(IniCollectionKey))
return this.Where(d => d.ShouldSave()).Cast<ISpawnIniValue>().Select(d => d.ToIniValue(containerType));
return this.Where(d => d.ShouldSave()).Cast<ISpawnIniValue>().Select(d => $"{this.IniCollectionKey}={d.ToIniValue(containerType)}");
}
}
[DataContract]
public class NPCSpawnEntry : AggregateIniValue, ISpawnIniValue
{
public static readonly DependencyProperty AnEntryNameProperty = DependencyProperty.Register(nameof(AnEntryName), typeof(string), typeof(NPCSpawnEntry), new PropertyMetadata(string.Empty));
[DataMember]
[AggregateIniValueEntry]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Override })]
public string AnEntryName
{
get { return (string)GetValue(AnEntryNameProperty); }
set { SetValue(AnEntryNameProperty, value); }
}
public static readonly DependencyProperty EntryWeightProperty = DependencyProperty.Register(nameof(EntryWeight), typeof(float), typeof(NPCSpawnEntry), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Override })]
public float EntryWeight
{
get { return (float)GetValue(EntryWeightProperty); }
set { SetValue(EntryWeightProperty, value); }
}
public static readonly DependencyProperty NPCsToSpawnStringsProperty = DependencyProperty.Register(nameof(NPCsToSpawnStrings), typeof(string), typeof(NPCSpawnEntry), new PropertyMetadata(string.Empty));
[DataMember]
[AggregateIniValueEntry(ValueWithinBrackets = true)]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Subtract, NPCSpawnContainerType.Override })]
public string NPCsToSpawnStrings
{
get { return (string)GetValue(NPCsToSpawnStringsProperty); }
set { SetValue(NPCsToSpawnStringsProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
base.FromComplexINIValue(value);
}
public override string ToINIValue()
{
throw new NotImplementedException();
}
public string ToIniValue(NPCSpawnContainerType containerType)
{
GetPropertyInfos();
if (this.Properties.Count == 0)
return string.Empty;
var result = new StringBuilder();
var delimiter = "";
foreach (var prop in this.Properties)
{
var attrSpawn = prop.GetCustomAttributes(typeof(NPCSpawnAttribute), false).OfType<NPCSpawnAttribute>().FirstOrDefault();
if (!attrSpawn?.ContainerTypes?.Contains(containerType) ?? false)
continue;
result.Append(delimiter);
var attr = prop.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().FirstOrDefault();
var propName = string.IsNullOrWhiteSpace(attr?.Key) ? prop.Name : attr.Key;
result.Append($"{propName}=");
if (attr?.ValueWithinBrackets ?? false)
result.Append("(");
var val = prop.GetValue(this);
var spawnCollection = val as ISpawnIniValuesCollection;
if (spawnCollection != null)
{
var iniVals = spawnCollection.ToIniValues(containerType);
var delimiter2 = "";
foreach (var iniVal in iniVals)
{
result.Append(delimiter2);
if (attr?.ListValueWithinBrackets ?? false)
result.Append($"({iniVal})");
else
result.Append(iniVal);
delimiter2 = DELIMITER.ToString();
}
}
else
{
var collection = val as IIniValuesCollection;
if (collection != null)
{
var iniVals = collection.ToIniValues();
var delimiter2 = "";
foreach (var iniVal in iniVals)
{
result.Append(delimiter2);
if (attr?.ListValueWithinBrackets ?? false)
result.Append($"({iniVal})");
else
result.Append(iniVal);
delimiter2 = DELIMITER.ToString();
}
}
else
{
var propValue = StringUtils.GetPropertyValue(val, prop);
result.Append(propValue);
}
}
if (attr?.ValueWithinBrackets ?? false)
result.Append(")");
delimiter = DELIMITER.ToString();
}
return result.ToString();
}
public override string ToString()
{
return $"AnEntryName={AnEntryName}; EntryWeight={EntryWeight}; NPCsToSpawnStrings={NPCsToSpawnStrings}";
}
public bool IsValid => !string.IsNullOrWhiteSpace(NPCsToSpawnStrings);
}
[DataContract]
public class NPCSpawnLimit : AggregateIniValue, ISpawnIniValue
{
public static readonly DependencyProperty NPCClassStringProperty = DependencyProperty.Register(nameof(NPCClassString), typeof(string), typeof(NPCSpawnLimit), new PropertyMetadata(string.Empty));
[DataMember]
[AggregateIniValueEntry]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Subtract, NPCSpawnContainerType.Override })]
public string NPCClassString
{
get { return (string)GetValue(NPCClassStringProperty); }
set { SetValue(NPCClassStringProperty, value); }
}
public static readonly DependencyProperty MaxPercentageOfDesiredNumToAllowProperty = DependencyProperty.Register(nameof(MaxPercentageOfDesiredNumToAllow), typeof(float), typeof(NPCSpawnLimit), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
[NPCSpawn(new[] { NPCSpawnContainerType.Add, NPCSpawnContainerType.Override })]
public float MaxPercentageOfDesiredNumToAllow
{
get { return (float)GetValue(MaxPercentageOfDesiredNumToAllowProperty); }
set { SetValue(MaxPercentageOfDesiredNumToAllowProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
base.FromComplexINIValue(value);
}
public override string ToINIValue()
{
throw new NotImplementedException();
}
public string ToIniValue(NPCSpawnContainerType containerType)
{
GetPropertyInfos();
if (this.Properties.Count == 0)
return string.Empty;
var result = new StringBuilder();
var delimiter = "";
foreach (var prop in this.Properties)
{
var attrSpawn = prop.GetCustomAttributes(typeof(NPCSpawnAttribute), false).OfType<NPCSpawnAttribute>().FirstOrDefault();
if (!attrSpawn?.ContainerTypes?.Contains(containerType) ?? false)
continue;
result.Append(delimiter);
var attr = prop.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().FirstOrDefault();
var propName = string.IsNullOrWhiteSpace(attr?.Key) ? prop.Name : attr.Key;
result.Append($"{propName}=");
if (attr?.ValueWithinBrackets ?? false)
result.Append("(");
var val = prop.GetValue(this);
var spawnCollection = val as ISpawnIniValuesCollection;
if (spawnCollection != null)
{
var iniVals = spawnCollection.ToIniValues(containerType);
var delimiter2 = "";
foreach (var iniVal in iniVals)
{
result.Append(delimiter2);
if (attr?.ListValueWithinBrackets ?? false)
result.Append($"({iniVal})");
else
result.Append(iniVal);
delimiter2 = DELIMITER.ToString();
}
}
else
{
var collection = val as IIniValuesCollection;
if (collection != null)
{
var iniVals = collection.ToIniValues();
var delimiter2 = "";
foreach (var iniVal in iniVals)
{
result.Append(delimiter2);
if (attr?.ListValueWithinBrackets ?? false)
result.Append($"({iniVal})");
else
result.Append(iniVal);
delimiter2 = DELIMITER.ToString();
}
}
else
{
var propValue = StringUtils.GetPropertyValue(val, prop);
result.Append(propValue);
}
}
if (attr?.ValueWithinBrackets ?? false)
result.Append(")");
delimiter = DELIMITER.ToString();
}
return result.ToString();
}
public override string ToString()
{
return $"NPCClassString={NPCClassString}; MaxPercentageOfDesiredNumToAllow={MaxPercentageOfDesiredNumToAllow}";
}
public bool IsValid => !string.IsNullOrWhiteSpace(NPCClassString);
}
}

View file

@ -0,0 +1,855 @@
using ServerManagerTool.Common.Attibutes;
using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Utils;
using System;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
public class PGMTerrain : AggregateIniValue
{
private new const char DELIMITER = ';';
public PGMTerrain()
{
SnowBiomeLocation = new PGMTerrainXY(0.2f, 0.2f);
RedWoodForestBiomeLocation = new PGMTerrainXY(0.5f, 0.5f);
NorthRegion1Start = new PGMTerrainXY(0.25f, 0.0f);
NorthRegion1End = new PGMTerrainXY(0.416f, 0.5f);
NorthRegion2Start = new PGMTerrainXY(0.416f, 0.0f);
NorthRegion2End = new PGMTerrainXY(0.582f, 0.5f);
NorthRegion3Start = new PGMTerrainXY(0.582f, 0.0f);
NorthRegion3End = new PGMTerrainXY(0.75f, 0.0f);
SouthRegion1Start = new PGMTerrainXY(0.25f, 0.5f);
SouthRegion1End = new PGMTerrainXY(0.416f, 1.0f);
SouthRegion2Start = new PGMTerrainXY(0.416f, 0.5f);
SouthRegion2End = new PGMTerrainXY(0.582f, 1.0f);
SouthRegion3Start = new PGMTerrainXY(0.582f, 0.5f);
SouthRegion3End = new PGMTerrainXY(0.75f, 1.0f);
EastRegion1Start = new PGMTerrainXY(0.75f, 0.0f);
EastRegion1End = new PGMTerrainXY(1.0f, 0.333f);
EastRegion2Start = new PGMTerrainXY(0.75f, 0.333f);
EastRegion2End = new PGMTerrainXY(1.0f, 0.666f);
EastRegion3Start = new PGMTerrainXY(0.75f, 0.666f);
EastRegion3End = new PGMTerrainXY(1.0f, 1.0f);
WestRegion1Start = new PGMTerrainXY(0.0f, 0.0f);
WestRegion1End = new PGMTerrainXY(0.25f, 0.333f);
WestRegion2Start = new PGMTerrainXY(0.0f, 0.333f);
WestRegion2End = new PGMTerrainXY(0.25f, 0.666f);
WestRegion3Start = new PGMTerrainXY(0.0f, 0.666f);
WestRegion3End = new PGMTerrainXY(0.25f, 1.0f);
TerrainScaleMultiplier = new PGMTerrainXYZ(1.0f, 1.0f, 1.0f);
}
public static readonly DependencyProperty MapSeedProperty = DependencyProperty.Register(nameof(MapSeed), typeof(int), typeof(PGMTerrain), new PropertyMetadata(999));
[DataMember]
[AggregateIniValueEntry]
public int MapSeed
{
get { return (int)GetValue(MapSeedProperty); }
set { SetValue(MapSeedProperty, value); }
}
public static readonly DependencyProperty LandscapeRadiusProperty = DependencyProperty.Register(nameof(LandscapeRadius), typeof(float), typeof(PGMTerrain), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float LandscapeRadius
{
get { return (float)GetValue(LandscapeRadiusProperty); }
set { SetValue(LandscapeRadiusProperty, value); }
}
public static readonly DependencyProperty WaterFrequencyProperty = DependencyProperty.Register(nameof(WaterFrequency), typeof(float), typeof(PGMTerrain), new PropertyMetadata(5.0f));
[DataMember]
[AggregateIniValueEntry(Key = "Water Frequency")]
public float WaterFrequency
{
get { return (float)GetValue(WaterFrequencyProperty); }
set { SetValue(WaterFrequencyProperty, value); }
}
public static readonly DependencyProperty MountainsFrequencyProperty = DependencyProperty.Register(nameof(MountainsFrequency), typeof(float), typeof(PGMTerrain), new PropertyMetadata(12.0f));
[DataMember]
[AggregateIniValueEntry(Key = "Mountains Frequency")]
public float MountainsFrequency
{
get { return (float)GetValue(MountainsFrequencyProperty); }
set { SetValue(MountainsFrequencyProperty, value); }
}
public static readonly DependencyProperty MountainsSlopeProperty = DependencyProperty.Register(nameof(MountainsSlope), typeof(float), typeof(PGMTerrain), new PropertyMetadata(1.8f));
[DataMember]
[AggregateIniValueEntry(Key = "Mountains Slope")]
public float MountainsSlope
{
get { return (float)GetValue(MountainsSlopeProperty); }
set { SetValue(MountainsSlopeProperty, value); }
}
public static readonly DependencyProperty MountainsHeightProperty = DependencyProperty.Register(nameof(MountainsHeight), typeof(float), typeof(PGMTerrain), new PropertyMetadata(1.25f));
[DataMember]
[AggregateIniValueEntry]
public float MountainsHeight
{
get { return (float)GetValue(MountainsHeightProperty); }
set { SetValue(MountainsHeightProperty, value); }
}
public static readonly DependencyProperty TurbulencePowerProperty = DependencyProperty.Register(nameof(TurbulencePower), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.0125f));
[DataMember]
[AggregateIniValueEntry(Key = "Turbulence Power")]
public float TurbulencePower
{
get { return (float)GetValue(TurbulencePowerProperty); }
set { SetValue(TurbulencePowerProperty, value); }
}
public static readonly DependencyProperty ShoreSlopeProperty = DependencyProperty.Register(nameof(ShoreSlope), typeof(float), typeof(PGMTerrain), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry(Key = "Shore Slope")]
public float ShoreSlope
{
get { return (float)GetValue(ShoreSlopeProperty); }
set { SetValue(ShoreSlopeProperty, value); }
}
public static readonly DependencyProperty WaterLevelProperty = DependencyProperty.Register(nameof(WaterLevel), typeof(float), typeof(PGMTerrain), new PropertyMetadata(-0.72f));
[DataMember]
[AggregateIniValueEntry]
public float WaterLevel
{
get { return (float)GetValue(WaterLevelProperty); }
set { SetValue(WaterLevelProperty, value); }
}
public static readonly DependencyProperty ShoreLineEndProperty = DependencyProperty.Register(nameof(ShoreLineEnd), typeof(float), typeof(PGMTerrain), new PropertyMetadata(-0.715f));
[DataMember]
[AggregateIniValueEntry]
public float ShoreLineEnd
{
get { return (float)GetValue(ShoreLineEndProperty); }
set { SetValue(ShoreLineEndProperty, value); }
}
public static readonly DependencyProperty GrassDensityProperty = DependencyProperty.Register(nameof(GrassDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float GrassDensity
{
get { return (float)GetValue(GrassDensityProperty); }
set { SetValue(GrassDensityProperty, value); }
}
public static readonly DependencyProperty JungleGrassDensityProperty = DependencyProperty.Register(nameof(JungleGrassDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.02f));
[DataMember]
[AggregateIniValueEntry]
public float JungleGrassDensity
{
get { return (float)GetValue(JungleGrassDensityProperty); }
set { SetValue(JungleGrassDensityProperty, value); }
}
public static readonly DependencyProperty OceanFloorLevelProperty = DependencyProperty.Register(nameof(OceanFloorLevel), typeof(float), typeof(PGMTerrain), new PropertyMetadata(-1.0f));
[DataMember]
[AggregateIniValueEntry]
public float OceanFloorLevel
{
get { return (float)GetValue(OceanFloorLevelProperty); }
set { SetValue(OceanFloorLevelProperty, value); }
}
public static readonly DependencyProperty SnowBiomeSizeProperty = DependencyProperty.Register(nameof(SnowBiomeSize), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.3f));
[DataMember]
[AggregateIniValueEntry]
public float SnowBiomeSize
{
get { return (float)GetValue(SnowBiomeSizeProperty); }
set { SetValue(SnowBiomeSizeProperty, value); }
}
public static readonly DependencyProperty RedWoodBiomeSizeProperty = DependencyProperty.Register(nameof(RedWoodBiomeSize), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.075f));
[DataMember]
[AggregateIniValueEntry(Key = "RWBiomeSize")]
public float RedWoodBiomeSize
{
get { return (float)GetValue(RedWoodBiomeSizeProperty); }
set { SetValue(RedWoodBiomeSizeProperty, value); }
}
public static readonly DependencyProperty MountainBiomeStartProperty = DependencyProperty.Register(nameof(MountainBiomeStart), typeof(float), typeof(PGMTerrain), new PropertyMetadata(-0.55f));
[DataMember]
[AggregateIniValueEntry]
public float MountainBiomeStart
{
get { return (float)GetValue(MountainBiomeStartProperty); }
set { SetValue(MountainBiomeStartProperty, value); }
}
public static readonly DependencyProperty MountainsTreeDensityProperty = DependencyProperty.Register(nameof(MountainsTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.01f));
[DataMember]
[AggregateIniValueEntry]
public float MountainsTreeDensity
{
get { return (float)GetValue(MountainsTreeDensityProperty); }
set { SetValue(MountainsTreeDensityProperty, value); }
}
public static readonly DependencyProperty JungleBiomeStartProperty = DependencyProperty.Register(nameof(JungleBiomeStart), typeof(float), typeof(PGMTerrain), new PropertyMetadata(-0.65f));
[DataMember]
[AggregateIniValueEntry]
public float JungleBiomeStart
{
get { return (float)GetValue(JungleBiomeStartProperty); }
set { SetValue(JungleBiomeStartProperty, value); }
}
public static readonly DependencyProperty IslandBorderCurveExponentProperty = DependencyProperty.Register(nameof(IslandBorderCurveExponent), typeof(float), typeof(PGMTerrain), new PropertyMetadata(4.0f));
[DataMember]
[AggregateIniValueEntry(Key = "IslandBorderCurveExp")]
public float IslandBorderCurveExponent
{
get { return (float)GetValue(IslandBorderCurveExponentProperty); }
set { SetValue(IslandBorderCurveExponentProperty, value); }
}
public static readonly DependencyProperty MaxSpawnPointHeightProperty = DependencyProperty.Register(nameof(MaxSpawnPointHeight), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.1f));
[DataMember]
[AggregateIniValueEntry(Key = "MaxSawnPointHeight")]
public float MaxSpawnPointHeight
{
get { return (float)GetValue(MaxSpawnPointHeightProperty); }
set { SetValue(MaxSpawnPointHeightProperty, value); }
}
public static readonly DependencyProperty MountainGrassDensityProperty = DependencyProperty.Register(nameof(MountainGrassDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.05f));
[DataMember]
[AggregateIniValueEntry]
public float MountainGrassDensity
{
get { return (float)GetValue(MountainGrassDensityProperty); }
set { SetValue(MountainGrassDensityProperty, value); }
}
public static readonly DependencyProperty SnowMountainGrassDensityProperty = DependencyProperty.Register(nameof(SnowMountainGrassDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.15f));
[DataMember]
[AggregateIniValueEntry]
public float SnowMountainGrassDensity
{
get { return (float)GetValue(SnowMountainGrassDensityProperty); }
set { SetValue(SnowMountainGrassDensityProperty, value); }
}
public static readonly DependencyProperty SnowGrassDensityProperty = DependencyProperty.Register(nameof(SnowGrassDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.25f));
[DataMember]
[AggregateIniValueEntry]
public float SnowGrassDensity
{
get { return (float)GetValue(SnowGrassDensityProperty); }
set { SetValue(SnowGrassDensityProperty, value); }
}
public static readonly DependencyProperty UnderwaterObjectsDensityProperty = DependencyProperty.Register(nameof(UnderwaterObjectsDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.5f));
[DataMember]
[AggregateIniValueEntry]
public float UnderwaterObjectsDensity
{
get { return (float)GetValue(UnderwaterObjectsDensityProperty); }
set { SetValue(UnderwaterObjectsDensityProperty, value); }
}
public static readonly DependencyProperty SnowMountainsTreeDensityProperty = DependencyProperty.Register(nameof(SnowMountainsTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.01f));
[DataMember]
[AggregateIniValueEntry]
public float SnowMountainsTreeDensity
{
get { return (float)GetValue(SnowMountainsTreeDensityProperty); }
set { SetValue(SnowMountainsTreeDensityProperty, value); }
}
public static readonly DependencyProperty TreeDensityProperty = DependencyProperty.Register(nameof(TreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.003f));
[DataMember]
[AggregateIniValueEntry]
public float TreeDensity
{
get { return (float)GetValue(TreeDensityProperty); }
set { SetValue(TreeDensityProperty, value); }
}
public static readonly DependencyProperty JungleTreeDensityProperty = DependencyProperty.Register(nameof(JungleTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.66f));
[DataMember]
[AggregateIniValueEntry]
public float JungleTreeDensity
{
get { return (float)GetValue(JungleTreeDensityProperty); }
set { SetValue(JungleTreeDensityProperty, value); }
}
public static readonly DependencyProperty RedWoodTreeDensityProperty = DependencyProperty.Register(nameof(RedWoodTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.35f));
[DataMember]
[AggregateIniValueEntry]
public float RedWoodTreeDensity
{
get { return (float)GetValue(RedWoodTreeDensityProperty); }
set { SetValue(RedWoodTreeDensityProperty, value); }
}
public static readonly DependencyProperty SnowTreeDensityProperty = DependencyProperty.Register(nameof(SnowTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float SnowTreeDensity
{
get { return (float)GetValue(SnowTreeDensityProperty); }
set { SetValue(SnowTreeDensityProperty, value); }
}
public static readonly DependencyProperty RedwoodGrassDensityProperty = DependencyProperty.Register(nameof(RedwoodGrassDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.1f));
[DataMember]
[AggregateIniValueEntry]
public float RedwoodGrassDensity
{
get { return (float)GetValue(RedwoodGrassDensityProperty); }
set { SetValue(RedwoodGrassDensityProperty, value); }
}
public static readonly DependencyProperty ShoreTreeDensityProperty = DependencyProperty.Register(nameof(ShoreTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.05f));
[DataMember]
[AggregateIniValueEntry]
public float ShoreTreeDensity
{
get { return (float)GetValue(ShoreTreeDensityProperty); }
set { SetValue(ShoreTreeDensityProperty, value); }
}
public static readonly DependencyProperty SnowShoreTreeDensityProperty = DependencyProperty.Register(nameof(SnowShoreTreeDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.025f));
[DataMember]
[AggregateIniValueEntry]
public float SnowShoreTreeDensity
{
get { return (float)GetValue(SnowShoreTreeDensityProperty); }
set { SetValue(SnowShoreTreeDensityProperty, value); }
}
public static readonly DependencyProperty DeepWaterBiomesDepthProperty = DependencyProperty.Register(nameof(DeepWaterBiomesDepth), typeof(float), typeof(PGMTerrain), new PropertyMetadata(-0.24f));
[DataMember]
[AggregateIniValueEntry]
public float DeepWaterBiomesDepth
{
get { return (float)GetValue(DeepWaterBiomesDepthProperty); }
set { SetValue(DeepWaterBiomesDepthProperty, value); }
}
public static readonly DependencyProperty InlandWaterObjectsDensityProperty = DependencyProperty.Register(nameof(InlandWaterObjectsDensity), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.5f));
[DataMember]
[AggregateIniValueEntry]
public float InlandWaterObjectsDensity
{
get { return (float)GetValue(InlandWaterObjectsDensityProperty); }
set { SetValue(InlandWaterObjectsDensityProperty, value); }
}
public static readonly DependencyProperty ShorelineStartOffsetProperty = DependencyProperty.Register(nameof(ShorelineStartOffset), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.01f));
[DataMember]
[AggregateIniValueEntry]
public float ShorelineStartOffset
{
get { return (float)GetValue(ShorelineStartOffsetProperty); }
set { SetValue(ShorelineStartOffsetProperty, value); }
}
public static readonly DependencyProperty ShorelineThicknessProperty = DependencyProperty.Register(nameof(ShorelineThickness), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.0015f));
[DataMember]
[AggregateIniValueEntry]
public float ShorelineThickness
{
get { return (float)GetValue(ShorelineThicknessProperty); }
set { SetValue(ShorelineThicknessProperty, value); }
}
public static readonly DependencyProperty TreesGroundSlopeAccuracyProperty = DependencyProperty.Register(nameof(TreesGroundSlopeAccuracy), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.5f));
[DataMember]
[AggregateIniValueEntry]
public float TreesGroundSlopeAccuracy
{
get { return (float)GetValue(TreesGroundSlopeAccuracyProperty); }
set { SetValue(TreesGroundSlopeAccuracyProperty, value); }
}
public static readonly DependencyProperty ErosionStepsProperty = DependencyProperty.Register(nameof(ErosionSteps), typeof(int), typeof(PGMTerrain), new PropertyMetadata(4));
[DataMember]
[AggregateIniValueEntry]
public int ErosionSteps
{
get { return (int)GetValue(ErosionStepsProperty); }
set { SetValue(ErosionStepsProperty, value); }
}
public static readonly DependencyProperty ErosionStrengthProperty = DependencyProperty.Register(nameof(ErosionStrength), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.75f));
[DataMember]
[AggregateIniValueEntry]
public float ErosionStrength
{
get { return (float)GetValue(ErosionStrengthProperty); }
set { SetValue(ErosionStrengthProperty, value); }
}
public static readonly DependencyProperty DepositionStrengthProperty = DependencyProperty.Register(nameof(DepositionStrength), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.5f));
[DataMember]
[AggregateIniValueEntry]
public float DepositionStrength
{
get { return (float)GetValue(DepositionStrengthProperty); }
set { SetValue(DepositionStrengthProperty, value); }
}
public static readonly DependencyProperty MountainGeneralTreesPercentProperty = DependencyProperty.Register(nameof(MountainGeneralTreesPercent), typeof(float), typeof(PGMTerrain), new PropertyMetadata(0.1f));
[DataMember]
[AggregateIniValueEntry]
public float MountainGeneralTreesPercent
{
get { return (float)GetValue(MountainGeneralTreesPercentProperty); }
set { SetValue(MountainGeneralTreesPercentProperty, value); }
}
public static readonly DependencyProperty SnowBiomeLocationProperty = DependencyProperty.Register(nameof(SnowBiomeLocation), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SnowBiomeLocation
{
get { return (PGMTerrainXY)GetValue(SnowBiomeLocationProperty); }
set { SetValue(SnowBiomeLocationProperty, value); }
}
public static readonly DependencyProperty RedWoodForestBiomeLocationProperty = DependencyProperty.Register(nameof(RedWoodForestBiomeLocation), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry(Key = "RWForestBiomeLocation")]
public PGMTerrainXY RedWoodForestBiomeLocation
{
get { return (PGMTerrainXY)GetValue(RedWoodForestBiomeLocationProperty); }
set { SetValue(RedWoodForestBiomeLocationProperty, value); }
}
public static readonly DependencyProperty NorthRegion1StartProperty = DependencyProperty.Register(nameof(NorthRegion1Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY NorthRegion1Start
{
get { return (PGMTerrainXY)GetValue(NorthRegion1StartProperty); }
set { SetValue(NorthRegion1StartProperty, value); }
}
public static readonly DependencyProperty NorthRegion1EndProperty = DependencyProperty.Register(nameof(NorthRegion1End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY NorthRegion1End
{
get { return (PGMTerrainXY)GetValue(NorthRegion1EndProperty); }
set { SetValue(NorthRegion1EndProperty, value); }
}
public static readonly DependencyProperty NorthRegion2StartProperty = DependencyProperty.Register(nameof(NorthRegion2Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY NorthRegion2Start
{
get { return (PGMTerrainXY)GetValue(NorthRegion2StartProperty); }
set { SetValue(NorthRegion2StartProperty, value); }
}
public static readonly DependencyProperty NorthRegion2EndProperty = DependencyProperty.Register(nameof(NorthRegion2End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY NorthRegion2End
{
get { return (PGMTerrainXY)GetValue(NorthRegion2EndProperty); }
set { SetValue(NorthRegion2EndProperty, value); }
}
public static readonly DependencyProperty NorthRegion3StartProperty = DependencyProperty.Register(nameof(NorthRegion3Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY NorthRegion3Start
{
get { return (PGMTerrainXY)GetValue(NorthRegion3StartProperty); }
set { SetValue(NorthRegion3StartProperty, value); }
}
public static readonly DependencyProperty NorthRegion3EndProperty = DependencyProperty.Register(nameof(NorthRegion3End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY NorthRegion3End
{
get { return (PGMTerrainXY)GetValue(NorthRegion3EndProperty); }
set { SetValue(NorthRegion3EndProperty, value); }
}
public static readonly DependencyProperty SouthRegion1StartProperty = DependencyProperty.Register(nameof(SouthRegion1Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SouthRegion1Start
{
get { return (PGMTerrainXY)GetValue(SouthRegion1StartProperty); }
set { SetValue(SouthRegion1StartProperty, value); }
}
public static readonly DependencyProperty SouthRegion1EndProperty = DependencyProperty.Register(nameof(SouthRegion1End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SouthRegion1End
{
get { return (PGMTerrainXY)GetValue(SouthRegion1EndProperty); }
set { SetValue(SouthRegion1EndProperty, value); }
}
public static readonly DependencyProperty SouthRegion2StartProperty = DependencyProperty.Register(nameof(SouthRegion2Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SouthRegion2Start
{
get { return (PGMTerrainXY)GetValue(SouthRegion2StartProperty); }
set { SetValue(SouthRegion2StartProperty, value); }
}
public static readonly DependencyProperty SouthRegion2EndProperty = DependencyProperty.Register(nameof(SouthRegion2End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SouthRegion2End
{
get { return (PGMTerrainXY)GetValue(SouthRegion2EndProperty); }
set { SetValue(SouthRegion2EndProperty, value); }
}
public static readonly DependencyProperty SouthRegion3StartProperty = DependencyProperty.Register(nameof(SouthRegion3Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SouthRegion3Start
{
get { return (PGMTerrainXY)GetValue(SouthRegion3StartProperty); }
set { SetValue(SouthRegion3StartProperty, value); }
}
public static readonly DependencyProperty SouthRegion3EndProperty = DependencyProperty.Register(nameof(SouthRegion3End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY SouthRegion3End
{
get { return (PGMTerrainXY)GetValue(SouthRegion3EndProperty); }
set { SetValue(SouthRegion3EndProperty, value); }
}
public static readonly DependencyProperty EastRegion1StartProperty = DependencyProperty.Register(nameof(EastRegion1Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY EastRegion1Start
{
get { return (PGMTerrainXY)GetValue(EastRegion1StartProperty); }
set { SetValue(EastRegion1StartProperty, value); }
}
public static readonly DependencyProperty EastRegion1EndProperty = DependencyProperty.Register(nameof(EastRegion1End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY EastRegion1End
{
get { return (PGMTerrainXY)GetValue(EastRegion1EndProperty); }
set { SetValue(EastRegion1EndProperty, value); }
}
public static readonly DependencyProperty EastRegion2StartProperty = DependencyProperty.Register(nameof(EastRegion2Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY EastRegion2Start
{
get { return (PGMTerrainXY)GetValue(EastRegion2StartProperty); }
set { SetValue(EastRegion2StartProperty, value); }
}
public static readonly DependencyProperty EastRegion2EndProperty = DependencyProperty.Register(nameof(EastRegion2End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY EastRegion2End
{
get { return (PGMTerrainXY)GetValue(EastRegion2EndProperty); }
set { SetValue(EastRegion2EndProperty, value); }
}
public static readonly DependencyProperty EastRegion3StartProperty = DependencyProperty.Register(nameof(EastRegion3Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY EastRegion3Start
{
get { return (PGMTerrainXY)GetValue(EastRegion3StartProperty); }
set { SetValue(EastRegion3StartProperty, value); }
}
public static readonly DependencyProperty EastRegion3EndProperty = DependencyProperty.Register(nameof(EastRegion3End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY EastRegion3End
{
get { return (PGMTerrainXY)GetValue(EastRegion3EndProperty); }
set { SetValue(EastRegion3EndProperty, value); }
}
public static readonly DependencyProperty WestRegion1StartProperty = DependencyProperty.Register(nameof(WestRegion1Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY WestRegion1Start
{
get { return (PGMTerrainXY)GetValue(WestRegion1StartProperty); }
set { SetValue(WestRegion1StartProperty, value); }
}
public static readonly DependencyProperty WestRegion1EndProperty = DependencyProperty.Register(nameof(WestRegion1End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY WestRegion1End
{
get { return (PGMTerrainXY)GetValue(WestRegion1EndProperty); }
set { SetValue(WestRegion1EndProperty, value); }
}
public static readonly DependencyProperty WestRegion2StartProperty = DependencyProperty.Register(nameof(WestRegion2Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY WestRegion2Start
{
get { return (PGMTerrainXY)GetValue(WestRegion2StartProperty); }
set { SetValue(WestRegion2StartProperty, value); }
}
public static readonly DependencyProperty WestRegion2EndProperty = DependencyProperty.Register(nameof(WestRegion2End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY WestRegion2End
{
get { return (PGMTerrainXY)GetValue(WestRegion2EndProperty); }
set { SetValue(WestRegion2EndProperty, value); }
}
public static readonly DependencyProperty WestRegion3StartProperty = DependencyProperty.Register(nameof(WestRegion3Start), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY WestRegion3Start
{
get { return (PGMTerrainXY)GetValue(WestRegion3StartProperty); }
set { SetValue(WestRegion3StartProperty, value); }
}
public static readonly DependencyProperty WestRegion3EndProperty = DependencyProperty.Register(nameof(WestRegion3End), typeof(PGMTerrainXY), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXY WestRegion3End
{
get { return (PGMTerrainXY)GetValue(WestRegion3EndProperty); }
set { SetValue(WestRegion3EndProperty, value); }
}
public static readonly DependencyProperty TerrainScaleMultiplierProperty = DependencyProperty.Register(nameof(TerrainScaleMultiplier), typeof(PGMTerrainXYZ), typeof(PGMTerrain), new PropertyMetadata(null));
[DataMember]
[AggregateIniValueEntry]
public PGMTerrainXYZ TerrainScaleMultiplier
{
get { return (PGMTerrainXYZ)GetValue(TerrainScaleMultiplierProperty); }
set { SetValue(TerrainScaleMultiplierProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
if (string.IsNullOrWhiteSpace(value))
return;
GetPropertyInfos();
if (this.Properties.Count == 0)
return;
value = value.Trim('(', ')', ' ');
var pairs = value.Split(DELIMITER);
foreach (var pair in pairs)
{
var kvPair = pair.Split(new[] { '=' }, 2);
if (kvPair.Length != 2)
continue;
var key = kvPair[0].Trim();
var val = kvPair[1].Trim();
var propInfo = this.Properties.FirstOrDefault(p => string.Equals(p.Name, key, StringComparison.OrdinalIgnoreCase));
if (propInfo != null)
StringUtils.SetPropertyValue(val, this, propInfo);
else
{
propInfo = this.Properties.FirstOrDefault(f => f.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().Any(a => string.Equals(a.Key, key, StringComparison.OrdinalIgnoreCase)));
if (propInfo != null)
StringUtils.SetPropertyValue(val, this, propInfo);
}
}
}
public override string ToINIValue()
{
GetPropertyInfos();
if (this.Properties.Count == 0)
return string.Empty;
var result = new StringBuilder();
var delimiter = "";
foreach (var prop in this.Properties)
{
result.Append(delimiter);
var attr = prop.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().FirstOrDefault();
var propName = string.IsNullOrWhiteSpace(attr?.Key) ? prop.Name : attr.Key;
var val = prop.GetValue(this);
var propValue = StringUtils.GetPropertyValue(val, prop);
result.Append($"{propName}={propValue}");
delimiter = DELIMITER.ToString();
}
return result.ToString();
}
}
[DataContract]
public class PGMTerrainXY : AggregateIniValue
{
public PGMTerrainXY()
{
}
public PGMTerrainXY(float x, float y)
{
X = x;
Y = y;
}
public static readonly DependencyProperty XProperty = DependencyProperty.Register(nameof(X), typeof(float), typeof(PGMTerrainXY), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float X
{
get { return (float)GetValue(XProperty); }
set { SetValue(XProperty, value); }
}
public static readonly DependencyProperty YProperty = DependencyProperty.Register(nameof(Y), typeof(float), typeof(PGMTerrainXY), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float Y
{
get { return (float)GetValue(YProperty); }
set { SetValue(YProperty, value); }
}
public override string GetSortKey()
{
return null;
}
public override bool IsEquivalent(AggregateIniValue other)
{
return false;
}
public override void InitializeFromINIValue(string value)
{
if (string.IsNullOrWhiteSpace(value))
return;
GetPropertyInfos();
if (this.Properties.Count == 0)
return;
value = value.Trim('(', ')', ' ');
var pairs = value.Split(DELIMITER);
foreach (var pair in pairs)
{
var kvPair = pair.Split(new[] { '=' }, 2);
if (kvPair.Length != 2)
continue;
var key = kvPair[0].Trim();
var val = kvPair[1].Trim();
var propInfo = this.Properties.FirstOrDefault(p => string.Equals(p.Name, key, StringComparison.OrdinalIgnoreCase));
if (propInfo != null)
StringUtils.SetPropertyValue(val, this, propInfo);
else
{
propInfo = this.Properties.FirstOrDefault(f => f.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().Any(a => string.Equals(a.Key, key, StringComparison.OrdinalIgnoreCase)));
if (propInfo != null)
StringUtils.SetPropertyValue(val, this, propInfo);
}
}
}
public override string ToINIValue()
{
GetPropertyInfos();
if (this.Properties.Count == 0)
return string.Empty;
var result = new StringBuilder();
result.Append("(");
var delimiter = "";
foreach (var prop in this.Properties.OrderBy(p => p.Name))
{
result.Append(delimiter);
var attr = prop.GetCustomAttributes(typeof(AggregateIniValueEntryAttribute), false).OfType<AggregateIniValueEntryAttribute>().FirstOrDefault();
var propName = string.IsNullOrWhiteSpace(attr?.Key) ? prop.Name : attr.Key;
var val = prop.GetValue(this);
var propValue = StringUtils.GetPropertyValue(val, prop);
result.Append($"{propName}={propValue}");
delimiter = DELIMITER.ToString();
}
result.Append(")");
return result.ToString();
}
}
[DataContract]
public class PGMTerrainXYZ : PGMTerrainXY
{
public PGMTerrainXYZ()
{
}
public PGMTerrainXYZ(float x, float y, float z)
: base(x, y)
{
Z = z;
}
public static readonly DependencyProperty ZProperty = DependencyProperty.Register(nameof(Z), typeof(float), typeof(PGMTerrainXYZ), new PropertyMetadata(1.0f));
[DataMember]
[AggregateIniValueEntry]
public float Z
{
get { return (float)GetValue(ZProperty); }
set { SetValue(ZProperty, value); }
}
}
}

View file

@ -0,0 +1,33 @@
using System.Windows;
namespace ServerManagerTool.Lib
{
public class PlayerListParameters : DependencyObject
{
public static readonly DependencyProperty ProfileNameProperty = DependencyProperty.Register(nameof(ProfileName), typeof(string), typeof(PlayerListParameters), new PropertyMetadata(string.Empty));
public string ProfileName
{
get { return (string)GetValue(ProfileNameProperty); }
set { SetValue(ProfileNameProperty, value); }
}
public string ProfileId { get; set; }
public string InstallDirectory { get; set; }
public string AltSaveDirectoryName { get; set; }
public bool PGM_Enabled { get; set; }
public string PGM_Name { get; set; }
public Server Server { get; set; }
public string ServerMap { get; set; }
public Rect WindowExtents { get; set; }
public string WindowTitle { get; set; }
}
}

View file

@ -0,0 +1,503 @@
using ServerManagerTool.Common.Model;
using ServerManagerTool.Utils;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using WPFSharp.Globalizer;
namespace ServerManagerTool.Lib.Model
{
public class ModDetailList : ObservableCollection<ModDetail>
{
public bool AnyUnknownModTypes
{
get
{
return this.Any(m => !m.IsValidModType);
}
}
public new void Add(ModDetail mod)
{
if (mod == null || this.Any(m => m.ModId.Equals(mod.ModId)))
return;
base.Add(mod);
SetPublishedFileIndex();
}
public void AddRange(ModDetail[] mods)
{
foreach (var mod in mods)
{
if (mod == null || this.Any(m => m.ModId.Equals(mod.ModId)))
continue;
base.Add(mod);
}
SetPublishedFileIndex();
}
public new void Insert(int index, ModDetail mod)
{
if (mod == null || this.Any(m => m.ModId.Equals(mod.ModId)))
return;
base.Insert(index, mod);
SetPublishedFileIndex();
}
public void Move(ModDetail mod, int newIndex)
{
if (mod == null)
return;
var index = base.IndexOf(mod);
if (index <= 0)
return;
base.Move(index, newIndex);
SetPublishedFileIndex();
}
public void MoveDown(ModDetail mod)
{
if (mod == null)
return;
var index = base.IndexOf(mod);
if (index >= base.Count - 1)
return;
base.Move(index, index + 1);
SetPublishedFileIndex();
}
public void MoveUp(ModDetail mod)
{
if (mod == null)
return;
var index = base.IndexOf(mod);
if (index <= 0)
return;
base.Move(index, index - 1);
SetPublishedFileIndex();
}
public void PopulateExtended(string modsRootFolder)
{
var results = new Dictionary<ModDetail, ModDetailExtended>();
foreach (var mod in this)
{
results.Add(mod, new ModDetailExtended(mod.ModId));
}
Parallel.ForEach(results, kvp => kvp.Value.PopulateExtended(modsRootFolder));
foreach (var kvp in results)
{
kvp.Key.PopulateExtended(kvp.Value);
}
}
public new bool Remove(ModDetail mod)
{
if (mod == null)
return false;
var removed = base.Remove(mod);
SetPublishedFileIndex();
return removed;
}
public void SetPublishedFileIndex()
{
foreach (var mod in this)
{
mod.Index = base.IndexOf(mod) + 1;
mod.IsFirst = false;
mod.IsLast = false;
}
if (this.Count == 0)
return;
this[0].IsFirst = true;
this[base.Count - 1].IsLast = true;
}
public bool GetModStrings(out string mapString, out string totalConversionString, out string modIdString)
{
mapString = null;
totalConversionString = null;
modIdString = string.Empty;
var delimiter = "";
foreach (var mod in this)
{
switch (mod.ModType)
{
case ModUtils.MODTYPE_MAP:
mapString = $"/Game/Mods/{mod.ModId}/{mod.MapName}";
break;
case ModUtils.MODTYPE_TOTCONV:
totalConversionString = mod.ModId;
break;
case ModUtils.MODTYPE_MAPEXT:
case ModUtils.MODTYPE_MOD:
default:
modIdString += $"{delimiter}{mod.ModId}";
delimiter = ",";
break;
}
}
return true;
}
public static ModDetailList GetModDetails(List<string> modIdList, string modsRootFolder, WorkshopFileList workshopFiles, PublishedFileDetailsResponse response)
{
var result = new ModDetailList();
if (modIdList != null)
{
foreach (var modId in modIdList)
{
var temp = workshopFiles?.FirstOrDefault(w => w.WorkshopId.Equals(modId));
result.Add(new ModDetail()
{
AppId = temp?.AppId ?? string.Empty,
ModId = modId,
TimeUpdated = -1,
Title = temp?.Title ?? "Mod name not available",
IsValid = false,
});
}
}
if (response?.publishedfiledetails != null)
{
foreach (var item in result)
{
var temp = response.publishedfiledetails.FirstOrDefault(w => w.publishedfileid.Equals(item.ModId));
if (temp != null)
{
item.AppId = temp?.creator_app_id ?? string.Empty;
item.ModId = temp?.publishedfileid ?? item.ModId;
item.TimeUpdated = temp?.time_updated ?? item.TimeUpdated;
item.Title = temp?.title ?? item.Title;
item.IsValid = temp?.creator_app_id != null;
}
}
}
result.SetPublishedFileIndex();
result.PopulateExtended(modsRootFolder);
return result;
}
public override string ToString()
{
return $"{nameof(ModDetailList)} - {Count}";
}
}
public class ModDetail : DependencyObject
{
private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
public static readonly DependencyProperty AppIdProperty = DependencyProperty.Register(nameof(AppId), typeof(string), typeof(ModDetail), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty IndexProperty = DependencyProperty.Register(nameof(Index), typeof(int), typeof(ModDetail), new PropertyMetadata(0));
public static readonly DependencyProperty IsFirstProperty = DependencyProperty.Register(nameof(IsFirst), typeof(bool), typeof(ModDetail), new PropertyMetadata(false));
public static readonly DependencyProperty IsLastProperty = DependencyProperty.Register(nameof(IsLast), typeof(bool), typeof(ModDetail), new PropertyMetadata(false));
public static readonly DependencyProperty LastWriteTimeProperty = DependencyProperty.Register(nameof(LastWriteTime), typeof(DateTime), typeof(ModDetail), new PropertyMetadata(DateTime.MinValue));
public static readonly DependencyProperty LastTimeUpdatedProperty = DependencyProperty.Register(nameof(LastTimeUpdated), typeof(int), typeof(ModDetail), new PropertyMetadata(0));
public static readonly DependencyProperty ModIdProperty = DependencyProperty.Register(nameof(ModId), typeof(string), typeof(ModDetail), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty ModTypeProperty = DependencyProperty.Register(nameof(ModType), typeof(string), typeof(ModDetail), new PropertyMetadata(ModUtils.MODTYPE_UNKNOWN));
public static readonly DependencyProperty ModTypeStringProperty = DependencyProperty.Register(nameof(ModTypeString), typeof(string), typeof(ModDetail), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty ModUrlProperty = DependencyProperty.Register(nameof(ModUrl), typeof(string), typeof(ModDetail), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty TimeUpdatedProperty = DependencyProperty.Register(nameof(TimeUpdated), typeof(int), typeof(ModDetail), new PropertyMetadata(0));
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(nameof(Title), typeof(string), typeof(ModDetail), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty IsValidProperty = DependencyProperty.Register(nameof(IsValid), typeof(bool), typeof(ModDetail), new PropertyMetadata(false));
public string AppId
{
get { return (string)GetValue(AppIdProperty); }
set { SetValue(AppIdProperty, value); }
}
public int Index
{
get { return (int)GetValue(IndexProperty); }
set { SetValue(IndexProperty, value); }
}
public bool IsFirst
{
get { return (bool)GetValue(IsFirstProperty); }
set { SetValue(IsFirstProperty, value); }
}
public bool IsLast
{
get { return (bool)GetValue(IsLastProperty); }
set { SetValue(IsLastProperty, value); }
}
public DateTime LastWriteTime
{
get { return (DateTime)GetValue(LastWriteTimeProperty); }
set { SetValue(LastWriteTimeProperty, value); }
}
public int LastTimeUpdated
{
get { return (int)GetValue(LastTimeUpdatedProperty); }
set { SetValue(LastTimeUpdatedProperty, value); }
}
public string ModId
{
get { return (string)GetValue(ModIdProperty); }
set { SetValue(ModIdProperty, value); }
}
public string ModType
{
get { return (string)GetValue(ModTypeProperty); }
set
{
SetValue(ModTypeProperty, value);
SetModTypeString();
}
}
public string ModTypeString
{
get { return (string)GetValue(ModTypeStringProperty); }
set { SetValue(ModTypeStringProperty, value); }
}
public int TimeUpdated
{
get { return (int)GetValue(TimeUpdatedProperty); }
set { SetValue(TimeUpdatedProperty, value); }
}
public string Title
{
get { return (string)GetValue(TitleProperty); }
set
{
SetValue(TitleProperty, value);
TitleFilterString = value?.ToLower();
}
}
public bool IsValid
{
get { return (bool)GetValue(IsValidProperty); }
set { SetValue(IsValidProperty, value); }
}
public bool IsOfficialMod => ModUtils.IsOfficialMod(ModId);
public bool IsValidModType => !string.IsNullOrWhiteSpace(ModType) && (ModType.Equals(ModUtils.MODTYPE_MAP) || ModType.Equals(ModUtils.MODTYPE_MAPEXT) || ModType.Equals(ModUtils.MODTYPE_MOD) || ModType.Equals(ModUtils.MODTYPE_TOTCONV));
public string LastWriteTimeString => LastWriteTime == DateTime.MinValue ? string.Empty : LastWriteTime.ToString();
public string LastWriteTimeSortString => LastWriteTime == DateTime.MinValue ? string.Empty : LastWriteTime.ToString("yyyyMMdd_HHmmss");
public string MapName { get; set; }
public string ModUrl => $"http://steamcommunity.com/sharedfiles/filedetails/?id={ModId}";
public string TimeUpdatedString => TimeUpdated <= 0 ? string.Empty : ModUtils.UnixTimeStampToDateTime(TimeUpdated).ToString();
public string TimeUpdatedSortString => TimeUpdated <= 0 ? string.Empty : ModUtils.UnixTimeStampToDateTime(TimeUpdated).ToString("yyyyMMdd_HHmmss");
public string TitleFilterString
{
get;
private set;
}
public bool UpToDate => !IsValid && TimeUpdated == -1 || LastTimeUpdated > 0 && LastTimeUpdated == TimeUpdated;
public long FolderSize { get; set; }
public string FolderSizeString
{
get
{
// GB
var divisor = Math.Pow(1024, 3);
if (FolderSize > divisor)
return $"{FolderSize / divisor:N2} GB";
// MB
divisor = Math.Pow(1024, 2);
if (FolderSize > divisor)
return $"{FolderSize / divisor:N2} MB";
// KB
divisor = Math.Pow(1024, 1);
if (FolderSize > divisor)
return $"{FolderSize / divisor:N2} KB";
return $"{FolderSize} B";
}
}
public void PopulateExtended(string modsRootFolder)
{
var modExtended = new ModDetailExtended(ModId);
modExtended.PopulateExtended(modsRootFolder);
PopulateExtended(modExtended);
}
public void PopulateExtended(ModDetailExtended extended)
{
LastTimeUpdated = extended.LastTimeUpdated;
LastWriteTime = extended.LastWriteTime;
MapName = extended.MapName;
ModType = extended.ModType;
FolderSize = extended.FolderSize;
}
public void SetModTypeString()
{
if (string.IsNullOrWhiteSpace(ModType))
ModTypeString = _globalizer.GetResourceString("ModType_Unknown");
switch (ModType)
{
case ModUtils.MODTYPE_MAP:
ModTypeString = _globalizer.GetResourceString("ModType_Map");
break;
case ModUtils.MODTYPE_MAPEXT:
ModTypeString = _globalizer.GetResourceString("ModType_MapExtension");
break;
case ModUtils.MODTYPE_MOD:
ModTypeString = _globalizer.GetResourceString("ModType_Mod");
break;
case ModUtils.MODTYPE_TOTCONV:
ModTypeString = _globalizer.GetResourceString("ModType_TotalConversion");
break;
default:
if (string.IsNullOrWhiteSpace(AppId))
ModTypeString = _globalizer.GetResourceString("ModType_Unknown");
else
ModTypeString = _globalizer.GetResourceString("ModType_NotDownloaded");
break;
}
}
public static ModDetail GetModDetail(PublishedFileDetail detail)
{
var result = new ModDetail();
result.AppId = detail.creator_app_id;
result.ModId = detail.publishedfileid;
result.TimeUpdated = detail.time_updated;
result.Title = detail.title;
result.IsValid = true;
return result;
}
public static ModDetail GetModDetail(WorkshopFileDetail detail)
{
var result = new ModDetail();
result.AppId = detail.creator_appid;
result.ModId = detail.publishedfileid;
result.TimeUpdated = detail.time_updated;
result.Title = detail.title;
result.IsValid = true;
return result;
}
public static ModDetail GetModDetail(WorkshopFileItem detail)
{
var result = new ModDetail();
result.AppId = detail.AppId;
result.ModId = detail.WorkshopId;
result.TimeUpdated = detail.TimeUpdated;
result.Title = detail.Title;
result.IsValid = true;
return result;
}
public override string ToString()
{
return $"{ModId} - {Title}";
}
}
public class ModDetailExtended
{
public ModDetailExtended(string modId)
{
ModId = modId;
}
public string MapName { get; set; }
private string ModId { get; set; }
public string ModType { get; set; }
public DateTime LastWriteTime { get; set; }
public int LastTimeUpdated { get; set; }
public long FolderSize { get; set; }
public void PopulateExtended(string modsRootFolder)
{
try
{
var modFolder = Path.Combine(modsRootFolder, ModId);
var modFile = $"{modFolder}.mod";
if (string.IsNullOrWhiteSpace(modFolder) || !Directory.Exists(modFolder))
return;
if (string.IsNullOrWhiteSpace(modFile) || !File.Exists(modFile))
return;
LastWriteTime = File.GetLastWriteTime(modFile);
var modTimeFile = Path.Combine(modFolder, Config.Default.LastUpdatedTimeFile);
if (!string.IsNullOrWhiteSpace(modTimeFile) && File.Exists(modTimeFile))
{
LastTimeUpdated = ModUtils.GetModLatestTime(modTimeFile);
}
ModUtils.ReadModFile(modFile, out string modId, out Dictionary<string, string> metaInformation, out List<string> mapNames);
ModType = metaInformation != null && metaInformation.ContainsKey("ModType") ? metaInformation["ModType"] : ModUtils.MODTYPE_UNKNOWN;
MapName = mapNames != null && mapNames.Count > 0 ? mapNames[0] : string.Empty;
FolderSize = 0;
foreach (var file in new DirectoryInfo(modFolder).GetFiles("*.*", SearchOption.AllDirectories))
{
FolderSize += file.Length;
}
}
catch (Exception)
{
// do nothing
}
}
}
}

View file

@ -0,0 +1,40 @@
using System.Net;
using System.Windows;
namespace ServerManagerTool.Lib
{
public class RCONParameters : PlayerListParameters
{
public static readonly DependencyProperty MaxPlayersProperty = DependencyProperty.Register(nameof(MaxPlayers), typeof(int), typeof(RCONParameters), new PropertyMetadata(0));
public string RCONHost { get; set; }
public IPAddress RCONHostIP
{
get
{
try
{
var ipAddresses = Dns.GetHostAddresses(RCONHost);
if (ipAddresses.Length > 0)
return ipAddresses[0].MapToIPv4();
}
catch {}
return IPAddress.None;
}
}
public int RCONPort { get; set; }
public string AdminPassword { get; set; }
public int MaxPlayers
{
get { return (int)GetValue(MaxPlayersProperty); }
set { SetValue(MaxPlayersProperty, value); }
}
public double PlayerListWidth { get; set; }
}
}

View file

@ -0,0 +1,105 @@
using ServerManagerTool.Common.Model;
using ServerManagerTool.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Windows;
namespace ServerManagerTool.Lib
{
[DataContract]
public class ResourceClassMultiplierList : AggregateIniValueList<ResourceClassMultiplier>
{
public ResourceClassMultiplierList(string aggregateValueName, Func<IEnumerable<ResourceClassMultiplier>> resetFunc)
: base(aggregateValueName, resetFunc)
{
}
public override void FromIniValues(IEnumerable<string> iniValues)
{
var items = iniValues?.Select(AggregateIniValue.FromINIValue<ResourceClassMultiplier>).ToArray();
Clear();
if (this._resetFunc != null)
this.AddRange(this._resetFunc());
var itemsToAdd = items.Where(i => !this.Any(r => r.IsEquivalent(i))).ToArray();
AddRange(itemsToAdd);
var itemsToUpdate = items.Where(i => this.Any(r => r.IsEquivalent(i))).ToArray();
foreach (var item in itemsToUpdate)
{
this.FirstOrDefault(r => r.IsEquivalent(item)).Multiplier = item.Multiplier;
}
IsEnabled = (items.Length > 0);
Sort(AggregateIniValue.SortKeySelector);
}
public override IEnumerable<string> ToIniValues()
{
if (string.IsNullOrWhiteSpace(IniCollectionKey))
return this.Where(d => d.ShouldSave()).Select(d => d.ToINIValue());
return this.Where(d => d.ShouldSave()).Select(d => $"{this.IniCollectionKey}={d.ToINIValue()}");
}
}
[DataContract]
public class ResourceClassMultiplier : ClassMultiplier
{
public static readonly DependencyProperty ModProperty = DependencyProperty.Register(nameof(Mod), typeof(string), typeof(ResourceClassMultiplier), new PropertyMetadata(String.Empty));
public static readonly DependencyProperty KnownResourceProperty = DependencyProperty.Register(nameof(KnownResource), typeof(bool), typeof(ResourceClassMultiplier), new PropertyMetadata(false));
[DataMember]
public string Mod
{
get { return (string)GetValue(ModProperty); }
set { SetValue(ModProperty, value); }
}
public bool KnownResource
{
get { return (bool)GetValue(KnownResourceProperty); }
set { SetValue(KnownResourceProperty, value); }
}
public override string DisplayName => GameData.FriendlyResourceNameForClass(ClassName);
public string DisplayMod => GameData.FriendlyNameForClass($"Mod_{Mod}", true) ?? Mod;
public new static ResourceClassMultiplier FromINIValue(string iniValue)
{
var newSpawn = new ResourceClassMultiplier();
newSpawn.InitializeFromINIValue(iniValue);
return newSpawn;
}
public override string GetSortKey()
{
return $"{DisplayName}|Mod";
}
public override void InitializeFromINIValue(string value)
{
base.InitializeFromINIValue(value);
if (!KnownResource)
Mod = GameData.MOD_UNKNOWN;
}
public override bool ShouldSave()
{
if (!KnownResource)
return true;
var resource = GameData.GetResourceMultiplierForClass(ClassName);
if (resource == null)
return true;
return (!resource.Multiplier.Equals(Multiplier));
}
}
}

Some files were not shown because too many files have changed in this diff Show more