Skip to content

Commit

Permalink
first go-round with cuoapi project
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinEady committed Jun 2, 2020
1 parent 211d4b0 commit 4a37256
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 39 deletions.
17 changes: 17 additions & 0 deletions ClassicUO.sln
Expand Up @@ -39,6 +39,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "monokickstart", "monokickst
tools\monokickstart\System.Xml.dll = tools\monokickstart\System.Xml.dll
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUO_API", "cuoapi\CUO_API\CUO_API.csproj", "{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cuoapi", "cuoapi", "{652E7C10-2C0E-41A8-AB06-4A1A6915524C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -71,6 +75,18 @@ Global
{71196848-ED41-4A9A-944C-F5776A9EFA07}.Release|x64.ActiveCfg = Release|Any CPU
{71196848-ED41-4A9A-944C-F5776A9EFA07}.Release|x86.ActiveCfg = Release|Any CPU
{71196848-ED41-4A9A-944C-F5776A9EFA07}.Release|x86.Build.0 = Release|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Debug|x64.ActiveCfg = Debug|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Debug|x64.Build.0 = Debug|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Debug|x86.ActiveCfg = Debug|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Debug|x86.Build.0 = Debug|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Release|Any CPU.Build.0 = Release|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Release|x64.ActiveCfg = Release|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Release|x64.Build.0 = Release|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Release|x86.ActiveCfg = Release|Any CPU
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -79,6 +95,7 @@ Global
{71F289FA-0EF8-4F72-A26E-A8280C0931C5} = {36371756-8DDA-41A4-BB9A-B7651459ADC1}
{71196848-ED41-4A9A-944C-F5776A9EFA07} = {D5E764E7-2719-4937-AC10-0D2D789A1134}
{D7DD340F-1EE2-4F8A-AA3E-A8FC76098AD6} = {D5E764E7-2719-4937-AC10-0D2D789A1134}
{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF} = {652E7C10-2C0E-41A8-AB06-4A1A6915524C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0A99E91A-ADAB-45C3-8170-2656140F6EFA}
Expand Down
47 changes: 47 additions & 0 deletions cuoapi/CUO_API/CUO_API.csproj
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CUO_API</RootNamespace>
<AssemblyName>cuoapi</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
63 changes: 63 additions & 0 deletions cuoapi/CUO_API/Main.cs
@@ -0,0 +1,63 @@
using System;

namespace CUO_API
{
public delegate void OnCastSpell(int idx);
public delegate void OnClientClose();
public delegate void OnConnected();
public delegate void OnDisconnected();
public delegate void OnFocusGained();
public delegate void OnFocusLost();
public delegate short OnGetPacketLength(int id);
public delegate bool OnGetPlayerPosition(out int x, out int y, out int z);
public delegate void OnGetStaticImage(ushort g, ref ArtInfo art);
public delegate string OnGetUOFilePath();
public delegate bool OnHotkey(int key, int mod, bool pressed);
public delegate void OnInitialize();
public delegate void OnMouse(int button, int wheel);
public delegate bool OnPacketSendRecv(ref byte[] data, ref int length);
public delegate void OnSetTitle(string title);
public delegate void OnTick();
public delegate void OnUpdatePlayerPosition(int x, int y, int z);
public delegate bool RequestMove(int dir, bool run);
public delegate bool OnPacketSendRecv_new(byte[] data, ref int length);
public delegate bool OnPacketSendRecv_new_intptr(IntPtr data, ref int length);

public struct PluginHeader
{
public int ClientVersion;
public IntPtr Tick;
public IntPtr GetStaticImage;
public IntPtr CastSpell;
public IntPtr GetPlayerPosition;
public IntPtr GetPacketLength;
public IntPtr Send;
public IntPtr Recv;
public IntPtr Send_new;
public IntPtr Recv_new;
public IntPtr GetUOFilePath;
public IntPtr OnFocusLost;
public IntPtr RequestMove;
public IntPtr OnFocusGained;
public IntPtr OnConnected;
public IntPtr OnInitialize;
public IntPtr OnClientClosing;
public IntPtr OnPlayerPositionChanged;
public IntPtr OnMouse;
public IntPtr OnHotkeyPressed;
public IntPtr OnSend;
public IntPtr OnRecv;
public IntPtr OnSend_new;
public IntPtr OnRecv_new;
public IntPtr HWND;
public IntPtr OnDisconnected;
public IntPtr SetTitle;
}
public struct ArtInfo
{
public long Address;
public long Size;
public long CompressedSize;
}
}

36 changes: 36 additions & 0 deletions cuoapi/CUO_API/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CUO_API")]
[assembly: AssemblyDescription("Type Library for ClassicUO")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CUO_API")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4a3c19bd-f557-4c69-b29a-e60dbe61dbff")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
14 changes: 6 additions & 8 deletions src/ClassicUO.csproj
Expand Up @@ -84,10 +84,6 @@
<ApplicationIcon>cuoicon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="cuoapi, Version=1.3.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>libs\api\cuoapi.dll</HintPath>
</Reference>
<Reference Include="FNA, Version=20.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>libs\FNA\FNA.dll</HintPath>
Expand Down Expand Up @@ -570,9 +566,6 @@
<Content Include="cuoicon.ico" />
<None Include="shaders\xBR.fx" />
<EmbeddedResource Include="cuologo.png" />
<Content Include="libs\api\cuoapi.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="libs\x64\FAudio.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -595,7 +588,12 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\cuoapi\CUO_API\CUO_API.csproj">
<Project>{4A3C19BD-F557-4C69-B29A-E60DBE61DBFF}</Project>
<Name>CUO_API</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down
29 changes: 0 additions & 29 deletions src/Network/Plugin.cs
Expand Up @@ -76,35 +76,6 @@ internal unsafe class Plugin
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteFile(string name);

struct PluginHeader
{
public int ClientVersion;
public IntPtr HWND;
public IntPtr OnRecv;
public IntPtr OnSend;
public IntPtr OnHotkeyPressed;
public IntPtr OnMouse;
public IntPtr OnPlayerPositionChanged;
public IntPtr OnClientClosing;
public IntPtr OnInitialize;
public IntPtr OnConnected;
public IntPtr OnDisconnected;
public IntPtr OnFocusGained;
public IntPtr OnFocusLost;
public IntPtr GetUOFilePath;
public IntPtr Recv;
public IntPtr Send;
public IntPtr GetPacketLength;
public IntPtr GetPlayerPosition;
public IntPtr CastSpell;
public IntPtr GetStaticImage;
public IntPtr Tick;
public IntPtr RequestMove;
public IntPtr SetTitle;

public IntPtr OnRecv_new, OnSend_new, Recv_new, Send_new;
}

private Plugin(string path)
{
_path = path;
Expand Down
Binary file removed src/libs/api/cuoapi.dll
Binary file not shown.
2 changes: 0 additions & 2 deletions tools/ManifestCreator/Program.cs
Expand Up @@ -32,8 +32,6 @@ class Program


// libs
"libs/api/cuoapi.dll",

"libs/lib64/libFAudio.so.0",
"libs/lib64/libbdiplus.so",
"libs/lib64/libmojoshader.so",
Expand Down

0 comments on commit 4a37256

Please sign in to comment.