.
This commit is contained in:
+7
-1
@@ -1,20 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36408.4 d17.14
|
||||
VisualStudioVersion = 17.14.36408.4
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lithium", "Lithium\Lithium.csproj", "{71516142-7D3E-46A1-A6EC-E242CD128DB1}"
|
||||
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
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Debug|x64.Build.0 = Debug|x64
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Release|x64.ActiveCfg = Release|x64
|
||||
{71516142-7D3E-46A1-A6EC-E242CD128DB1}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
|
||||
namespace Lithium
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace Lua
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Lua;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Lithium
|
||||
|
||||
@@ -54,6 +54,26 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>A1\a23ae8c4c6863364165637fb70679eb3.ico</ApplicationIcon>
|
||||
</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>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
|
||||
+39
-5
@@ -31,6 +31,16 @@ namespace Lua
|
||||
// AA0058
|
||||
public static bool onAttackers = true;
|
||||
|
||||
private static string CacheDirectory =>
|
||||
System.IO.Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
||||
"coax"
|
||||
);
|
||||
|
||||
private static string CacheFile =>
|
||||
System.IO.Path.Combine(CacheDirectory, "config_cache.txt");
|
||||
|
||||
|
||||
// AA0059
|
||||
private static string OnlineConfigUrl =>
|
||||
string.IsNullOrEmpty(ConfigLoader.userName)
|
||||
@@ -96,8 +106,12 @@ namespace Lua
|
||||
defenderNames.Clear();
|
||||
|
||||
var allLines = new List<string>();
|
||||
bool loadedOnline = false;
|
||||
|
||||
// AA0066
|
||||
// Ensure coax folder exists
|
||||
try { System.IO.Directory.CreateDirectory(CacheDirectory); } catch { }
|
||||
|
||||
// Try loading from online source
|
||||
if (allowOnlineFetch && !string.IsNullOrEmpty(OnlineConfigUrl))
|
||||
{
|
||||
try
|
||||
@@ -105,14 +119,33 @@ namespace Lua
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
string txt = client.GetStringAsync(OnlineConfigUrl).Result;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(txt))
|
||||
{
|
||||
allLines.AddRange(txt.Split('\n'));
|
||||
|
||||
// Save cache file in per-user coax folder
|
||||
System.IO.File.WriteAllText(CacheFile, txt);
|
||||
|
||||
loadedOnline = true;
|
||||
}
|
||||
}
|
||||
catch { /* AA0067 */ }
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore; fallback handled below
|
||||
}
|
||||
}
|
||||
|
||||
// AA0068
|
||||
// If online fetch failed → fallback to cached file
|
||||
if (!loadedOnline && System.IO.File.Exists(CacheFile))
|
||||
{
|
||||
var cached = System.IO.File.ReadAllLines(CacheFile);
|
||||
if (cached.Length > 0)
|
||||
allLines.AddRange(cached);
|
||||
}
|
||||
|
||||
// Also load config.txt (local overrides)
|
||||
var local = Helper.ReadLinesSafe("config.txt");
|
||||
if (local != null && local.Length > 0)
|
||||
allLines.AddRange(local);
|
||||
@@ -120,13 +153,13 @@ namespace Lua
|
||||
bool inAttackers = false;
|
||||
bool inDefenders = false;
|
||||
|
||||
// AA0069
|
||||
foreach (var raw in allLines)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(raw)) continue;
|
||||
var line = raw.Trim();
|
||||
|
||||
if (line.StartsWith("--") || line.StartsWith("#")) continue;
|
||||
if (line.StartsWith("--") || line.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
if (line.StartsWith("attackers", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -171,6 +204,7 @@ namespace Lua
|
||||
CurrentOperator = CurrentSet;
|
||||
}
|
||||
|
||||
|
||||
// AA0070
|
||||
public static void MergeSets()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Speech.Synthesis;
|
||||
using System.Threading;
|
||||
|
||||
namespace Lua
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Lua
|
||||
|
||||
Reference in New Issue
Block a user