Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkLotus committed Apr 20, 2019
1 parent c9a4110 commit 0e6d22d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
41 changes: 34 additions & 7 deletions CEasyUO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>.\cuoapi.dll</HintPath>
</Reference>
<Reference Include="EasyAntlr">
<HintPath>C:\Users\James\Documents\Visual Studio 2017\Projects\EasyLoA\EasyAntlr\bin\Debug\EasyAntlr.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -56,10 +53,6 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Ultima, Version=4.3.3.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Ultima.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Core\ActionQueue.cs" />
Expand All @@ -70,6 +63,40 @@
<Compile Include="Scripting\Lexer.cs" />
<Compile Include="Scripting\ParseException.cs" />
<Compile Include="Scripting\SpracheParser.cs" />
<Compile Include="Ultima\AnimationEdit.cs" />
<Compile Include="Ultima\Animations.cs" />
<Compile Include="Ultima\Animdata.cs" />
<Compile Include="Ultima\Art.cs" />
<Compile Include="Ultima\ASCIIFont.cs" />
<Compile Include="Ultima\CalibrationInfo.cs" />
<Compile Include="Ultima\Client.cs" />
<Compile Include="Ultima\ClientHandles.cs" />
<Compile Include="Ultima\FileIndex.cs" />
<Compile Include="Ultima\Files.cs" />
<Compile Include="Ultima\Gumps.cs" />
<Compile Include="Ultima\Hues.cs" />
<Compile Include="Ultima\Light.cs" />
<Compile Include="Ultima\LocationPointer.cs" />
<Compile Include="Ultima\Map.cs" />
<Compile Include="Ultima\MultiMap.cs" />
<Compile Include="Ultima\Multis.cs" />
<Compile Include="Ultima\NativeMethods.cs" />
<Compile Include="Ultima\ProcessStream.cs" />
<Compile Include="Ultima\RadarCol.cs" />
<Compile Include="Ultima\SkillGroups.cs" />
<Compile Include="Ultima\Skills.cs" />
<Compile Include="Ultima\Sound.cs" />
<Compile Include="Ultima\SpeechList.cs" />
<Compile Include="Ultima\StringEntry.cs" />
<Compile Include="Ultima\StringList.cs" />
<Compile Include="Ultima\Textures.cs" />
<Compile Include="Ultima\TileData.cs" />
<Compile Include="Ultima\TileList.cs" />
<Compile Include="Ultima\TileMatrix.cs" />
<Compile Include="Ultima\TileMatrixPatch.cs" />
<Compile Include="Ultima\UnicodeFont.cs" />
<Compile Include="Ultima\Verdata.cs" />
<Compile Include="Ultima\WindowProcessStream.cs" />
<Content Include="Core\Actions.cs">
<SubType>Component</SubType>
</Content>
Expand Down
19 changes: 18 additions & 1 deletion Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,31 @@ public Engine()

public static bool UsePostKRPackets => ClientVersion >= ClientVersions.CV_6017;
private static string _rootPath = null;
public static string RootPath => _rootPath ?? ( _rootPath = Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location ) );
public static string RootPath => _rootPath ?? ( _rootPath = Path.GetDirectoryName( Assembly.GetAssembly( typeof( Engine ) ).Location ) );
public static string UOFilePath { get; internal set; }
public static bool IsInstalled { get; internal set; }
public static CEasyUOMainForm m_MainForm;

public static unsafe void Install( PluginHeader* header )
{
Console.WriteLine( "Install Invoked CEasyUO" );
AppDomain.CurrentDomain.AssemblyResolve += ( sender, e ) =>
{
string[] fields = e.Name.Split( ',' );
string name = fields[0];
string culture = fields[2];

if ( name.EndsWith( ".resources" ) && !culture.EndsWith( "neutral" ) )
{
return null;
}
AssemblyName askedassembly = new AssemblyName( e.Name );

bool isdll = File.Exists( Path.Combine( RootPath, askedassembly.Name + ".dll" ) );

return Assembly.LoadFile( Path.Combine( RootPath, askedassembly.Name + ( isdll ? ".dll" : ".exe" ) ) );

};
try
{
ClientVersion = (ClientVersions)header->ClientVersion;
Expand Down

0 comments on commit 0e6d22d

Please sign in to comment.