Skip to content

Commit

Permalink
Merge pull request #237 from Cupcak3/master
Browse files Browse the repository at this point in the history
Bug Fixes and Better Logging - Cupcak3
  • Loading branch information
Andrewthe13th authored Mar 2, 2022
2 parents c82b6b9 + 7f672ae commit 3eccb95
Show file tree
Hide file tree
Showing 13 changed files with 369 additions and 212 deletions.
19 changes: 1 addition & 18 deletions InventoryKamera/InventoryKamera.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.2.2.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -90,21 +89,6 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>37BE7D3C91D623D6060833B7185EEF5325B32A97</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>InventoryKamera_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Accord, Version=3.8.0.0, Culture=neutral, PublicKeyToken=fa1a88e29555ccf7, processorArchitecture=MSIL">
<HintPath>..\packages\Accord.3.8.0\lib\net462\Accord.dll</HintPath>
Expand Down Expand Up @@ -189,7 +173,7 @@
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="data\InventoryKamera.cs" />
<Compile Include="data\OCRImage.cs" />
<Compile Include="data\OCRImageCollection.cs" />
<Compile Include="data\Inventory.cs" />
<Compile Include="game\Navigation.cs" />
<Compile Include="Program.cs" />
Expand Down Expand Up @@ -217,7 +201,6 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="InventoryKamera_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
4 changes: 2 additions & 2 deletions InventoryKamera/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.2.0")]
[assembly: AssemblyFileVersion("1.2.2.0")]
[assembly: AssemblyVersion("1.2.3.0")]
[assembly: AssemblyFileVersion("1.2.3.0")]
[assembly: NeutralResourcesLanguage("en")]
4 changes: 0 additions & 4 deletions InventoryKamera/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
Expand Down
9 changes: 5 additions & 4 deletions InventoryKamera/data/DatabaseManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ private JToken GetList(ListType list)
break;
}

return !File.Exists(ListsDir + file)
? throw new FileNotFoundException($"Data file does not exist for {list.GetType()}")
: JToken.Parse(LoadJsonFromFile(file));
if (!File.Exists(ListsDir + file)) throw new FileNotFoundException($"Data file does not exist for {list}.");
string json = LoadJsonFromFile(file);
if (json == "{}") throw new FormatException($"Data file for {list} is invalid. Please try running the auto updater and try again.");
return JToken.Parse(json);
}

public bool UpdateAllLists(bool @new = false)
Expand Down Expand Up @@ -527,7 +528,7 @@ private bool UpdateArtifacts(bool @new = false)
{
Dictionary<string, string> data = JToken.Parse(LoadJsonFromFile(ArtifactsJson)).ToObject < Dictionary < string, string > >();
List<JObject> artifacts = JArray.Parse(LoadJsonFromURLAsync(ArtifactsURL)).ToObject<List<JObject>>();
artifacts.RemoveAll(artifact => artifact["Icon"].ToString().Contains("DisplayItemIcon")); // These are the Strongbox variants. We don't want these
artifacts.RemoveAll(artifact => !artifact["Icon"].ToString().Contains("RelicIcon"));

ArtifactsTodo = artifacts.Count;
Debug.WriteLine($"Added {_artifactsTodo} artifacts. Total {TotalTodo}");
Expand Down
Loading

0 comments on commit 3eccb95

Please sign in to comment.