Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ArkBot.Tests/ArkBot.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -34,6 +35,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
Expand Down
15 changes: 13 additions & 2 deletions ArkBot.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2003
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArkBot", "ArkBot\ArkBot.csproj", "{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}"
EndProject
Expand All @@ -10,17 +10,28 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Debug|x64.ActiveCfg = Debug|x64
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Debug|x64.Build.0 = Debug|x64
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Release|Any CPU.Build.0 = Release|Any CPU
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Release|x64.ActiveCfg = Release|x64
{BB61C4D0-0060-401B-BF8F-4747CBD86D9D}.Release|x64.Build.0 = Release|x64
{F302C35B-97B4-4E9A-B628-F17FE7DB8A45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F302C35B-97B4-4E9A-B628-F17FE7DB8A45}.Debug|x64.ActiveCfg = Debug|x64
{F302C35B-97B4-4E9A-B628-F17FE7DB8A45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F302C35B-97B4-4E9A-B628-F17FE7DB8A45}.Release|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CAF3F7A8-BCB0-4EEA-9730-DF724C1C6C2C}
EndGlobalSection
EndGlobal
7 changes: 6 additions & 1 deletion ArkBot/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<Application x:Class="ArkBot.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ArkBot"
StartupUri="MainWindow.xaml">
<Application.Resources>

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes\CollectionControlDialog.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
11 changes: 11 additions & 0 deletions ArkBot/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using CefSharp;

namespace ArkBot
{
Expand All @@ -23,6 +25,15 @@ public App()
Console.SetOut(new WpfConsoleWriter());

Kernel32.RegisterApplicationRestart("/restart", (int)RestartRestrictions.None);

var settings = new CefSettings()
{
//LogSeverity = LogSeverity.Verbose,
LogFile = "logs\\cefsharp.log",
BrowserSubprocessPath = "lib\\CefSharp.BrowserSubprocess.exe",
};

Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
Expand Down
3 changes: 2 additions & 1 deletion ArkBot/Ark/ArkClusterContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ArkBot.Services;
using ArkBot.Configuration.Model;
using ArkBot.Services;
using ArkSavegameToolkitNet;
using ArkSavegameToolkitNet.Domain;
using System;
Expand Down
7 changes: 4 additions & 3 deletions ArkBot/Ark/ArkContextManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ArkBot.Services;
using ArkBot.Configuration.Model;
using ArkBot.Services;
using ArkBot.Services.Data;
using ArkBot.Threading;
using ArkSavegameToolkitNet;
Expand Down Expand Up @@ -89,7 +90,7 @@ private void _saveFileWatcher_Changed(ArkServerContext serverContext, ArkSaveFil
{
QueueServerUpdate(serverContext);

var clusterContext = GetCluster(serverContext.Config.Cluster);
var clusterContext = GetCluster(serverContext.Config.ClusterKey);
if (clusterContext == null) return;
QueueClusterUpdate(clusterContext);
}
Expand Down Expand Up @@ -225,7 +226,7 @@ public ArkServerContext[] GetServersInCluster(string key)
{
if (key == null) return null;

return Servers.Where(x => x.Config.Cluster.Equals(key, StringComparison.OrdinalIgnoreCase)).ToArray();
return Servers.Where(x => x.Config.ClusterKey.Equals(key, StringComparison.OrdinalIgnoreCase)).ToArray();
}

public ArkClusterContext GetCluster(string key)
Expand Down
9 changes: 5 additions & 4 deletions ArkBot/Ark/ArkServerContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ArkBot.Database.Model;
using ArkBot.Configuration.Model;
using ArkBot.Database.Model;
using ArkBot.Services;
using ArkBot.Services.Data;
using ArkBot.Steam;
Expand Down Expand Up @@ -166,15 +167,15 @@ public bool Update(bool manualUpdate, IConfig fullconfig, ISavegameBackupService
SavegameBackupResult bresult = null;
try
{
if (fullconfig.BackupsEnabled)
if (fullconfig.Backups.BackupsEnabled)
{
bresult = savegameBackupService.CreateBackup(Config, _contextManager?.GetCluster(Config.Cluster)?.Config);
bresult = savegameBackupService.CreateBackup(Config, _contextManager?.GetCluster(Config.ClusterKey)?.Config);
if (bresult != null && bresult.ArchivePaths != null) progress.Report($@"Server ({Config.Key}): Backup successfull ({(string.Join(", ", bresult.ArchivePaths.Select(x => $@"""{x}""")))})!");
else progress.Report($"Server ({Config.Key}): Backup failed...");
}
}
catch (Exception ex) { Logging.LogException($"Server ({Config.Key}): Backup failed", ex, typeof(ArkServerContext), LogLevel.ERROR, ExceptionLevel.Ignored); }
BackupCompleted?.Invoke(this, fullconfig.BackupsEnabled, bresult);
BackupCompleted?.Invoke(this, fullconfig.Backups.BackupsEnabled, bresult);
}


Expand Down
3 changes: 2 additions & 1 deletion ArkBot/Ark/IArkUpdateableContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ArkBot.Services;
using ArkBot.Configuration.Model;
using ArkBot.Services;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
Loading