Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Version 1.0.3.15
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmood authored and mahmood committed Oct 14, 2016
1 parent 999821e commit 8991f4b
Show file tree
Hide file tree
Showing 17 changed files with 169 additions and 126 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified ADTConvert.sln
100644 → 100755
Empty file.
Empty file modified ADTConvert/ADT.ico
100644 → 100755
Empty file.
204 changes: 118 additions & 86 deletions ADTConvert/ADTConvert.csproj
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,93 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D4F029E7-76BF-477E-9511-4C764418098B}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ADTConvert</RootNamespace>
<AssemblyName>ADTConvert</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>ADT.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsoleConfig.cs" />
<Compile Include="Helper.cs" />
<Compile Include="Main.cs" />
<Compile Include="Program.cs" />
<Content Include="Properties\AssemblyInfo.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AssemblyInfo1.cs</LastGenOutput>
</Content>
<Compile Include="Properties\AssemblyInfo1.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>AssemblyInfo.tt</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="VersionCheck\GithubRealaseModel.cs" />
<Compile Include="VersionCheck\VersionCheck.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="ADT.ico" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D4F029E7-76BF-477E-9511-4C764418098B}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ADTConvert</RootNamespace>
<AssemblyName>ADTConvert</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>ADT.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsoleConfig.cs" />
<Compile Include="Helper.cs" />
<Compile Include="Main.cs" />
<Compile Include="Program.cs" />
<Content Include="Properties\AssemblyInfo.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AssemblyInfo1.cs</LastGenOutput>
</Content>
<Compile Include="Properties\AssemblyInfo1.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>AssemblyInfo.tt</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="VersionCheck\GithubRealaseModel.cs" />
<Compile Include="VersionCheck\VersionCheck.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="ADT.ico" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
<Visible>False</Visible>
<ProductName>Windows Installer 4.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
Empty file modified ADTConvert/ConsoleConfig.cs
100644 → 100755
Empty file.
Empty file modified ADTConvert/Helper.cs
100644 → 100755
Empty file.
37 changes: 24 additions & 13 deletions ADTConvert/Main.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ struct DataChunk
public string Signature;
public int Size;
public byte[] Data;
}

}

bool inputIsDir;
BinaryReader inputReader = null;
private string adtName = "";
private string exportPath = "";
List<DataChunk> chunks = new List<DataChunk>();
ConsoleConfig config = ConsoleConfig.Instance;
private HashSet<string> filesToProcess = new HashSet<string>();
private HashSet<string> filesToProcess = new HashSet<string>();


public Main()
{
if(config.Watch)
inputIsDir = Directory.Exists(config.Input);
if (inputIsDir && config.Watch)
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = config.Input;
Expand All @@ -37,10 +40,18 @@ public Main()
Console.WriteLine("Watcher active");
Console.ResetColor();

Console.WriteLine("\nPress any key to stop the converter watcher");
Console.ReadKey();
Console.WriteLine("\nPress ESC to stop the watcher");
while(Console.ReadKey().Key != ConsoleKey.Escape) { }

watcher.Dispose();
}
else if(inputIsDir && !config.Watch)
{
foreach (string file in Directory.EnumerateFiles(config.Input, "*.adt", SearchOption.AllDirectories))
{
convertADT(file);
}
}
else
{
convertADT(config.Input);
Expand All @@ -61,25 +72,25 @@ private void OnADTChanged(object sender, FileSystemEventArgs e)

Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Convert complete");
Console.ResetColor();

Console.WriteLine("\nPress any key to stop the converter watcher");
Console.ResetColor();

Console.WriteLine("\nPress ESC to stop the watcher");
filesToProcess.Add(e.FullPath);
}

private bool convertADT(string input)
{
Console.WriteLine("\n--- Base ADT Load ---");
adtName = Path.GetFileName(input);
exportPath = (Path.GetDirectoryName(input) == "" ? AppDomain.CurrentDomain.BaseDirectory : Path.GetFullPath(Path.GetDirectoryName(input))) + (config.Watch ? @"\.." : "") + @"\export\";
exportPath = (config.Output != null ? config.Output + @"\" : exportPath);
exportPath = (Path.GetDirectoryName(input) == "" ? AppDomain.CurrentDomain.BaseDirectory : Path.GetFullPath(Path.GetDirectoryName(input))) + (config.Watch || inputIsDir ? "/.." : "") + "/export/";
exportPath = (config.Output != null ? config.Output + "/" : exportPath);

if(config.Watch)
if(inputIsDir)
{
string folderStruct = input.Replace(config.Input, "");

if (folderStruct != "")
exportPath += Path.GetDirectoryName(folderStruct) + @"\";
exportPath += Path.GetDirectoryName(folderStruct) + "/";
}

if (!Directory.Exists(exportPath))
Expand Down
14 changes: 7 additions & 7 deletions ADTConvert/Program.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ static void Main(string[] args)
}

// Check if input file/dir exist
if (!File.Exists(config.Input) && !config.Watch)
if (!File.Exists(config.Input) && !Directory.Exists(config.Input) && !config.Watch)
{
ConsoleErrorEnd($"File {config.Input} not found!");
ConsoleErrorEnd($"Input File or Directory {config.Input} not found!");
}
else if(!Directory.Exists(config.Input) && config.Watch)
{
Expand All @@ -49,8 +49,8 @@ static void Main(string[] args)

if(!config.SilentMode && !config.Watch)
{
Console.WriteLine("\nPress any key to close the converter");
Console.ReadKey();
Console.WriteLine("\nPress ESC to close the converter");
while (Console.ReadKey().Key != ConsoleKey.Escape) { }
}
}

Expand All @@ -67,7 +67,7 @@ public static void ConsoleErrorEnd(string error = "")
}

Console.WriteLine("Help");
Console.WriteLine(" {0}.exe filename [parameter]\n", processName);
Console.WriteLine(" {0}.exe input [parameter]\n", processName);
Console.WriteLine("Parameter");
Console.WriteLine(" -o, --output\t\t\t\tOutput path");
Console.WriteLine(" -v, --verbose\t\t\t\tPrints all messages to standard output");
Expand All @@ -77,8 +77,8 @@ public static void ConsoleErrorEnd(string error = "")

Console.WriteLine(" -noUpdate, --disableUpdateCheck\tDisable the Update check");

Console.WriteLine("\nPress any key to close the converter");
Console.ReadKey();
Console.WriteLine("\nPress ESC to close the converter");
while (Console.ReadKey().Key != ConsoleKey.Escape) { }
Environment.Exit(0);
}
}
Expand Down
4 changes: 2 additions & 2 deletions ADTConvert/Properties/AssemblyInfo.tt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ using System.Reflection;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.0.2.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.0.2.<#= this.RevisionNumber #>")]
[assembly: AssemblyVersion("1.0.3.<#= RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.0.3.<#= RevisionNumber #>")]
<#+
int RevisionNumber = (int)(DateTime.UtcNow - new DateTime(2016,09,29)).TotalDays;
#>
36 changes: 18 additions & 18 deletions ADTConvert/Properties/AssemblyInfo1.cs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyTitle("ADTConvert")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ADTConvert")]
[assembly: AssemblyCopyright("Created by Luzifix")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.0.2.4")]
[assembly: AssemblyFileVersion("1.0.2.4")]
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyTitle("ADTConvert")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ADTConvert")]
[assembly: AssemblyCopyright("Created by Luzifix")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.0.3.15")]
[assembly: AssemblyFileVersion("1.0.3.15")]
Empty file modified ADTConvert/Properties/Settings.Designer.cs
100644 → 100755
Empty file.
Empty file modified ADTConvert/Properties/Settings.settings
100644 → 100755
Empty file.
Empty file modified ADTConvert/VersionCheck/GithubRealaseModel.cs
100644 → 100755
Empty file.
Empty file modified ADTConvert/VersionCheck/VersionCheck.cs
100644 → 100755
Empty file.
Empty file modified ADTConvert/app.config
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.

0 comments on commit 8991f4b

Please sign in to comment.