Compare commits

..

9 Commits

Author SHA1 Message Date
mikx 5918a3ed4c Scarab Generator 2024-08-08 16:19:23 -04:00
mikx 8ca0316e26 11.1.0 2023-05-18 20:23:01 -04:00
mikx 48b843bc31 11.0.1 2023-05-11 15:43:32 -04:00
mikx 183c8d7e03 11.0.0 2023-05-03 05:32:55 -04:00
mikx 7f066fdd50 Tier Updates 2023-01-06 01:27:05 -05:00
BuildTools a5d47a41fd readme 2022-09-09 02:35:50 -04:00
BuildTools e3d74db312 10.5.1 2022-09-09 00:34:27 -04:00
Michel Chagnon 0a2d3da084 (9.0.0) Server Update 2021-11-14 04:33:25 -05:00
mikx 4e48bb9449 (8.4.0) Dedicated Update 2021-10-31 02:26:25 -04:00
26 changed files with 2211 additions and 386 deletions

5
Directory.Build.props Normal file
View File

@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
</Project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>

View File

@ -17,6 +17,16 @@
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
@ -43,6 +53,16 @@
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeReferences" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if runtime assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseRuntimeReferencePaths" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls whether the runtime assemblies are embedded with their full path or only with their assembly name.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
@ -73,6 +93,16 @@
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props')" />
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -9,12 +9,13 @@
<OutputType>Exe</OutputType>
<RootNamespace>PoE_MxFilterGen</RootNamespace>
<AssemblyName>mxfiltergen</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<LangVersion>8.0</LangVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@ -69,26 +70,168 @@
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=3.2.1.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.2.1\lib\net40\Costura.dll</HintPath>
<Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.AppContext, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
<Reference Include="System.Diagnostics.Tracing, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Linq, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Linq.Expressions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.InteropServices, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Text.RegularExpressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="compiler\section.cs" />
<Compile Include="currency_classes.cs" />
<Compile Include="generator\accessory.cs" />
<Compile Include="generator\armour.cs" />
<Compile Include="generator\base.cs" />
<Compile Include="generator\card.cs" />
<Compile Include="generator\fossil.cs" />
<Compile Include="generator\scarab.cs" />
<Compile Include="generator\tier.cs" />
<Compile Include="generator\weapon.cs" />
<Compile Include="generator_classes.cs" />
<Compile Include="json\settings.cs" />
<Compile Include="main.cs" />
<Compile Include="msg.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="structures.cs" />
<Compile Include="web.cs" />
</ItemGroup>
<ItemGroup>
@ -111,13 +254,18 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="content\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.3.3.3\build\Fody.targets" Condition="Exists('..\packages\Fody.3.3.3\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.3.3.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.3.3\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Fody.6.6.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.6.0\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Fody.6.6.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.6.0\build\Fody.targets')" />
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
</Project>

View File

@ -0,0 +1,261 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen.compiler
{
public class Block
{
public string Type { get; set; }
public bool Show { get; set; }
public List<object> Class { get; set; }
public List<object> BaseType { get; set; }
public List<string> SetTextColor { get; set; }
public List<string> SetBackgroundColor { get; set; }
public List<string> SetBorderColor { get; set; }
public string SetFontSize { get; set; }
public List<Condition> Conditions { get; set; }
public List<Action> Actions { get; set; }
}
public class Condition
{
public string name { get; set; }
public string op { get; set; }
public string value { get; set; }
}
public class Action
{
public string name { get; set; }
public string va { get; set; }
public string vb { get; set; }
public string vc { get; set; }
public string vd { get; set; }
}
public class RootBlocks
{
public List<Block> blocks { get; set; }
}
internal class section
{
public static string outpath = "";
private static string iC;
private static string iB;
public static void Compile(string section, string filter)
{
if (File.Exists(outpath)) { File.Delete($"out/{section}.filter"); }
//DoSplash(filter, section);
string filson = $"filson/{section}.json";
if (main.profile)
{
filson = $"profiles/{main.profilename}/filson/{section}.json";
}
foreach (Block bl in JsonConvert.DeserializeObject<RootBlocks>(File.ReadAllText(filson, Encoding.UTF8)).blocks)
{
string type = filter;
string blocktype = bl.Type;
outpath = $"out/{filter}/{section}.filter";
DoCompile(bl, blocktype, filter);
}
}
public static void DoSplash(string filter, string section)
{
string outp = $"out/{filter}/{section}.filter";
////////// Splash //////////
File.AppendAllText(outp, $"#### Filson - PoE Item Filter JSON Parsing - MxFilterGen v{main.version}{Environment.NewLine}");
File.AppendAllText(outp, $"#### Filson and MxFilterGen are developped by mikx.{Environment.NewLine}");
File.AppendAllText(outp, $"#### MxGit: https://mxgit.ovh/mikx/PoE-MxFilterGen{Environment.NewLine}");
File.AppendAllText(outp, $"#### MxPoE: https://mxpoe.ovh/{Environment.NewLine}");
File.AppendAllText(outp, $"#### Contact: mikx@mxpoe.ovh / http://discord.mxg.ovh{Environment.NewLine}");
}
public static void DoCompile(Block bl, string bltype, string type)
{
////////// Skip a line //////////
File.AppendAllText(outpath, Environment.NewLine);
////////// Show or Hide //////////
string bshow = "";
if (bl.Show) { bshow = "Show"; } else { bshow = "Hide"; };
if (bltype == "Normal" && type == "Strict") { bshow = "Hide"; }
File.AppendAllText(outpath, bshow + Environment.NewLine);
////////// Class //////////
if (bl.Class != null)
{
foreach (var c in bl.Class) { iC += string.Format(@" ""{0}""", c); }
if (iC != "")
{
File.AppendAllText(outpath, $" Class {iC} {Environment.NewLine}");
}
}
////////// Base //////////
if (bl.BaseType != null)
{
foreach (var b in bl.BaseType) { iB += string.Format(@" ""{0}""", b); }
if (iB != "")
{
File.AppendAllText(outpath, $" BaseType {iB} {Environment.NewLine}");
}
}
////////// SetTextColor //////////
if (bl.SetTextColor[0] != null)
{
File.AppendAllText(outpath, $" SetTextColor {bl.SetTextColor[0]} {Environment.NewLine}");
}
////////// SetBackgroundColor //////////
if (bl.SetBackgroundColor[0] != null)
{
File.AppendAllText(outpath, $" SetBackgroundColor {bl.SetBackgroundColor[0]} {Environment.NewLine}");
}
////////// SetBorderColor //////////
if (bl.SetBorderColor[0] != null)
{
File.AppendAllText(outpath, $" SetBorderColor {bl.SetBorderColor[0]} {Environment.NewLine}");
}
////////// SetFontSize //////////
if (bl.SetFontSize != null)
{
File.AppendAllText(outpath, " SetFontSize " + bl.SetFontSize + Environment.NewLine);
}
////////// Conditions //////////
foreach (var con in bl.Conditions)
{
string cn = con.name;
string co = con.op;
var cv = con.value;
switch (con.name)
{
case "AreaLevel":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "ItemLevel":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "DropLevel":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "Quality":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "Rarity":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "LinkedSockets":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "SocketGroup":
File.AppendAllText(outpath, $" {cn} {co} \"{cv}\" {Environment.NewLine}");
break;
case "Sockets":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "Height":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "Width":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "HasExplicitMod":
File.AppendAllText(outpath, $" {cn} \"{cv}\" {Environment.NewLine}");
break;
case "AnyEnchantment":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "StackSize":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "GemLevel":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
case "GemQualityType":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "AlternateQuality":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "Identified":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "Corrupted":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "Mirrored":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "ElderItem":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "ShaperItem":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "HasInfluence":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "FracturedItem":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "SynthesisedItem":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "BlightedMap":
File.AppendAllText(outpath, $" {cn} {cv} {Environment.NewLine}");
break;
case "MapTier":
File.AppendAllText(outpath, $" {cn} {co} {cv} {Environment.NewLine}");
break;
}
}
////////// Actions //////////
if (bltype == "Normal" && type == "Strict")
{
// No Action
} else
{
foreach (var ac in bl.Actions)
{
string an;
string ava;
string avb;
string avc;
string avd;
an = ac.name;
ava = "";
avb = "";
avc = "";
avd = "";
if (ava != null) { ava = ac.va; }
if (avb != null) { avb = ac.vb; }
if (avc != null) { avc = ac.vc; }
if (avd != null) { avd = ac.vd; }
switch (ac.name)
{
case "PlayAlertSound":
File.AppendAllText(outpath, $" {an} {ava} {avb} {Environment.NewLine}");
break;
case "CustomAlertSound":
File.AppendAllText(outpath, $" {an} \"{ava}\" {Environment.NewLine}");
break;
case "MinimapIcon":
File.AppendAllText(outpath, $" {an} {ava} {avb} {avc} {Environment.NewLine}");
break;
case "PlayEffect":
File.AppendAllText(outpath, $" {an} {ava} {avb} {Environment.NewLine}");
break;
}
}
}
iB = "";
iC = "";
}
}
}

View File

@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
public class CurrencyDetail
{
public int id { get; set; }
public string icon { get; set; }
public string name { get; set; }
public string tradeId { get; set; }
}
public class LanguageCurrency
{
public string name { get; set; }
public Translations translations { get; set; }
}
public class LineCurrency
{
public string currencyTypeName { get; set; }
public Pay pay { get; set; }
public Receive receive { get; set; }
public double chaosEquivalent { get; set; }
public LowConfidencePaySparkLine lowConfidencePaySparkLine { get; set; }
public LowConfidenceReceiveSparkLine lowConfidenceReceiveSparkLine { get; set; }
public string detailsId { get; set; }
}
public class LowConfidencePaySparkLine
{
public List<object> data { get; set; }
public double totalChange { get; set; }
}
public class LowConfidenceReceiveSparkLine
{
public List<double?> data { get; set; }
public double totalChange { get; set; }
}
public class Pay
{
public int id { get; set; }
public int league_id { get; set; }
public int pay_currency_id { get; set; }
public int get_currency_id { get; set; }
public DateTime sample_time_utc { get; set; }
public int count { get; set; }
public double value { get; set; }
public int data_point_count { get; set; }
public bool includes_secondary { get; set; }
public int listing_count { get; set; }
}
public class PaySparkLine
{
public List<object> data { get; set; }
public double totalChange { get; set; }
}
public class Receive
{
public int id { get; set; }
public int league_id { get; set; }
public int pay_currency_id { get; set; }
public int get_currency_id { get; set; }
public DateTime sample_time_utc { get; set; }
public int count { get; set; }
public double value { get; set; }
public int data_point_count { get; set; }
public bool includes_secondary { get; set; }
public int listing_count { get; set; }
}
public class ReceiveSparkLine
{
public List<double> data { get; set; }
public double totalChange { get; set; }
}
public class RootCurrency
{
public List<LineCurrency> lines { get; set; }
public List<CurrencyDetail> currencyDetails { get; set; }
public LanguageCurrency language { get; set; }
}
public class TranslationsCurrency
{
}
}

View File

@ -0,0 +1,44 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class accessory
{
private static string iB;
public static void Gen(string section, int uniquev)
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(uniquev);
if (chaosValue >= num)
{
stringList.Add(line.baseType);
accessory.iB += string.Format(@" ""{0}""", line.baseType);
}
}
if (accessory.iB == null)
accessory.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + accessory.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_unique.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,51 @@
// Decompiled with JetBrains decompiler
// Type: PoE_MxFilterGen.generator.armour
// Assembly: mxfiltergen, Version=8.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9686B206-07DB-4C70-B4F4-1F6EF4D87358
// Assembly location: C:\Users\blood\OneDrive\Desktop\mxfiltergen.exe
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class armour
{
private static string iB;
public static void Gen(string section, int uniquev)
{
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
List<string> stringList = new List<string>();
foreach (Line line in ln.lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int? links = line.links;
if (chaosValue >= uniquev && !stringList.Contains(line.baseType) && links == null)
{
stringList.Add(line.baseType);
armour.iB += string.Format(@" ""{0}""", line.baseType);
}
}
if (armour.iB == null)
armour.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + armour.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_unique.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,30 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen.generator
{
internal class @base
{
private static string iB;
public static void GenAccessory(string section, int basev)
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(basev);
if (chaosValue >= num)
{
stringList.Add(line.baseType);
@base.iB += string.Format(@" ""{0}""", line.baseType);
}
}
}
}
}

View File

@ -0,0 +1,48 @@
// Decompiled with JetBrains decompiler
// Type: PoE_MxFilterGen.generator.card
// Assembly: mxfiltergen, Version=8.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9686B206-07DB-4C70-B4F4-1F6EF4D87358
// Assembly location: C:\Users\blood\OneDrive\Desktop\mxfiltergen.exe
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class card
{
private static string iB;
public static void Gen(string section, int cardv)
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.card.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(cardv);
if (chaosValue >= num)
{
stringList.Add(line.name);
card.iB += string.Format(@" ""{0}""", line.name);
}
}
if (card.iB == null)
card.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Divination Card\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + card.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 0 105 178" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 105 178" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_highvalue.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,48 @@
// Decompiled with JetBrains decompiler
// Type: PoE_MxFilterGen.generator.fossil
// Assembly: mxfiltergen, Version=8.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9686B206-07DB-4C70-B4F4-1F6EF4D87358
// Assembly location: C:\Users\blood\OneDrive\Desktop\mxfiltergen.exe
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class fossil
{
private static string iB;
public static void Gen(string section, int fossilv)
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.fossil.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int num = Convert.ToInt32(fossilv);
if (chaosValue >= num)
{
stringList.Add(line.name);
fossil.iB += string.Format(@" ""{0}""", line.name);
}
}
if (fossil.iB == null)
fossil.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object) section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Stackable Currency\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + fossil.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 165 0 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 255 165 0 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_fossil.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,123 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen.generator
{
internal class scarab
{
private static string iBbasic;
private static string iB5c;
private static string iB10c;
private static string iB100c;
private static string iBhigh;
public static void Gen(string section)
{
List<string> stringList = new List<string>();
foreach (Line line in JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.scarab.json", Encoding.UTF8)).lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
if (chaosValue <= 1.0)
{
stringList.Add(line.name);
scarab.iBbasic += string.Format(@" ""{0}""", line.name);
}
if (chaosValue <= 5.0 && chaosValue > 1.0)
{
stringList.Add(line.name);
scarab.iB5c += string.Format(@" ""{0}""", line.name);
}
if (chaosValue <= 10.0 && chaosValue > 5.0)
{
stringList.Add(line.name);
scarab.iB10c += string.Format(@" ""{0}""", line.name);
}
if (chaosValue <= 100.0 && chaosValue > 10.0)
{
stringList.Add(line.name);
scarab.iB100c += string.Format(@" ""{0}""", line.name);
}
if (chaosValue > 100.0)
{
stringList.Add(line.name);
scarab.iBhigh += string.Format(@" ""{0}""", line.name);
}
}
string path = "gen/" + section + ".filter";
if (scarab.iBbasic == null)
scarab.iBbasic = "\"\"";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Map Fragment\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + scarab.iBbasic + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 94 3 3" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 25" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_scarab.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
if (scarab.iB5c == null)
scarab.iB5c = "\"\"";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Map Fragment\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + scarab.iB5c + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 94 3 3" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 30" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_scarab.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
if (scarab.iB10c == null)
scarab.iB10c = "\"\"";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Map Fragment\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + scarab.iB10c + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 94 3 3" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_scarab.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
if (scarab.iB100c == null)
scarab.iB100c = "\"\"";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Map Fragment\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + scarab.iB100c + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 94 3 3" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_scarab.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
if (scarab.iBhigh == null)
scarab.iBhigh = "\"\"";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Class \"Map Fragment\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType" + scarab.iBhigh + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 42" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_scarab.mp3\"", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,333 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
namespace PoE_MxFilterGen.generator
{
internal class tier
{
private static string iB;
private static List<string> iBA = new List<string>();
private static string iBInt;
private static List<string> iBIntA = new List<string>();
private static string iBStr;
private static List<string> iBStrA = new List<string>();
private static string iBDex;
private static List<string> iBDexA = new List<string>();
public static string[] Int()
{
string[] Int = new string[] {
"Wand",
"Sorcerer",
"Mind",
"Bone",
"Silk",
"Arcanist",
"Spirit",
"Solaris",
"Slippers",
"Samite",
"Demon's Horn",
"Conjurer Gloves",
"Slaughter Knife",
"Deicide",
"Conjurer",
"Necromancer",
"Deicide",
"Platinum Kris",
"Zealot Boots",
"Golden Kris",
"Steel Circlet",
"Butcher Knife",
"Embroidered Gloves",
"Void Sceptre",
"Opal Sceptre",
"Abyssal Sceptre",
"Crystal Sceptre",
"Carnal Sceptre",
"Vaal Sceptre",
"Quartz Sceptre",
"Shadow Sceptre",
"Grinning Fetish",
"Crystal Sceptre",
"Lead Sceptre",
"Blood Sceptre",
"Royal Sceptre",
"Stabilising Sceptre",
"Abyssal Sceptre",
"Karui Sceptre",
"Tyrant's Sekhem",
"Opal Sceptre",
"Platinum Sceptre",
"Vaal Sceptre",
"Carnal Sceptre",
"Void Sceptre",
"Alternating Sceptre",
"Sambar Sceptre"
};
return Int;
}
public static string[] Str()
{
string[] Str = new string[] {
"Astral",
"Tower",
"Burgonet",
"Ancient",
"Fencer",
"Goliath",
"Pig-Faced",
"Crusader Boots",
"Vaal Gauntlets",
"Prophet Crown",
"Antique Greaves",
"Vaal Greaves",
"Siege Helmet",
"Reinforced Greeves",
"Soldier Boots",
"Aventail Helmet",
"Reaver Helmet",
"Saint's Hauberk",
"Samnite Helmet"
};
return Str;
}
public static string[] Dex()
{
string[] Dex = new string[] {
"Claw",
"Bow",
"Quiver",
"Deerskin",
"Ambusher",
"Wyrnmscale",
"Gouger",
"Dagger",
"Spiked",
"Hood",
"Ursine",
"Oak",
"Carnal",
"Vaal Buckler",
"Nightmare Bascinet",
"Poignard",
"Gutting Knife",
"Vaal Mask",
"Throat Stabber",
"Lion Pelt",
"Stealth Gloves",
"Battle Buckler",
"Shagreen Boots",
"Shagreen Gloves",
"Sharkskin Gloves",
"Enameled Buckler",
"Corsair Sword",
"Slink Boots",
"Stealth Boots",
"Slink Gloves",
"Wolf Pelt"
};
return Dex;
}
public static void Gen(string section, int tierValue, bool tier1HAxe, bool tier2HAxe, bool tierBow, bool tierClaw, bool tierDagger, bool tier1HMace, bool tier2HMace, bool tierSceptre, bool tierStaff, bool tier1HSword, bool tier2HSword, bool tierWand, bool tierBody, bool tierBoots, bool tierGloves, bool tierHelmet, bool tierShield, bool tierQuiver, List<string> tierBaseInclude, List<string> tierBaseExclude)
{
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.base.json", Encoding.UTF8));
ForEachLine(ln, "One Handed Axe", tier1HAxe, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Two Handed Axe", tier2HAxe, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Bow", tierBow, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Claw", tierClaw, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Dagger", tierDagger, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "One Handed Mace", tier1HMace, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Two Handed Mace", tier2HMace, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Sceptre", tierSceptre, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Staff", tierStaff, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "One Handed Sword", tier1HSword, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Two Handed Sword", tier2HSword, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Wand", tierWand, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Body Armour", tierBody, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Boots", tierBoots, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Gloves", tierGloves, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Helmet", tierHelmet, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Shield", tierShield, section, tierValue, tierBaseInclude, tierBaseExclude);
ForEachLine(ln, "Quiver", tierQuiver, section, tierValue, tierBaseInclude, tierBaseExclude);
}
public static void ForEachLine(dynamic lnb, string type, bool tierBool, string section, int tierValue, List<string> tierBaseInclude, List<string> tierBaseExclude)
{
int c = 0;
List<string> stringList = new List<string>();
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.base.json", Encoding.UTF8));
foreach (var line in ln.lines)
{
string[] cint = Int();
string[] cstr = Str();
string[] cdex = Dex();
if (line.itemType == type && tierBool && line.levelRequired <= 86 && line.variant == null && line.chaosValue >= tierValue && !stringList.Contains(line.baseType) && line.baseType != "Serpent Wand")
{
if (!tierBaseExclude.Contains(line.baseType))
{
c++;
iBA.Add(line.baseType);
if (cint.Any(line.baseType.Contains))
{
iBIntA.Add(line.baseType);
iBA.Remove(line.baseType);
}
if (cstr.Any(line.baseType.Contains))
{
iBStrA.Add(line.baseType);
iBA.Remove(line.baseType);
}
if (cdex.Any(line.baseType.Contains))
{
iBDexA.Add(line.baseType);
iBA.Remove(line.baseType);
}
stringList.Add(line.baseType);
}
}
else if (line.itemType == type && !tierBool && line.levelRequired <= 86 && line.variant == null && line.chaosValue >= tierValue && tierBaseInclude.Contains(line.baseType) && !stringList.Contains(line.baseType))
{
c++;
iBA.Add(line.baseType);
if (cint.Any(line.baseType.Contains))
{
iBIntA.Add(line.baseType);
iBA.Remove(line.baseType);
}
if (cstr.Any(line.baseType.Contains))
{
iBStrA.Add(line.baseType);
iBA.Remove(line.baseType);
}
if (cdex.Any(line.baseType.Contains))
{
iBDexA.Add(line.baseType);
iBA.Remove(line.baseType);
}
stringList.Add(line.baseType);
}
}
foreach (string b in iBA)
{
iB += string.Format(@" ""{0}""", b);
}
foreach (string b in iBIntA)
{
iBInt += string.Format(@" ""{0}""", b);
}
foreach (string b in iBStrA)
{
iBStr += string.Format(@" ""{0}""", b);
}
foreach (string b in iBDexA)
{
iBDex += string.Format(@" ""{0}""", b);
}
if (c != 0)
{
if (iBA.Count >= 1) { GenerateFile(section, iB, type, "Base", " SetBackgroundColor 54 54 54 255"); }
if (iBIntA.Count >= 1) { GenerateFile(section, iBInt, type, "Int", " SetBackgroundColor 56 69 89 255"); }
if (iBStrA.Count >= 1) { GenerateFile(section, iBStr, type, "Str", " SetBackgroundColor 81 54 54 255"); }
if (iBDexA.Count >= 1) { GenerateFile(section, iBDex, type, "Dex", " SetBackgroundColor 50 69 49 255"); }
}
c = 0;
iBA = new List<string>();
iBIntA = new List<string>();
iBStrA = new List<string>();
iBDexA = new List<string>();
iB = "";
iBInt = "";
iBStr = "";
iBDex = "";
}
public static void GenerateFile(string section, string iB, string type, string att, string SetBackgroundColor)
{
if (iB == null || iB == "")
iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, $"#### SECTION: {section} ({type})({att})" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SynthesisedItem True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, SetBackgroundColor + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Identified True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, SetBackgroundColor + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 0 0 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Corrupted True" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, SetBackgroundColor + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 210 0 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 75" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 100" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, SetBackgroundColor + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 184 218 242" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, SetBackgroundColor + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, SetBackgroundColor + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_tier.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,51 @@
// Decompiled with JetBrains decompiler
// Type: PoE_MxFilterGen.generator.weapon
// Assembly: mxfiltergen, Version=8.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9686B206-07DB-4C70-B4F4-1F6EF4D87358
// Assembly location: C:\Users\blood\OneDrive\Desktop\mxfiltergen.exe
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PoE_MxFilterGen.generator
{
internal class weapon
{
private static string iB;
public static void Gen(string section, int uniquev)
{
var ln = JsonConvert.DeserializeObject<Root>(File.ReadAllText("data/ninja.weapon.json", Encoding.UTF8));
List<string> stringList = new List<string>();
foreach (Line line in ln.lines)
{
int chaosValue = Convert.ToInt32(line.chaosValue);
int? links = line.links;
if (chaosValue >= uniquev && !stringList.Contains(line.baseType) && links == null)
{
stringList.Add(line.baseType);
weapon.iB += string.Format(@" ""{0}""", line.baseType);
}
}
if (weapon.iB == null)
weapon.iB = "\"\"";
string path = "gen/" + section + ".filter";
File.AppendAllText(path, string.Format("#### SECTION: {0}", (object)section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine ?? "", Encoding.UTF8);
File.AppendAllText(path, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " BaseType " + weapon.iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " CustomAlertSound \"mx_unique.mp3\"" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(path, " PlayEffect White", Encoding.UTF8);
File.AppendAllText(path, Environment.NewLine, Encoding.UTF8);
}
}
}

View File

@ -0,0 +1,76 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
public class Sparkline
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public List<double?> data { get; set; }
public double? totalChange { get; set; }
}
public class LowConfidenceSparkline
{
public List<double?> data { get; set; }
public double? totalChange { get; set; }
}
public class ExplicitModifier
{
public string? text { get; set; }
public bool? optional { get; set; }
}
public class Line
{
public int? id { get; set; }
public string? name { get; set; }
public string? icon { get; set; }
public int? mapTier { get; set; }
public int? levelRequired { get; set; }
public string? baseType { get; set; }
public int? stackSize { get; set; }
public object? variant { get; set; }
public object? prophecyText { get; set; }
public object? artFilename { get; set; }
public int? links { get; set; }
public int? itemClass { get; set; }
public Sparkline sparkline { get; set; }
public LowConfidenceSparkline lowConfidenceSparkline { get; set; }
public List<object?> implicitModifiers { get; set; }
public List<ExplicitModifier> explicitModifiers { get; set; }
public string? flavourText { get; set; }
public bool? corrupted { get; set; }
public int? gemLevel { get; set; }
public int? gemQuality { get; set; }
public string? itemType { get; set; }
public double? chaosValue { get; set; }
public double? exaltedValue { get; set; }
public int? count { get; set; }
public string? detailsId { get; set; }
public object? tradeInfo { get; set; }
public object? mapRegion { get; set; }
public int? listingCount { get; set; }
}
public class Translations
{
}
public class Language
{
public string? name { get; set; }
public Translations translations { get; set; }
}
public class Root
{
public List<Line> lines { get; set; }
public Language language { get; set; }
}
}

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
@ -10,53 +11,272 @@ namespace PoE_MxFilterGen.json
{
public class SETTINGS
{
public string version { get; set; }
public string league { get; set; }
public string profile { get; set; }
public List<string> Structures { get; set; }
public int tierValue { get; set; }
public bool tier1HAxe { get; set; }
public bool tier2HAxe { get; set; }
public bool tierBow { get; set; }
public bool tierClaw { get; set; }
public bool tierDagger { get; set; }
public bool tier1HMace { get; set; }
public bool tier2HMace { get; set; }
public bool tierSceptre { get; set; }
public bool tierStaff { get; set; }
public bool tier1HSword { get; set; }
public bool tier2HSword { get; set; }
public bool tierWand { get; set; }
public bool tierBody { get; set; }
public bool tierBoots { get; set; }
public bool tierGloves { get; set; }
public bool tierHelmet { get; set; }
public bool tierShield { get; set; }
public bool tierQuiver { get; set; }
public int uniqueValue { get; set; }
public int fossilValue { get; set; }
public int cardValue { get; set; }
public string updateurl { get; set; }
public string section { get; set; }
public List<string> tierBaseInclude { get; set; }
public List<string> tierBaseExclude { get; set; }
public bool install { get; set; }
public string path { get; set; }
public string structure { get; set; }
public List<string> Sizes { get; set; }
public List<string> Colors { get; set; }
public List<string> Shapes { get; set; }
public List<string> Actions { get; set; }
public List<string> Conditions { get; set; }
public List<string> Operators { get; set; }
}
class settings
{
internal static string GetVersion()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.version;
}
internal static string GetLeague()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.league;
}
internal static string GetProfile()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.league;
}
public static int GetTierValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierValue;
}
public static int GetUniqueValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.uniqueValue;
}
public static int GetFossilValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.fossilValue;
}
public static int GetCardValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.cardValue;
}
public static string GetSection()
internal static bool GetTier1HAxe()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.section;
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tier1HAxe;
}
public static void WriteSection(string section)
internal static bool GetTier2HAxe()
{
SETTINGS js = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($@"settings.json"));
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tier2HAxe;
}
internal static bool GetTierBow()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierBow;
}
internal static bool GetTierClaw()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierClaw;
}
internal static bool GetTierDagger()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierDagger;
}
internal static bool GetTier1HMace()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tier1HMace;
}
internal static bool GetTier2HMace()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tier2HMace;
}
internal static bool GetTierSceptre()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierSceptre;
}
internal static bool GetTierStaff()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierStaff;
}
internal static bool GetTier1HSword()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tier1HSword;
}
internal static bool GetTier2HSword()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tier2HSword;
}
internal static bool GetTierWand()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierWand;
}
internal static bool GetTierBody()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierBody;
}
internal static bool GetTierBoots()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierBoots;
}
internal static bool GetTierGloves()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierGloves;
}
internal static bool GetTierHelmet()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierHelmet;
}
internal static bool GetTierShield()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierShield;
}
internal static bool GetTierQuiver()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierQuiver;
}
internal static bool GetInstall()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.install;
}
internal static string GetPath()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.path;
}
internal static List<string> GetTierBaseInclude()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierBaseInclude;
}
internal static List<string> GetTierBaseExclude()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.tierBaseExclude;
}
internal static List<string> GetStructure()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
return j.Structures;
}
public static void WriteSection(string structure)
{
SETTINGS js = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($"profiles/{main.profilename}/{main.profilename}.json"));
SETTINGS se = new SETTINGS
{
version = js.version,
league = js.league,
profile = js.profile,
tierValue = js.tierValue,
tier1HAxe = js.tier1HAxe,
tier2HAxe = js.tier2HAxe,
tierBow = js.tierBow,
tierClaw = js.tierClaw,
tierDagger = js.tierDagger,
tier1HMace = js.tier1HMace,
tier2HMace = js.tier2HMace,
tierSceptre = js.tierSceptre,
tierStaff = js.tierStaff,
tier1HSword = js.tier1HSword,
tier2HSword = js.tier2HSword,
tierWand = js.tierWand,
tierBody = js.tierBody,
tierBoots = js.tierBoots,
tierGloves = js.tierGloves,
tierHelmet = js.tierHelmet,
tierShield = js.tierShield,
tierQuiver = js.tierQuiver,
uniqueValue = js.uniqueValue,
tierBaseInclude = js.tierBaseInclude,
tierBaseExclude = js.tierBaseExclude,
fossilValue = js.fossilValue,
cardValue = js.cardValue,
updateurl = js.updateurl,
section = section
install = js.install,
path = js.path,
structure = structure,
Structures = js.Structures,
Sizes = js.Sizes,
Colors = js.Colors,
Shapes = js.Shapes,
Actions = js.Actions,
Conditions = js.Conditions,
Operators = js.Operators
};
var raw = JsonConvert.SerializeObject(se, Formatting.Indented);
File.WriteAllText($@"settings.json", raw);
}
File.WriteAllText($"profiles/{main.profilename}/{main.profilename}.json", raw);
}
}
}

View File

@ -1,34 +1,378 @@
using Newtonsoft.Json;
using PoE_MxFilterGen.generator;
using PoE_MxFilterGen.json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace PoE_MxFilterGen
{
class main
internal class main
{
private static DateTime dt = DateTime.Now;
public static string version = "8.4.0";
public static string fDate = string.Format("{0}-{1}-{2}", dt.Day, dt.Month, dt.Year);
public static string version = "11.2.0";
public static string fDate = string.Format("{0}-{1}-{2}", (object)main.dt.Day, (object)main.dt.Month, (object)main.dt.Year);
public static string api = "";
public static string giturl = "https://git.mikx.xyz/mikx";
public static string giturl = "https://mxgit.ovh/mikx";
public static string section = "";
public static string league = "";
public static string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
public static string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
public static int fprog = 0;
public static int ftotal = 0;
public static int sprog = 0;
public static int stotal = 0;
public static bool debug = false;
public static bool install;
public static bool compile = false;
public static bool profile = false;
public static string profilename = "";
public static string ipath;
public static string docpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
public static bool deb = false;
private static void Main(string[] args)
{
if (args.Count() >= 1)
{
if (args.Contains("--compile"))
{
compile = true;
}
if (args.Contains("--profile"))
{
profile = true;
int proin = Array.IndexOf(args, "--profile");
profilename = args[proin + 1];
} else
{
profilename = "Default";
}
}
if (!Directory.Exists("data"))
{
Directory.CreateDirectory("data");
}
if (!Directory.Exists("gen"))
{
Directory.CreateDirectory("gen");
}
if (!Directory.Exists("structure"))
{
Directory.CreateDirectory("structure");
}
if (!Directory.Exists("out"))
{
Directory.CreateDirectory("out");
}
if (!File.Exists("settings.json"))
{
msg.CMW("ERROR: settings.json not found! Downloading a template...", true, 3);
web.DownloadFile("https://mxpoe.ovh/mxfilter/mxfiltergen_settings.json", "settings.json");
}
msg.Splash("MxFilterGen", "mikx");
main.CleanDirData();
main.league = settings.GetLeague();
main.api = "https://poe.ninja/api/data/";
msg.CMW("League: " + main.league, true, 1);
msg.CMW(string.Format("Min. Unique Value - {0}c", (object)settings.GetUniqueValue()), true, 1);
msg.CMW(string.Format("Min. Fossil Value - {0}c", (object)settings.GetFossilValue()), true, 1);
msg.CMW(string.Format("Min. Card Value - {0}c", (object)settings.GetCardValue()), true, 1);
msg.CMW("Checking for required dirs...", true, 1);
msg.CMW("Cleaning the base dirs...", true, 1);
main.CleanDirData();
msg.CMW("Cleaning the last filter from path...", true, 1);
msg.CMW($"Using Profile: {profile.ToString()} ({profilename})", true, 1);
foreach (string filter in structures.Filters()) {
if (File.Exists("out/MxFilter_" + filter + ".filter"))
{
File.Delete("out/MxFilter_" + filter + ".filter");
}
}
msg.CMW("Downloading the latest API data from poe.ninja...", true, 1);
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=UniqueArmour&language=en", "data/ninja.armour.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=UniqueWeapon&language=en", "data/ninja.weapon.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=UniqueAccessory&language=en", "data/ninja.accessory.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=DivinationCard&language=en", "data/ninja.card.json");
web.SaveString(main.api + "currencyoverview?league=" + main.league + "&type=Currency&language=en", "data/ninja.currency.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=Fossil&language=en", "data/ninja.fossil.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=Scarab&language=en", "data/ninja.scarab.json");
web.SaveString(main.api + "itemoverview?league=" + main.league + "&type=BaseType&language=en", "data/ninja.base.json");
foreach (string filter in structures.Filters())
{
if(!Directory.Exists($@"out\{filter}")) { Directory.CreateDirectory($@"out\{filter}"); }
if (Directory.Exists($@"out\{filter}"))
{
var fout = Directory.GetFiles($@"out\{filter}");
foreach (var f in fout)
{
File.Delete(f);
}
}
string str = "MxFilter";
List<string> struc = settings.GetStructure();
int sc = struc.Count;
msg.CMW(string.Format("Generating the {0} filter using {1} source(s)...", filter, sc), true, 1);
main.ftotal = sc;
foreach (var structure in settings.GetStructure())
{
++main.fprog;
msg.drawProgress(main.fprog, main.ftotal);
settings.WriteSection(structure);
string section = structure;
int fossilValue = settings.GetFossilValue();
int cardValue = settings.GetCardValue();
int uniqueValue = settings.GetUniqueValue();
int tierValue = settings.GetTierValue();
bool tier1HAxe = settings.GetTier1HAxe();
bool tier2HAxe = settings.GetTier2HAxe();
bool tierBow = settings.GetTierBow();
bool tierClaw = settings.GetTierClaw();
bool tierDagger = settings.GetTierDagger();
bool tier1HMace = settings.GetTier1HMace();
bool tier2HMace = settings.GetTier2HMace();
bool tierSceptre = settings.GetTierSceptre();
bool tierStaff = settings.GetTierStaff();
bool tier1HSword = settings.GetTier1HSword();
bool tier2HSword = settings.GetTier2HSword();
bool tierWand = settings.GetTierWand();
bool tierBody = settings.GetTierBody();
bool tierBoots = settings.GetTierBoots();
bool tierGloves = settings.GetTierGloves();
bool tierHelmet = settings.GetTierHelmet();
bool tierShield = settings.GetTierShield();
bool tierQuiver = settings.GetTierQuiver();
install = settings.GetInstall();
ipath = settings.GetPath();
List<string> tierBaseInclude = settings.GetTierBaseInclude();
List<string> tierBaseExclude = settings.GetTierBaseExclude();
if (section.Contains("(GEN)"))
{
if (!compile)
{
switch (structure)
{
case "DIVINATIONCARD(GEN)":
card.Gen(section, cardValue);
break;
case "EXPENSIVEUNIQUE(GEN)(Accessories)":
accessory.Gen(section, uniqueValue);
break;
case "EXPENSIVEUNIQUE(GEN)(Armours)":
armour.Gen(section, uniqueValue);
break;
case "EXPENSIVEUNIQUE(GEN)(Weapons)":
weapon.Gen(section, uniqueValue);
break;
case "FOSSIL(GEN)":
fossil.Gen(section, fossilValue);
break;
case "SCARAB(GEN)":
scarab.Gen(section);
break;
case "Tiers(GEN)":
tier.Gen(section, tierValue, tier1HAxe, tier2HAxe, tierBow, tierClaw, tierDagger, tier1HMace, tier2HMace, tierSceptre, tierStaff, tier1HSword, tier2HSword, tierWand, tierBody, tierBoots, tierGloves, tierHelmet, tierShield, tierQuiver, tierBaseInclude, tierBaseExclude);
break;
}
}
} else
{
compiler.section.Compile(section, filter);
}
}
msg.CMW("Creating the final filter...", true, 1);
string outp = "out/" + str + "_" + filter + ".filter";
////////// Splash //////////
File.AppendAllText(outp, $"#### Filson - PoE Item Filter JSON Parsing - MxFilterGen v{main.version}{Environment.NewLine}");
File.AppendAllText(outp, $"#### Filson and MxFilterGen are developped by mikx.{Environment.NewLine}");
File.AppendAllText(outp, $"#### MxGit: https://mxgit.ovh/mikx/PoE-MxFilterGen{Environment.NewLine}");
File.AppendAllText(outp, $"#### MxPoE: https://mxpoe.ovh/{Environment.NewLine}");
File.AppendAllText(outp, $"#### Contact: mikx@mxpoe.ovh / http://discord.mxg.ovh{Environment.NewLine}");
File.AppendAllText(outp, $"{Environment.NewLine}");
File.AppendAllText(outp, $"#### SECTIONS{Environment.NewLine}");
foreach (var s in settings.GetStructure())
{
File.AppendAllText(outp, $"# {s}{Environment.NewLine}");
}
File.AppendAllText(outp, $"{Environment.NewLine}");
foreach (var structure in settings.GetStructure())
{
switch (structure)
{
case "DIVINATIONCARD(GEN)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "EXPENSIVEUNIQUE(GEN)(Accessories)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "EXPENSIVEUNIQUE(GEN)(Armours)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "EXPENSIVEUNIQUE(GEN)(Weapons)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "FOSSIL(GEN)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "SCARAB(GEN)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "Tiers(GEN)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
case "Tiers - Caster (DATA)":
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("gen/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
default:
File.AppendAllText("out/" + str + "_" + filter + ".filter", string.Format("#### SECTION: {0}", (object)structure) + Environment.NewLine);
File.AppendAllText("out/" + str + "_" + filter + ".filter", File.ReadAllText(string.Format("out/" + filter + "/" + structure + ".filter")));
File.AppendAllText("out/" + str + "_" + filter + ".filter", Environment.NewLine ?? "");
break;
}
}
main.ftotal = 0;
main.fprog = 0;
//main.CleanDir();
CurrencyValueOut();
}
if (debug)
{
Console.ReadKey();
}
else if (!debug && install)
{
msg.CMW("INFO: install is true and will act as a personal filter generator.", true, 2);
foreach (var f in structures.Filters())
{
if (File.Exists($@"{docpath}\My Games\Path of Exile\MxFilter_{f}.filter"))
{
File.Copy($@"{docpath}\My Games\Path of Exile\MxFilter_{f}.filter", $@"{docpath}\My Games\Path of Exile\MxFilter_{f}.filter.backup", true);
File.Delete($@"{docpath}\My Games\Path of Exile\MxFilter_{f}.filter");
}
}
if (ipath == "" || ipath == null)
{
msg.CMW("ERROR: install is true but there is no path given, using default windows path.", true, 3);
foreach (var f in structures.Filters())
{
File.Copy($"out/MxFilter_{f}.filter", $@"{docpath}\My Games\Path of Exile\MxFilter_{f}.filter");
}
foreach (var s in Directory.EnumerateFiles("sound"))
{
string sf = Path.GetFileName(s);
File.Copy($"{s}", $@"{docpath}\My Games\Path of Exile\{sf}", true);
}
}
else
{
foreach (var f in structures.Filters())
{
File.Copy($"out/MxFilter_{f}.filter", $@"{ipath}\MxFilter_{f}.filter");
}
foreach (var s in Directory.EnumerateFiles("sound"))
{
File.Copy($"sound/{s}", $@"{ipath}\{s}");
}
}
} else
{
msg.CMW("INFO: install is false and will act as a remote generator.", true, 2);
}
}
public static void CurrencyValueOut()
{
foreach (LineCurrency line in JsonConvert.DeserializeObject<RootCurrency>(File.ReadAllText("data/ninja.currency.json", Encoding.UTF8)).lines)
{
string currencyTypeName = line.currencyTypeName;
if (currencyTypeName == "Divine Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/divine.txt", fc);
}
if (currencyTypeName == "Exalted Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/exalted.txt", fc);
}
if (currencyTypeName == "Orb of Annulment")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/annulment.txt", fc);
}
if (currencyTypeName == "Orb of Alteration")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/alteration.txt", fc);
}
if (currencyTypeName == "Orb of Fusing")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/fusing.txt", fc);
}
if (currencyTypeName == "Chromatic Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/chromatic.txt", fc);
}
if (currencyTypeName == "Jeweller's Orb")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/jeweller.txt", fc);
}
if (currencyTypeName == "Orb of Alchemy")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/alchemy.txt", fc);
}
if (currencyTypeName == "Cartographer's Chisel")
{
string fc = line.chaosEquivalent.ToString();
File.WriteAllText("out/Market/chisel.txt", fc);
}
}
}
public static void CleanDirData()
{
DirectoryInfo directoryInfo1 = new DirectoryInfo("data");
DirectoryInfo directoryInfo2 = new DirectoryInfo("gen");
foreach (FileSystemInfo file in directoryInfo1.GetFiles())
file.Delete();
if(!compile)
{
foreach (FileSystemInfo file in directoryInfo2.GetFiles())
file.Delete();
}
}
public static void CleanDir()
{
if (!compile)
{
foreach (FileSystemInfo file in new DirectoryInfo("gen").GetFiles())
file.Delete();
}
}
private static void AutoUpdater_ApplicationExitEvent() => Environment.Exit(-1);
public class REMVAR
{
@ -43,229 +387,19 @@ namespace PoE_MxFilterGen
public class STRUCTURE
{
public string section { get; set; }
public bool gen { get; set; }
public bool @static { get; set; }
public bool remote { get; set; }
public string url { get; set; }
}
public class RootStructure
{
public List<STRUCTURE> structures { get; set; }
}
static void Main(string[] args)
{
// Check for the settings json
if (!File.Exists("settings.json"))
{
msg.CMW("ERROR: settings.json not found! Downloading a template...", true, 3);
web.DownloadFile("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/json/mxfiltergen_temp_settings.json", "settings.json");
}
msg.Splash();
// Get current league from MxD
var ls = web.ReadString("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/json/mxfiltergen_var.json");
REMVAR lj = JsonConvert.DeserializeObject<REMVAR>(ls);
league = lj.league;
api = $"https://poe.ninja/api/data/";
msg.CMW($"League: {league}", true, 1);
msg.CMW($"Min. Unique Value - {json.settings.GetUniqueValue()}c", true, 1);
msg.CMW($"Min. Fossil Value - {json.settings.GetFossilValue()}c", true, 1);
msg.CMW($"Min. Card Value - {json.settings.GetCardValue()}c", true, 1);
// Check if all the required dir exists
msg.CMW($"Checking for required dirs...", true, 1);
if (!Directory.Exists(@"data\"))
{
Directory.CreateDirectory(@"data\");
}
if (!Directory.Exists(@"gen\"))
{
Directory.CreateDirectory(@"gen\");
}
if (!Directory.Exists(@"structure\"))
{
Directory.CreateDirectory(@"structure\");
}
// Clean all generated data
msg.CMW($"Cleaning the base dirs...", true, 1);
CleanDirData();
// Clean the latest generated filter from settings path
msg.CMW($"Cleaning the last filter from path...", true, 1);
File.Delete($@"{path}\My Games\Path of Exile\MxFilter_Normal.filter");
File.Delete($@"{path}\My Games\Path of Exile\MxFilter_Strict.filter");
File.Delete($@"{path}\My Games\Path of Exile\MxFilter_Strict_NSNLC.filter");
// Get latest poe.ninja api
msg.CMW($"Downloading the latest API data from poe.ninja...", true, 1);
web.SaveString(api + $"itemoverview?league={league}&type=UniqueArmour&language=en", "data/ninja.armour.json");
web.SaveString(api + $"itemoverview?league={league}&type=UniqueWeapon&language=en", "data/ninja.weapon.json");
web.SaveString(api + $"itemoverview?league={league}&type=UniqueAccessory&language=en", "data/ninja.accessory.json");
web.SaveString(api + $"itemoverview?league={league}&type=DivinationCard&language=en", "data/ninja.card.json");
web.SaveString(api + $"currencyoverview?league={league}&type=Currency&language=en", "data/ninja.currency.json");
web.SaveString(api + $"itemoverview?league={league}&type=Fossil&language=en", "data/ninja.fossil.json");
// Generate Filter Array
string[] filters;
filters = new string[] { "Normal", "Strict", "Strict_NSNLC" };
foreach (string f in filters)
{
// Setup basic variable
string filter_name = "MxFilter";
// Get the structure list
var js = web.ReadString($@"{giturl}/PoE-MxFilter-Structure/raw/branch/master/{f}.json");
RootStructure j = JsonConvert.DeserializeObject<RootStructure>(js);
// Read the structure one by one to process gen
// Generator (dlls) are downloaded from the web and executed in a separate AppDomain before the AD is unloaded to execute a new generator.
// As we CAN'T unload an assembly, using AppDomains is the only way we can load/unload multiple assembly in a row.
msg.CMW($@"Generating the {f} filter using {j.structures.Count} source(s)...", true, 1);
ftotal = j.structures.Count;
foreach (var sec in j.structures)
{
if (sec.gen == true)
{
fprog = fprog + 1;
msg.drawProgress(fprog, ftotal);
//msg.CMW(string.Format("REMOTE_GEN {0}", sec.section), true, 1);
web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/raw/branch/master/{f}/{sec.section}.dll", $@"structure\{sec.section}.dll");
json.settings.WriteSection(sec.section);
var bytes = GenerateAssemblyAndGetRawBytes(sec.section);
var appDomain = AppDomain.CreateDomain(sec.section, null, new AppDomainSetup
{
ShadowCopyFiles = "true",
LoaderOptimization = LoaderOptimization.MultiDomainHost
});
var assmblyLoaderType = typeof(AssmeblyLoader);
var assemblyLoader = (IAssemblyLoader)appDomain.CreateInstanceFromAndUnwrap(assmblyLoaderType.Assembly.Location, assmblyLoaderType.FullName);
assemblyLoader.Load(bytes);
AppDomain.Unload(appDomain);
}
else
{
fprog = fprog + 1;
msg.drawProgress(fprog, ftotal);
//msg.CMW($@"REMOTE_GET {sec.section}", true, 1);
web.SaveString($@"{giturl}/PoE-MxFilter-Structure/raw/branch/master/{f}/{sec.section}.filter", $"structure/{sec.section}.filter");
}
}
// Create the final filter.
msg.CMW($@"Creating the final filter...", true, 1);
foreach (var sec in j.structures)
{
if (sec.gen == true)
{
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", File.ReadAllText(string.Format("gen\\{0}.filter", sec.section)));
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
}
else
{
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", string.Format("# Section: {0}", sec.section) + Environment.NewLine);
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", File.ReadAllText(string.Format("structure\\{0}.filter", sec.section)));
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
}
}
ftotal = 0;
fprog = 0;
CleanDir();
}
// Download the sounds from the remote list
msg.CMW($@"Downloading the latest sound...", true, 1);
var sl = web.ReadString("https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/json/mxfiltergen_sound.json");
REMSND slj = JsonConvert.DeserializeObject<REMSND>(sl);
stotal = slj.sound.Count;
foreach (string s in slj.sound)
{
sprog = sprog + 1;
msg.drawProgress(sprog, stotal);
if (File.Exists($@"{path}\My Games\Path of Exile\{s}")) { File.Delete($@"{path}\My Games\Path of Exile\{s}"); }
web.DownloadFile($"https://git.mikx.xyz/mikx/PoE-MxFilter-Data/raw/branch/master/mp3/{s}", $@"{path}\My Games\Path of Exile\{s}");
}
// Clean all generated data
CleanDirData();
}
private static byte[] GenerateAssemblyAndGetRawBytes(string dll)
{
string lp = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var path = $@"{lp}\structure\{dll}.dll";
return File.ReadAllBytes(path);
}
public static void CleanDirData()
{
DirectoryInfo dataDir = new DirectoryInfo(@"data\");
DirectoryInfo genDir = new DirectoryInfo(@"gen\");
DirectoryInfo strucDir = new DirectoryInfo(@"structure\");
foreach (FileInfo file in dataDir.GetFiles())
{
file.Delete();
}
foreach (FileInfo file in genDir.GetFiles())
{
file.Delete();
}
foreach (FileInfo file in strucDir.GetFiles())
{
file.Delete();
}
}
public static void CleanDir()
{
DirectoryInfo genDir = new DirectoryInfo(@"gen\");
DirectoryInfo strucDir = new DirectoryInfo(@"structure\");
foreach (FileInfo file in genDir.GetFiles())
{
file.Delete();
}
foreach (FileInfo file in strucDir.GetFiles())
{
file.Delete();
}
}
private static void AutoUpdater_ApplicationExitEvent()
{
System.Environment.Exit(-1);
public List<main.STRUCTURE> structures { get; set; }
}
}
public interface IAssemblyLoader
{
void Load(byte[] bytes);
}
public class AssmeblyLoader : MarshalByRefObject, IAssemblyLoader
{
public void Load(byte[] bytes)
{
string section = main.section;
var assembly = AppDomain.CurrentDomain.Load(bytes);
Type type = AppDomain.CurrentDomain.GetAssemblies().SelectMany(t => t.GetTypes()).Where(t => String.Equals(t.Name, "Generator", StringComparison.Ordinal)).First();
object o = Activator.CreateInstance(type);
MethodInfo mi = o.GetType().GetMethod("Gen");
Object[] ob = new object[] { json.settings.GetSection(), "tobedeleted", main.league, json.settings.GetUniqueValue(), json.settings.GetFossilValue(), json.settings.GetCardValue() };
mi.Invoke(o, ob);
}
}
}
}

View File

@ -1,209 +1,215 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
class msg
internal class msg
{
public static void CM(string msg, bool time, int color)
{
string seconds = "";
string minutes = "";
string hours = "";
DateTime now;
string str1;
int num;
if (DateTime.Now.Second < 10)
{
seconds = String.Format("0{0}", DateTime.Now.Second);
now = DateTime.Now;
str1 = string.Format("0{0}", (object)now.Second);
}
else
{
seconds = DateTime.Now.Second.ToString();
num = DateTime.Now.Second;
str1 = num.ToString();
}
if (DateTime.Now.Minute < 10)
now = DateTime.Now;
string str2;
if (now.Minute < 10)
{
minutes = String.Format("0{0}", DateTime.Now.Minute);
now = DateTime.Now;
str2 = string.Format("0{0}", (object)now.Minute);
}
else
{
minutes = DateTime.Now.Minute.ToString();
now = DateTime.Now;
num = now.Minute;
str2 = num.ToString();
}
if (DateTime.Now.Hour < 10)
now = DateTime.Now;
string str3;
if (now.Hour < 10)
{
hours = String.Format("0{0}", DateTime.Now.Hour);
now = DateTime.Now;
str3 = string.Format("0{0}", (object)now.Hour);
}
else
{
hours = DateTime.Now.Hour.ToString();
now = DateTime.Now;
num = now.Hour;
str3 = num.ToString();
}
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
//color switch
ConsoleColor cc = ConsoleColor.White;
string str4 = string.Format("{0}:{1}:{2}", (object)str3, (object)str2, (object)str1);
ConsoleColor consoleColor = ConsoleColor.White;
switch (color)
{
case 0:
//nothing
break;
case 1:
cc = ConsoleColor.Cyan;
consoleColor = ConsoleColor.Cyan;
break;
case 2:
cc = ConsoleColor.Green;
consoleColor = ConsoleColor.Green;
break;
case 3:
cc = ConsoleColor.Red;
consoleColor = ConsoleColor.Red;
break;
}
if (time)
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format("[{0}] {1}", date, msg));
Console.ForegroundColor = consoleColor;
Console.WriteLine(string.Format("[{0}] {1}", (object)str4, (object)msg));
}
else
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format("{0}", msg));
Console.ForegroundColor = consoleColor;
Console.WriteLine(string.Format("{0}", (object)msg));
}
Console.ForegroundColor = ConsoleColor.White;
}
public static void CMW(string msg, bool time, int color)
{
string seconds = "";
string minutes = "";
string hours = "";
DateTime now;
string str1;
int num;
if (DateTime.Now.Second < 10)
{
seconds = String.Format("0{0}", DateTime.Now.Second);
now = DateTime.Now;
str1 = string.Format("0{0}", (object)now.Second);
}
else
{
seconds = DateTime.Now.Second.ToString();
num = DateTime.Now.Second;
str1 = num.ToString();
}
if (DateTime.Now.Minute < 10)
now = DateTime.Now;
string str2;
if (now.Minute < 10)
{
minutes = String.Format("0{0}", DateTime.Now.Minute);
now = DateTime.Now;
str2 = string.Format("0{0}", (object)now.Minute);
}
else
{
minutes = DateTime.Now.Minute.ToString();
now = DateTime.Now;
num = now.Minute;
str2 = num.ToString();
}
if (DateTime.Now.Hour < 10)
now = DateTime.Now;
string str3;
if (now.Hour < 10)
{
hours = String.Format("0{0}", DateTime.Now.Hour);
now = DateTime.Now;
str3 = string.Format("0{0}", (object)now.Hour);
}
else
{
hours = DateTime.Now.Hour.ToString();
now = DateTime.Now;
num = now.Hour;
str3 = num.ToString();
}
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
File.AppendAllText("mxfiltergen.logs", String.Format("[{0}] {1}", date, msg) + Environment.NewLine);
//color switch
ConsoleColor cc = ConsoleColor.White;
string str4 = string.Format("{0}:{1}:{2}", (object)str3, (object)str2, (object)str1);
File.AppendAllText("mxfiltergen.logs", string.Format("[{0}] {1}", (object)str4, (object)msg) + Environment.NewLine);
ConsoleColor consoleColor = ConsoleColor.White;
switch (color)
{
case 0:
//nothing
break;
case 1:
cc = ConsoleColor.Cyan;
consoleColor = ConsoleColor.Cyan;
break;
case 2:
cc = ConsoleColor.Green;
consoleColor = ConsoleColor.Green;
break;
case 3:
cc = ConsoleColor.Red;
consoleColor = ConsoleColor.Red;
break;
}
if (time)
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format("[{0}] {1}", date, msg));
Console.ForegroundColor = consoleColor;
Console.WriteLine(string.Format("[{0}] {1}", (object)str4, (object)msg));
}
else
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format(""));
Console.ForegroundColor = consoleColor;
Console.WriteLine(string.Format(""));
}
Console.ForegroundColor = ConsoleColor.White;
}
public static void drawProgress(int progress, int total)
{
string seconds = "";
string minutes = "";
string hours = "";
DateTime now;
string str1;
int num;
if (DateTime.Now.Second < 10)
{
seconds = String.Format("0{0}", DateTime.Now.Second);
now = DateTime.Now;
str1 = string.Format("0{0}", (object)now.Second);
}
else
{
seconds = DateTime.Now.Second.ToString();
num = DateTime.Now.Second;
str1 = num.ToString();
}
if (DateTime.Now.Minute < 10)
now = DateTime.Now;
string str2;
if (now.Minute < 10)
{
minutes = String.Format("0{0}", DateTime.Now.Minute);
now = DateTime.Now;
str2 = string.Format("0{0}", (object)now.Minute);
}
else
{
minutes = DateTime.Now.Minute.ToString();
now = DateTime.Now;
num = now.Minute;
str2 = num.ToString();
}
if (DateTime.Now.Hour < 10)
now = DateTime.Now;
string str3;
if (now.Hour < 10)
{
hours = String.Format("0{0}", DateTime.Now.Hour);
now = DateTime.Now;
str3 = string.Format("0{0}", (object)now.Hour);
}
else
{
hours = DateTime.Now.Hour.ToString();
now = DateTime.Now;
num = now.Hour;
str3 = num.ToString();
}
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
string beg = String.Format("[{0}] [", date);
string str4 = string.Format("[{0}] [", (object)string.Format("{0}:{1}:{2}", (object)str3, (object)str2, (object)str1));
Console.ForegroundColor = ConsoleColor.Cyan;
if (progress == 1)
{
Console.Write(beg);
Console.CursorLeft = total+beg.Length;
{
Console.Write(str4);
Console.CursorLeft = total + str4.Length;
Console.Write("]");
}
Console.CursorLeft = (progress + beg.Length)-1;
Console.Write($"#");
Console.CursorLeft = beg.Length + total + 2;
Console.Write($"{progress}/{total}");
if (progress == total)
{
Console.WriteLine();
}
Console.CursorLeft = progress + str4.Length - 1;
Console.Write("#");
Console.CursorLeft = str4.Length + total + 2;
Console.Write(string.Format("{0}/{1}", (object)progress, (object)total));
if (progress != total)
return;
Console.WriteLine();
}
public static void Splash()
public static void Splash(string progname, string dev)
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("");
Console.WriteLine("#### MxFilterGen");
Console.WriteLine(string.Format("#### VERSION: {0}",main.version));
Console.WriteLine("#### DEV: mikx");
Console.WriteLine($"#### {progname}");
Console.WriteLine(string.Format("#### VERSION: {0}", (object)main.version));
Console.WriteLine($"#### DEV: {dev}");
Console.WriteLine("#### POWERED BY: poe.ninja");
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.White;
}
}
}
}

View File

@ -50,3 +50,26 @@ I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCo
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.AssemblyReference.cache
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\System.Diagnostics.DiagnosticSource.xml
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.Fody.CopyLocal.cache
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\System.Diagnostics.DiagnosticSource.xml
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.AssemblyReference.cache
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.SuggestedBindingRedirects.cache
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.Fody.CopyLocal.cache
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
\\mxhome\Seagate\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
D:\Dev\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFi.17C09766.Up2Date

View File

@ -1,6 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="3.2.1" targetFramework="net452" />
<package id="Fody" version="3.3.3" targetFramework="net452" developmentDependency="true" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net452" />
<package id="Costura.Fody" version="5.7.0" targetFramework="net472" developmentDependency="true" />
<package id="Fody" version="6.6.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net472" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="System.AppContext" version="4.3.0" targetFramework="net472" />
<package id="System.Collections" version="4.3.0" targetFramework="net472" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net472" />
<package id="System.Console" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net472" />
<package id="System.Globalization" version="4.3.0" targetFramework="net472" />
<package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net472" />
<package id="System.IO" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net472" />
<package id="System.IO.FileSystem" version="4.3.0" targetFramework="net472" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Linq" version="4.3.0" targetFramework="net472" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Http" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net472" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net472" />
<package id="System.Threading" version="4.3.0" targetFramework="net472" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net472" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net472" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net472" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net472" />
</packages>

View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
internal class structures
{
public static string[] Filters()
{
string[] Filters = new string[] {
"Normal",
"Strict"
};
return Filters;
}
public static string[] Structures()
{
string[] Structures = new string[] {
"LEAGUE",
"FOSSIL(GEN)",
"FOSSIL",
"MISC",
"ESSENCE",
"SKILLGEM",
"MAPS",
"JEWEL",
"DIVINATIONCARD(GEN)",
"DIVINATIONCARD",
"EXPENSIVEUNIQUE(GEN)(Armours)",
"EXPENSIVEUNIQUE(GEN)(Weapons)",
"CURRENCY",
"INFLUENCED",
"ACCESSORIES",
"Tiers(GEN)",
"GEARBYSOCKET",
"GEARBYQUALITY",
"LEVELING",
"RECIPES",
"FLASK",
"HIDE",
};
return Structures;
}
}
}

View File

@ -1,27 +1,21 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
class web
internal class web
{
public static void SaveString(string url, string path)
{
WebClient wb = new WebClient();
wb.Encoding = Encoding.UTF8;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
WebClient webClient = new WebClient();
webClient.Encoding = Encoding.UTF8;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
try
{
Uri uri = new Uri(url);
var str = wb.DownloadString(uri);
File.AppendAllText(path, str, Encoding.UTF8);
Uri address = new Uri(url);
string contents = webClient.DownloadString(address);
System.IO.File.AppendAllText(path, contents, Encoding.UTF8);
}
catch (WebException ex)
{
@ -36,16 +30,14 @@ namespace PoE_MxFilterGen
public static string ReadString(string url)
{
WebClient wb = new WebClient();
wb.Encoding = Encoding.UTF8;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
var str = "";
WebClient webClient = new WebClient();
webClient.Encoding = Encoding.UTF8;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
string str = "";
try
{
Uri uri = new Uri(url);
str = wb.DownloadString(uri);
Uri address = new Uri(url);
str = webClient.DownloadString(address);
}
catch (WebException ex)
{
@ -61,15 +53,13 @@ namespace PoE_MxFilterGen
public static void DownloadFile(string url, string path)
{
WebClient wb = new WebClient();
wb.Encoding = Encoding.UTF8;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
WebClient webClient = new WebClient();
webClient.Encoding = Encoding.UTF8;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
try
{
Uri uri = new Uri(url);
wb.DownloadFile(uri,path);
Uri address = new Uri(url);
webClient.DownloadFile(address, path);
}
catch (WebException ex)
{

View File

@ -1,3 +1,16 @@
## MxFilterGen
Generate up to date Filter data for expensive uniques/cards based on the poe.ninja API.
MxFilterGen is my Path of Exile "Item Filter" Generator.
## Installation
- Install Visual Studio 2019 (Community or paid.) or newer.
- Get the source, put it inside a folder and open it.
- Build and copy the executable to a dedicated folder.
- Launch it, close it and edit the settings.json file.
- You are now ready to use it!
## Usage
- Edit the settings.json file to your desired config.
- Turn off Tier item type as you like.
- Set the values to a desired amount.
- Launch the generator.
- Copy the filter from the "out" directory within the generator folder.