mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-07-12 17:34:33 +00:00
Begin transition to the new ModLoader paradigm. Begin cleaning up code.
This commit is contained in:
parent
015a9f4dc8
commit
cb9895a38e
39 changed files with 1429 additions and 967 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -11,3 +11,7 @@
|
||||||
*.idb
|
*.idb
|
||||||
*.unsuccessfulbuild
|
*.unsuccessfulbuild
|
||||||
*.lastbuildstate
|
*.lastbuildstate
|
||||||
|
*.cache
|
||||||
|
*.ipch
|
||||||
|
*.exp
|
||||||
|
*.suo
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,126 +1,129 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{9B3A3214-400B-4245-85FD-EA12D5F791D4}</ProjectGuid>
|
<ProjectGuid>{9B3A3214-400B-4245-85FD-EA12D5F791D4}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>Common</RootNamespace>
|
<RootNamespace>Common</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<IncludePath>include;$(IncludePath)</IncludePath>
|
<IncludePath>include;$(IncludePath)</IncludePath>
|
||||||
<TargetName>Common</TargetName>
|
<TargetName>Common</TargetName>
|
||||||
<OutDir>$(SolutionDir)</OutDir>
|
<OutDir>$(SolutionDir)</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IncludePath>include;$(IncludePath)</IncludePath>
|
<IncludePath>include;$(IncludePath)</IncludePath>
|
||||||
<OutDir>$(SolutionDir)</OutDir>
|
<OutDir>$(SolutionDir)</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;COMMON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="include\DXAPI\DXAPI.h" />
|
<ClInclude Include="include\DXAPI\AIConnection.h" />
|
||||||
<ClInclude Include="include\DXAPI\FlyingVehicle.h" />
|
<ClInclude Include="include\DXAPI\DXAPI.h" />
|
||||||
<ClInclude Include="include\DXAPI\GameBase.h" />
|
<ClInclude Include="include\DXAPI\FlyingVehicle.h" />
|
||||||
<ClInclude Include="include\DXAPI\GameConnection.h" />
|
<ClInclude Include="include\DXAPI\GameBase.h" />
|
||||||
<ClInclude Include="include\DXAPI\GrenadeProjectile.h" />
|
<ClInclude Include="include\DXAPI\GameConnection.h" />
|
||||||
<ClInclude Include="include\DXAPI\Move.h" />
|
<ClInclude Include="include\DXAPI\GrenadeProjectile.h" />
|
||||||
<ClInclude Include="include\DXAPI\NetConnection.h" />
|
<ClInclude Include="include\DXAPI\Move.h" />
|
||||||
<ClInclude Include="include\DXAPI\NetObject.h" />
|
<ClInclude Include="include\DXAPI\NetConnection.h" />
|
||||||
<ClInclude Include="include\DXAPI\Player.h" />
|
<ClInclude Include="include\DXAPI\NetObject.h" />
|
||||||
<ClInclude Include="include\DXAPI\Point3F.h" />
|
<ClInclude Include="include\DXAPI\Player.h" />
|
||||||
<ClInclude Include="include\DXAPI\Projectile.h" />
|
<ClInclude Include="include\DXAPI\Point3F.h" />
|
||||||
<ClInclude Include="include\DXAPI\SceneObject.h" />
|
<ClInclude Include="include\DXAPI\Projectile.h" />
|
||||||
<ClInclude Include="include\DXAPI\ScriptObject.h" />
|
<ClInclude Include="include\DXAPI\SceneObject.h" />
|
||||||
<ClInclude Include="include\DXAPI\ShapeBase.h" />
|
<ClInclude Include="include\DXAPI\ScriptObject.h" />
|
||||||
<ClInclude Include="include\DXAPI\SimObject.h" />
|
<ClInclude Include="include\DXAPI\ShapeBase.h" />
|
||||||
<ClInclude Include="include\DXAPI\StaticShape.h" />
|
<ClInclude Include="include\DXAPI\SimObject.h" />
|
||||||
<ClInclude Include="include\DXAPI\TCPObject.h" />
|
<ClInclude Include="include\DXAPI\StaticShape.h" />
|
||||||
<ClInclude Include="include\DXAPI\Vehicle.h" />
|
<ClInclude Include="include\DXAPI\TCPObject.h" />
|
||||||
<ClInclude Include="include\LinkerAPI.h" />
|
<ClInclude Include="include\DXAPI\Vehicle.h" />
|
||||||
</ItemGroup>
|
<ClInclude Include="include\LinkerAPI.h" />
|
||||||
<ItemGroup>
|
<ClInclude Include="include\ModLoader\ModLoader.h" />
|
||||||
<ClCompile Include="source\DXAPI\DXAPI.cpp" />
|
</ItemGroup>
|
||||||
<ClCompile Include="source\DXAPI\FlyingVehicle.cpp" />
|
<ItemGroup>
|
||||||
<ClCompile Include="source\DXAPI\GameBase.cpp" />
|
<ClCompile Include="source\DXAPI\AIConnection.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\GameConnection.cpp" />
|
<ClCompile Include="source\DXAPI\DXAPI.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\GrenadeProjectile.cpp" />
|
<ClCompile Include="source\DXAPI\FlyingVehicle.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\Move.cpp" />
|
<ClCompile Include="source\DXAPI\GameBase.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\NetConnection.cpp" />
|
<ClCompile Include="source\DXAPI\GameConnection.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\NetObject.cpp" />
|
<ClCompile Include="source\DXAPI\GrenadeProjectile.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\Player.cpp" />
|
<ClCompile Include="source\DXAPI\Move.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\Point3F.cpp" />
|
<ClCompile Include="source\DXAPI\NetConnection.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\Projectile.cpp" />
|
<ClCompile Include="source\DXAPI\NetObject.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\SceneObject.cpp" />
|
<ClCompile Include="source\DXAPI\Player.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\ScriptObject.cpp" />
|
<ClCompile Include="source\DXAPI\Point3F.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\ShapeBase.cpp" />
|
<ClCompile Include="source\DXAPI\Projectile.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\SimObject.cpp" />
|
<ClCompile Include="source\DXAPI\SceneObject.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\StaticShape.cpp" />
|
<ClCompile Include="source\DXAPI\ScriptObject.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\TCPObject.cpp" />
|
<ClCompile Include="source\DXAPI\ShapeBase.cpp" />
|
||||||
<ClCompile Include="source\DXAPI\Vehicle.cpp" />
|
<ClCompile Include="source\DXAPI\SimObject.cpp" />
|
||||||
<ClCompile Include="source\LinkerAPI.cpp" />
|
<ClCompile Include="source\DXAPI\StaticShape.cpp" />
|
||||||
</ItemGroup>
|
<ClCompile Include="source\DXAPI\TCPObject.cpp" />
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<ClCompile Include="source\DXAPI\Vehicle.cpp" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ClCompile Include="source\LinkerAPI.cpp" />
|
||||||
</ImportGroup>
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,135 +1,153 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Source Files">
|
<Filter Include="Source Files">
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Header Files">
|
<Filter Include="Header Files">
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Resource Files">
|
<Filter Include="Resource Files">
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
<Filter Include="Header Files\DXAPI">
|
||||||
<ItemGroup>
|
<UniqueIdentifier>{4e8c3150-9f1d-4cbf-84f2-8dc65b11689f}</UniqueIdentifier>
|
||||||
<ClInclude Include="include\DXAPI\DXAPI.h">
|
</Filter>
|
||||||
<Filter>Header Files</Filter>
|
<Filter Include="Source Files\DXAPI">
|
||||||
</ClInclude>
|
<UniqueIdentifier>{cbe0f5ac-7a8c-42ef-872a-f792f27a0cbb}</UniqueIdentifier>
|
||||||
<ClInclude Include="include\DXAPI\FlyingVehicle.h">
|
</Filter>
|
||||||
<Filter>Header Files</Filter>
|
<Filter Include="Header Files\ModLoader">
|
||||||
</ClInclude>
|
<UniqueIdentifier>{dac4c4a7-1792-4304-bbc5-7254e1795b10}</UniqueIdentifier>
|
||||||
<ClInclude Include="include\DXAPI\GameBase.h">
|
</Filter>
|
||||||
<Filter>Header Files</Filter>
|
</ItemGroup>
|
||||||
</ClInclude>
|
<ItemGroup>
|
||||||
<ClInclude Include="include\DXAPI\GameConnection.h">
|
<ClInclude Include="include\LinkerAPI.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\GrenadeProjectile.h">
|
<ClInclude Include="include\DXAPI\AIConnection.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\NetConnection.h">
|
<ClInclude Include="include\DXAPI\GrenadeProjectile.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\NetObject.h">
|
<ClInclude Include="include\DXAPI\DXAPI.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\Player.h">
|
<ClInclude Include="include\DXAPI\FlyingVehicle.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\Point3F.h">
|
<ClInclude Include="include\DXAPI\GameBase.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\Projectile.h">
|
<ClInclude Include="include\DXAPI\GameConnection.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\SceneObject.h">
|
<ClInclude Include="include\DXAPI\Move.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\ScriptObject.h">
|
<ClInclude Include="include\DXAPI\Vehicle.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\ShapeBase.h">
|
<ClInclude Include="include\DXAPI\NetConnection.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\SimObject.h">
|
<ClInclude Include="include\DXAPI\NetObject.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\StaticShape.h">
|
<ClInclude Include="include\DXAPI\Player.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\TCPObject.h">
|
<ClInclude Include="include\DXAPI\Point3F.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\Vehicle.h">
|
<ClInclude Include="include\DXAPI\Projectile.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\LinkerAPI.h">
|
<ClInclude Include="include\DXAPI\SceneObject.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\DXAPI\Move.h">
|
<ClInclude Include="include\DXAPI\ScriptObject.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
<ClInclude Include="include\DXAPI\ShapeBase.h">
|
||||||
<ItemGroup>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
<ClCompile Include="source\DXAPI\DXAPI.cpp">
|
</ClInclude>
|
||||||
<Filter>Source Files</Filter>
|
<ClInclude Include="include\DXAPI\SimObject.h">
|
||||||
</ClCompile>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
<ClCompile Include="source\DXAPI\FlyingVehicle.cpp">
|
</ClInclude>
|
||||||
<Filter>Source Files</Filter>
|
<ClInclude Include="include\DXAPI\StaticShape.h">
|
||||||
</ClCompile>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
<ClCompile Include="source\DXAPI\GameBase.cpp">
|
</ClInclude>
|
||||||
<Filter>Source Files</Filter>
|
<ClInclude Include="include\DXAPI\TCPObject.h">
|
||||||
</ClCompile>
|
<Filter>Header Files\DXAPI</Filter>
|
||||||
<ClCompile Include="source\DXAPI\GameConnection.cpp">
|
</ClInclude>
|
||||||
<Filter>Source Files</Filter>
|
<ClInclude Include="include\ModLoader\ModLoader.h">
|
||||||
</ClCompile>
|
<Filter>Header Files\ModLoader</Filter>
|
||||||
<ClCompile Include="source\DXAPI\GrenadeProjectile.cpp">
|
</ClInclude>
|
||||||
<Filter>Source Files</Filter>
|
</ItemGroup>
|
||||||
</ClCompile>
|
<ItemGroup>
|
||||||
<ClCompile Include="source\DXAPI\NetConnection.cpp">
|
<ClCompile Include="source\LinkerAPI.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\NetObject.cpp">
|
<ClCompile Include="source\DXAPI\AIConnection.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\Player.cpp">
|
<ClCompile Include="source\DXAPI\GrenadeProjectile.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\Point3F.cpp">
|
<ClCompile Include="source\DXAPI\DXAPI.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\Projectile.cpp">
|
<ClCompile Include="source\DXAPI\FlyingVehicle.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\SceneObject.cpp">
|
<ClCompile Include="source\DXAPI\GameBase.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\ScriptObject.cpp">
|
<ClCompile Include="source\DXAPI\GameConnection.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\ShapeBase.cpp">
|
<ClCompile Include="source\DXAPI\Move.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\SimObject.cpp">
|
<ClCompile Include="source\DXAPI\Vehicle.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\StaticShape.cpp">
|
<ClCompile Include="source\DXAPI\NetConnection.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\TCPObject.cpp">
|
<ClCompile Include="source\DXAPI\NetObject.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\Vehicle.cpp">
|
<ClCompile Include="source\DXAPI\Player.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\LinkerAPI.cpp">
|
<ClCompile Include="source\DXAPI\Point3F.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="source\DXAPI\Move.cpp">
|
<ClCompile Include="source\DXAPI\Projectile.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
<ClCompile Include="source\DXAPI\SceneObject.cpp">
|
||||||
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\DXAPI\ScriptObject.cpp">
|
||||||
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\DXAPI\ShapeBase.cpp">
|
||||||
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\DXAPI\SimObject.cpp">
|
||||||
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\DXAPI\StaticShape.cpp">
|
||||||
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\DXAPI\TCPObject.cpp">
|
||||||
|
<Filter>Source Files\DXAPI</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
#v4.0:v100
|
#v4.0:v100
|
||||||
Release|Win32|C:\t2cpp\T2-CPP-master\|
|
Release|Win32|C:\Documents and Settings\NobodyBla\Desktop\T2AI\T2-CPP-master\|
|
||||||
|
|
|
||||||
24
CommonAPI/Common/include/DXAPI/AIConnection.h
Normal file
24
CommonAPI/Common/include/DXAPI/AIConnection.h
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <DXAPI/Move.h>
|
||||||
|
#include <DXAPI/GameConnection.h>
|
||||||
|
|
||||||
|
namespace DX
|
||||||
|
{
|
||||||
|
class AIConnection : public GameConnection
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AIConnection(unsigned int obj);
|
||||||
|
|
||||||
|
//! Whether or not this bot should use custom moves.
|
||||||
|
bool mUseCustomMoves;
|
||||||
|
|
||||||
|
//! The custom move for this bot.
|
||||||
|
Move mCustomMove;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Computes the current move for this bot.
|
||||||
|
*/
|
||||||
|
void generateMove(void);
|
||||||
|
};
|
||||||
|
} // End NameSpace DX
|
||||||
|
|
@ -38,13 +38,25 @@ namespace DX
|
||||||
typedef void* UnresolvedObject;
|
typedef void* UnresolvedObject;
|
||||||
|
|
||||||
const char *GetModPaths(void);
|
const char *GetModPaths(void);
|
||||||
|
|
||||||
bool IsFile(const char *filename);
|
bool IsFile(const char *filename);
|
||||||
const char * StringTableInsert(const char * str,bool casesensitive) ;
|
|
||||||
|
const char * StringTableInsert(const char * str,bool casesensitive);
|
||||||
|
|
||||||
bool GetRelativePath(const char *filename, char *ret, int buffer_length);
|
bool GetRelativePath(const char *filename, char *ret, int buffer_length);
|
||||||
|
|
||||||
bool GetRunningMod(char *ret, int buffer_length);
|
bool GetRunningMod(char *ret, int buffer_length);
|
||||||
|
|
||||||
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size);
|
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size);
|
||||||
|
|
||||||
bool memToHex(unsigned int addr, char * dst, int size, bool spaces);
|
bool memToHex(unsigned int addr, char * dst, int size, bool spaces);
|
||||||
|
|
||||||
unsigned int memToUInt(unsigned int addr);
|
unsigned int memToUInt(unsigned int addr);
|
||||||
|
|
||||||
float memToFloat(unsigned int addr);
|
float memToFloat(unsigned int addr);
|
||||||
|
|
||||||
bool SanitizeFileName(char *ret, int buffer_length);
|
bool SanitizeFileName(char *ret, int buffer_length);
|
||||||
|
|
||||||
|
//! Initializes all hooks for the engine.
|
||||||
|
void initializeHooks(void);
|
||||||
} // End NameSpace DX
|
} // End NameSpace DX
|
||||||
|
|
@ -7,12 +7,18 @@
|
||||||
|
|
||||||
namespace DX
|
namespace DX
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @brief A class representing an incoming connection to the Tribes 2 server.
|
||||||
|
*/
|
||||||
class GameConnection : public NetConnection
|
class GameConnection : public NetConnection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GameConnection(unsigned int obj);
|
GameConnection(unsigned int obj);
|
||||||
|
|
||||||
ShapeBase getControlObject(void);
|
/**
|
||||||
|
* @brief Gets the control object this game connection is controlling.
|
||||||
|
* @return The shapebase instance being controlled.
|
||||||
|
*/
|
||||||
|
ShapeBase getControlObject(void);
|
||||||
};
|
};
|
||||||
} // End NameSpace DX
|
} // End NameSpace DX
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@
|
||||||
#include <LinkerAPI.h>
|
#include <LinkerAPI.h>
|
||||||
namespace DX
|
namespace DX
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @brief Move structure.
|
||||||
|
*/
|
||||||
struct Move {
|
struct Move {
|
||||||
int px;
|
int px;
|
||||||
int py;
|
int py;
|
||||||
|
|
@ -26,13 +28,14 @@ namespace DX
|
||||||
bool triggers[6];
|
bool triggers[6];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AIMove {
|
struct AIMove {
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
Move move;
|
Move move;
|
||||||
bool used;
|
bool used;
|
||||||
};
|
};
|
||||||
|
|
||||||
float clampFloat(float in);
|
float clampFloat(float in);
|
||||||
float clampMove(float in);
|
float clampMove(float in);
|
||||||
void generateNullMove(Move * ret);
|
void generateNullMove(Move * ret);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -15,5 +15,7 @@ namespace DX
|
||||||
const unsigned int &identifier;
|
const unsigned int &identifier;
|
||||||
const unsigned int base_pointer_value;
|
const unsigned int base_pointer_value;
|
||||||
const unsigned int &dataBlock;
|
const unsigned int &dataBlock;
|
||||||
|
|
||||||
|
char& mName;
|
||||||
};
|
};
|
||||||
} // End NameSpace DX
|
} // End NameSpace DX
|
||||||
39
CommonAPI/Common/include/ModLoader/ModLoader.h
Normal file
39
CommonAPI/Common/include/ModLoader/ModLoader.h
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* @brief ModLoader main include file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ModLoader
|
||||||
|
{
|
||||||
|
//! A pointer type for a server process function.
|
||||||
|
typedef void (*ServerProcessPointer)(unsigned int);
|
||||||
|
|
||||||
|
typedef void (*InitializeModPointer)();
|
||||||
|
|
||||||
|
typedef void (*DeinitializeModPointer)();
|
||||||
|
|
||||||
|
typedef const char* (*GetManagementNamePointer)();
|
||||||
|
|
||||||
|
//! A pointer type for reading the supported mod loader version for this mod.
|
||||||
|
typedef unsigned int (*GetModLoaderVersionPointer)();
|
||||||
|
|
||||||
|
class ModLoaderCallables
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! Hook function that is called when the mod is loaded.
|
||||||
|
InitializeModPointer mInitializeModPointer;
|
||||||
|
|
||||||
|
//! Hook function that is called when the mod is unloaded.
|
||||||
|
DeinitializeModPointer mDeinitializeModPointer;
|
||||||
|
|
||||||
|
//! Hook function for the server update loop.
|
||||||
|
ServerProcessPointer mServerProcessPointer;
|
||||||
|
|
||||||
|
//! Function called to get the name of the script object to use for registering mod management functions.
|
||||||
|
GetManagementNamePointer mGetManagementName;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the hook information from the loaded mod.
|
||||||
|
*/
|
||||||
|
typedef ModLoaderCallables* (*GetModCallablesPointer)();
|
||||||
|
}
|
||||||
13
CommonAPI/Common/source/DXAPI/AIConnection.cpp
Normal file
13
CommonAPI/Common/source/DXAPI/AIConnection.cpp
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <DXAPI/AIConnection.h>
|
||||||
|
|
||||||
|
namespace DX
|
||||||
|
{
|
||||||
|
AIConnection::AIConnection(unsigned int obj) : mUseCustomMoves(false), GameConnection(obj)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void AIConnection::generateMove(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
} // End NameSpace DX
|
||||||
|
|
@ -33,6 +33,7 @@ namespace DX
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size){
|
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size){
|
||||||
DWORD oldprotect=0;
|
DWORD oldprotect=0;
|
||||||
DWORD oldnewprotect=0;
|
DWORD oldnewprotect=0;
|
||||||
|
|
@ -41,6 +42,7 @@ namespace DX
|
||||||
VirtualProtect((void *)addr,size,oldprotect,&oldnewprotect);
|
VirtualProtect((void *)addr,size,oldprotect,&oldnewprotect);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
float memToFloat(unsigned int addr){
|
float memToFloat(unsigned int addr){
|
||||||
DWORD oldprotect=0;
|
DWORD oldprotect=0;
|
||||||
DWORD oldnewprotect=0;
|
DWORD oldnewprotect=0;
|
||||||
|
|
@ -51,6 +53,7 @@ namespace DX
|
||||||
VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect);
|
VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int memToUInt(unsigned int addr){
|
unsigned int memToUInt(unsigned int addr){
|
||||||
DWORD oldprotect=0;
|
DWORD oldprotect=0;
|
||||||
DWORD oldnewprotect=0;
|
DWORD oldnewprotect=0;
|
||||||
|
|
@ -61,6 +64,7 @@ namespace DX
|
||||||
VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect);
|
VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool memToHex(unsigned int addr, char * dst, int size, bool spaces=false){
|
bool memToHex(unsigned int addr, char * dst, int size, bool spaces=false){
|
||||||
DWORD oldprotect=0;
|
DWORD oldprotect=0;
|
||||||
DWORD oldnewprotect=0;
|
DWORD oldnewprotect=0;
|
||||||
|
|
@ -80,6 +84,7 @@ namespace DX
|
||||||
strncpy(dst,outstr,255);
|
strncpy(dst,outstr,255);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GetModPaths(void)
|
const char *GetModPaths(void)
|
||||||
{
|
{
|
||||||
int pointer = *(int*)0x9E8690;
|
int pointer = *(int*)0x9E8690;
|
||||||
|
|
@ -183,4 +188,9 @@ namespace DX
|
||||||
|
|
||||||
return was_dirty;
|
return was_dirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initializeHooks(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,19 +13,19 @@ namespace DX
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
mov ecx, my_ptr;
|
mov ecx, my_ptr;
|
||||||
add ecx, 3404928;
|
add ecx, 0x33f480;
|
||||||
|
|
||||||
test ecx, ecx;
|
test ecx, ecx;
|
||||||
mov edx, ecx;
|
mov edx, ecx;
|
||||||
jz loc_5FDA60_sim;
|
jz loc_5FDA60_sim;
|
||||||
add edx, 4294967136;
|
add edx, 4294967136;
|
||||||
|
|
||||||
loc_5FDA60_sim:
|
loc_5FDA60_sim:
|
||||||
mov eax, [edx + 33372];
|
mov eax, [edx + 0x825c];
|
||||||
test eax, eax;
|
test eax, eax;
|
||||||
jnz got_valid_ptr;
|
jnz got_valid_ptr;
|
||||||
|
|
||||||
got_valid_ptr:
|
got_valid_ptr:
|
||||||
mov result_ptr, eax;
|
mov result_ptr, eax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
namespace DX
|
namespace DX
|
||||||
{
|
{
|
||||||
SimObject::SimObject(unsigned int obj) : identifier(*(unsigned int*)(obj + 32)), fieldDictionary(*(unsigned int*)(obj + 0x2C)), dataBlock(*(unsigned int*)(obj + 0x248)),
|
SimObject::SimObject(unsigned int obj) : identifier(*(unsigned int*)(obj + 32)), fieldDictionary(*(unsigned int*)(obj + 0x2C)), dataBlock(*(unsigned int*)(obj + 0x248)),
|
||||||
base_pointer_value(obj)
|
base_pointer_value(obj), mName(*(char*)(obj + 4))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,6 +45,7 @@ namespace DX
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *SimObject::getFieldValue(const char *slotname)
|
const char *SimObject::getFieldValue(const char *slotname)
|
||||||
{
|
{
|
||||||
void * getfieldvalueptr=(void *)0x435210;
|
void * getfieldvalueptr=(void *)0x435210;
|
||||||
|
|
|
||||||
118
Everything.sln
118
Everything.sln
|
|
@ -1,56 +1,62 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
# Visual C++ Express 2010
|
# Visual C++ Express 2010
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "CommonAPI\Common\Common.vcxproj", "{9B3A3214-400B-4245-85FD-EA12D5F791D4}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "CommonAPI\Common\Common.vcxproj", "{9B3A3214-400B-4245-85FD-EA12D5F791D4}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modloader", "ModLoader\Modloader\Modloader.vcxproj", "{10159605-BFF5-496F-8C23-0A1FB9850E55}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modloader", "ModLoader\Modloader\Modloader.vcxproj", "{10159605-BFF5-496F-8C23-0A1FB9850E55}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RandomMod", "Mod Sources\RandomMod\RandomMod\RandomMod.vcxproj", "{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RandomMod", "Mod Sources\RandomMod\RandomMod\RandomMod.vcxproj", "{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TSExtension", "Mod Sources\TSExtension\TSExtension\TSExtension.vcxproj", "{08220905-AEC1-49C9-84E6-78672F9EF5F1}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TSExtension", "Mod Sources\TSExtension\TSExtension\TSExtension.vcxproj", "{08220905-AEC1-49C9-84E6-78672F9EF5F1}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WatchDog", "Mod Sources\Watchdog\Watchdog\Watchdog.vcxproj", "{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WatchDog", "Mod Sources\Watchdog\Watchdog\Watchdog.vcxproj", "{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PythonMod", "Mod Sources\PythonMod\PythonMod\PythonMod.vcxproj", "{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}"
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
EndProject
|
||||||
Debug|Win32 = Debug|Win32
|
Global
|
||||||
Release|Win32 = Release|Win32
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
EndGlobalSection
|
Debug|Win32 = Debug|Win32
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
Release|Win32 = Release|Win32
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.ActiveCfg = Debug|Win32
|
EndGlobalSection
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.Build.0 = Debug|Win32
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.ActiveCfg = Release|Win32
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.Build.0 = Release|Win32
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.ActiveCfg = Debug|Win32
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.Build.0 = Debug|Win32
|
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.Build.0 = Release|Win32
|
||||||
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.ActiveCfg = Release|Win32
|
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.Build.0 = Release|Win32
|
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.ActiveCfg = Debug|Win32
|
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.Build.0 = Debug|Win32
|
{10159605-BFF5-496F-8C23-0A1FB9850E55}.Release|Win32.Build.0 = Release|Win32
|
||||||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.ActiveCfg = Release|Win32
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.Build.0 = Release|Win32
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.ActiveCfg = Debug|Win32
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.Build.0 = Debug|Win32
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.Build.0 = Release|Win32
|
||||||
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.ActiveCfg = Release|Win32
|
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.Build.0 = Release|Win32
|
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.ActiveCfg = Debug|Win32
|
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.Build.0 = Debug|Win32
|
{08220905-AEC1-49C9-84E6-78672F9EF5F1}.Release|Win32.Build.0 = Release|Win32
|
||||||
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.ActiveCfg = Release|Win32
|
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.Build.0 = Release|Win32
|
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
EndGlobalSection
|
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
{1C8B5AA4-B172-45DD-9D27-55F41B6F1755}.Release|Win32.Build.0 = Release|Win32
|
||||||
HideSolutionNode = FALSE
|
{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
EndGlobalSection
|
{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
EndGlobal
|
{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
|
||||||
BIN
Everything.suo
BIN
Everything.suo
Binary file not shown.
Binary file not shown.
|
|
@ -14,6 +14,7 @@
|
||||||
<ProjectGuid>{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}</ProjectGuid>
|
<ProjectGuid>{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>BaseMod</RootNamespace>
|
<RootNamespace>BaseMod</RootNamespace>
|
||||||
|
<ProjectName>BaseMod</ProjectName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
|
|
||||||
Binary file not shown.
20
Mod Sources/PythonMod/PythonMod.sln
Normal file
20
Mod Sources/PythonMod/PythonMod.sln
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual C++ Express 2010
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PythonMod", "PythonMod\PythonMod.vcxproj", "{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Win32 = Debug|Win32
|
||||||
|
Release|Win32 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
Binary file not shown.
BIN
Mod Sources/PythonMod/PythonMod/Debug/PythonMod_manifest.rc
Normal file
BIN
Mod Sources/PythonMod/PythonMod/Debug/PythonMod_manifest.rc
Normal file
Binary file not shown.
88
Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj
Normal file
88
Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{2BF01D65-C8F6-4565-AB0A-9F73B2E3D6E3}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>BaseMod</RootNamespace>
|
||||||
|
<ProjectName>PythonMod</ProjectName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<IncludePath>include;$(IncludePath)</IncludePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>C:\Python27\include</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>C:\Python27\libs\python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>C:\Python27\include</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalDependencies>C:\Python27\libs\python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="source\BaseMod.cpp" />
|
||||||
|
<ClCompile Include="source\dllmain.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
3
Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj.user
Normal file
3
Mod Sources/PythonMod/PythonMod/PythonMod.vcxproj.user
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
||||||
7
Mod Sources/PythonMod/PythonMod/source/BaseMod.cpp
Normal file
7
Mod Sources/PythonMod/PythonMod/source/BaseMod.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
// BaseMod.cpp : Defines the exported functions for the DLL application.
|
||||||
|
//
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
282
Mod Sources/PythonMod/PythonMod/source/dllmain.cpp
Normal file
282
Mod Sources/PythonMod/PythonMod/source/dllmain.cpp
Normal file
|
|
@ -0,0 +1,282 @@
|
||||||
|
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||||
|
|
||||||
|
#include <SDKDDKVer.h>
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <DXAPI/DXAPI.h>
|
||||||
|
#include <LinkerAPI.h>
|
||||||
|
|
||||||
|
#include <Python.h>
|
||||||
|
|
||||||
|
|
||||||
|
static int aienabled=0;
|
||||||
|
unsigned int oldaiaddr=0x0;
|
||||||
|
static unsigned int tmpobjptr=0;
|
||||||
|
static DX::Move curmove;
|
||||||
|
|
||||||
|
|
||||||
|
static char test[100];
|
||||||
|
static DX::Move *mechchangedmove;
|
||||||
|
static char test2[100];
|
||||||
|
static void * moveptrmech;
|
||||||
|
unsigned int updatemoveretptr=0x5d2d7c;
|
||||||
|
float maxrot=2.9f;
|
||||||
|
float minrot=-2.9f;
|
||||||
|
static unsigned int playerptr=0x0;
|
||||||
|
static float newTurn = 0.1f;
|
||||||
|
static float turnStrength = 1.0f;
|
||||||
|
|
||||||
|
float MECH_TURNING_SPEED=0.4f;
|
||||||
|
static unsigned int playerptr2;
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
static DX::AIMove aimoves[1024];
|
||||||
|
}
|
||||||
|
|
||||||
|
__declspec(naked) void updateMoveHook()
|
||||||
|
{
|
||||||
|
// this gets run from 0x5D2D6E
|
||||||
|
|
||||||
|
__asm {
|
||||||
|
mov playerptr,ebx
|
||||||
|
mov eax,[ebp+0x8]
|
||||||
|
mov moveptrmech,eax
|
||||||
|
pusha
|
||||||
|
};
|
||||||
|
|
||||||
|
MECH_TURNING_SPEED=0.4f;
|
||||||
|
|
||||||
|
if (playerptr!=0) {
|
||||||
|
playervar=&DX::Player(playerptr);
|
||||||
|
mechchangedmove=(DX::Move*) moveptrmech;
|
||||||
|
//_snprintf (command,255,"return(%d.getDataBlock());",playervar->identifier);
|
||||||
|
//strncpy(buf,Con::evaluate(command,false,NULL,true),255);
|
||||||
|
if (playervar->dataBlock!=NULL) {
|
||||||
|
|
||||||
|
playerdatavar = &DX::SimObject(playervar->dataBlock);
|
||||||
|
//Con::printf("Datablock is %s\n",buf);
|
||||||
|
if (playerdatavar->base_pointer_value!=0)
|
||||||
|
{
|
||||||
|
strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechControlEnabled",false)));
|
||||||
|
Con::printf("mechControlEnabled: %s",buf);
|
||||||
|
|
||||||
|
if ((mechchangedmove)->freelook && ((mechchangedmove)->y>0.0) && dAtob(buf))
|
||||||
|
{
|
||||||
|
//sprintf (command,"return (%d.getDataBlock().mechTurnSpeed);",playervar->identifier);
|
||||||
|
strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechTurnSpeed",false)));
|
||||||
|
Con::printf("mechTurnSpeed: %s",buf);
|
||||||
|
MECH_TURNING_SPEED=atof(buf);
|
||||||
|
|
||||||
|
// FIXME: The 3 here should reference the datablock's maximum turning angle -- we're essentially normalizing our rotation here.
|
||||||
|
float turnStrength = playervar->headRotationZ / 3;
|
||||||
|
// Use whatever is leftover in our forward movement
|
||||||
|
float forwardStrength = 1 - fabs(turnStrength);
|
||||||
|
// Calculate a new turn value that we use for both the main body and the head.
|
||||||
|
float newTurn = turnStrength * MECH_TURNING_SPEED;
|
||||||
|
float newHeadTurn = turnStrength * (MECH_TURNING_SPEED/20);
|
||||||
|
|
||||||
|
(mechchangedmove)->y = forwardStrength;
|
||||||
|
(mechchangedmove)->x += turnStrength;
|
||||||
|
|
||||||
|
// FIXME: Is the yaw value definitely in radians?
|
||||||
|
playervar->mRotZ += newTurn + (mechchangedmove)->yaw;
|
||||||
|
|
||||||
|
// Now, we must translate the turning strength into an appropriate subtraction for our
|
||||||
|
// head rotation.
|
||||||
|
playervar->headRotationZ += -newTurn;
|
||||||
|
|
||||||
|
(mechchangedmove)->pitch = 0;
|
||||||
|
(mechchangedmove)->yaw = 0;
|
||||||
|
(mechchangedmove)->roll = 0;
|
||||||
|
(mechchangedmove)->freelook = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
popa
|
||||||
|
mov ebx,playerptr
|
||||||
|
mov eax,[ebp+8]
|
||||||
|
mov edx,[eax]
|
||||||
|
mov [ebx+0x894],edx
|
||||||
|
mov eax,[eax+4]
|
||||||
|
jmp [updatemoveretptr]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return the number of arguments of the application command line */
|
||||||
|
static PyObject*
|
||||||
|
ts_tseval(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
char *input;
|
||||||
|
if(!PyArg_ParseTuple(args, "s:tseval",&input))
|
||||||
|
return NULL;
|
||||||
|
std::string inputstr=std::string(input);
|
||||||
|
//Con::printf(inputstr.c_str());
|
||||||
|
return Py_BuildValue("s",Con::evaluate(inputstr.c_str(),false,NULL,false));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyMethodDef TSMethods[] = {
|
||||||
|
{"tseval", ts_tseval, METH_VARARGS,
|
||||||
|
"Evaluates TorqueScript."},
|
||||||
|
{NULL, NULL, 0, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
DX::AIMove * getAIMovePtr(unsigned int id) {
|
||||||
|
int moveindex=0;
|
||||||
|
bool foundindex=false;
|
||||||
|
for (int x=0; x<1024; x++) {
|
||||||
|
if (aimoves[x].id==id && aimoves[x].used==true) {
|
||||||
|
moveindex=x;
|
||||||
|
foundindex=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (aimoves[x].used==false) {
|
||||||
|
moveindex=x;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (foundindex==true) {
|
||||||
|
return &aimoves[moveindex];
|
||||||
|
} else {
|
||||||
|
aimoves[moveindex].id=id;
|
||||||
|
aimoves[moveindex].used=true;
|
||||||
|
DX::generateNullMove(&(aimoves[moveindex].move));
|
||||||
|
return &aimoves[moveindex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned int updatemovehookptr = (unsigned int)updateMoveHook;
|
||||||
|
|
||||||
|
DX::Move tmpmove;
|
||||||
|
|
||||||
|
bool consetMove(Linker::SimObject *obj, S32 argc, const char *argv[]) {
|
||||||
|
// setMove(%aicon, x, y, z, yaw, pitch, roll);
|
||||||
|
unsigned int aiconid = atoi(argv[1]);
|
||||||
|
DX::AIMove * aimove = getAIMovePtr(aiconid);
|
||||||
|
aimove->move.x=DX::clampFloat(std::stof(argv[2]));
|
||||||
|
aimove->move.y=DX::clampFloat(std::stof(argv[3]));
|
||||||
|
aimove->move.z=DX::clampFloat(std::stof(argv[4]));
|
||||||
|
aimove->move.yaw=DX::clampMove(std::stof(argv[5]));
|
||||||
|
aimove->move.pitch=DX::clampMove(std::stof(argv[6]));
|
||||||
|
aimove->move.roll=DX::clampMove(std::stof(argv[7]));
|
||||||
|
//Con::printf ("Set move variables for %d to x:%f y:%f z:%f yaw:%f pitch:%f roll:%f\n",aimove->id,aimove->move.x,aimove->move.y,aimove->move.z,aimove->move.yaw,aimove->move.pitch,aimove->move.roll);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
newAIMoveListGeneratorPtr gen;
|
||||||
|
|
||||||
|
|
||||||
|
typedef void (__thiscall *newAIMoveListGeneratorPtr)(void*, DX::Move** moves, unsigned int * moveCount);
|
||||||
|
|
||||||
|
bool consetTrigger(Linker::SimObject *obj, S32 argc, const char *argv[]) {
|
||||||
|
unsigned int aiconid = atoi(argv[1]);
|
||||||
|
unsigned int index = atoi(argv[2]);
|
||||||
|
if (index < 6) {
|
||||||
|
DX::AIMove * aimove = getAIMovePtr(aiconid);
|
||||||
|
bool value = dAtob(argv[3]);
|
||||||
|
aimove->move.triggers[index]=value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool conDisableNewAI(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||||
|
{
|
||||||
|
if (aienabled==1) {
|
||||||
|
Py_Finalize();
|
||||||
|
(*((unsigned int *)0x75e360))=(unsigned int)oldaiaddr;
|
||||||
|
aienabled=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
bool conEnableNewAI(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||||
|
{
|
||||||
|
if (aienabled==0) {
|
||||||
|
Py_Initialize();
|
||||||
|
Py_InitModule("ts", TSMethods);
|
||||||
|
oldaiaddr=(*((unsigned int *)0x75e360));
|
||||||
|
gen=(newAIMoveListGeneratorPtr)newAIMoveListGenerator;
|
||||||
|
(*((unsigned int *)0x75e360))=(unsigned int)(gen);
|
||||||
|
aienabled=1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
__declspec(dllexport) void __fastcall newAIMoveListGenerator(void* This, void* notUsed, DX::Move** moves, unsigned int* moveCount) {
|
||||||
|
tmpobjptr=(unsigned int)This;
|
||||||
|
|
||||||
|
unsigned int * origobjptr;
|
||||||
|
origobjptr=(unsigned int *) tmpobjptr;
|
||||||
|
DX::AIMove * aimove;
|
||||||
|
DX::GameConnection * aiconn;
|
||||||
|
|
||||||
|
//Con::printf ("Possible offsets for ID starting at 0x4\n");
|
||||||
|
if (origobjptr !=0 )
|
||||||
|
{
|
||||||
|
//unsigned int * idptr;
|
||||||
|
//unsigned int offset=0x4;
|
||||||
|
//for (offset=0x4; offset<0x100; offset+=0x4) {
|
||||||
|
|
||||||
|
//idptr=(unsigned int *)((* (origobjptr))+offset);
|
||||||
|
//Con::printf ("Offset: %08X Addr: %08X Data: %d",offset, idptr, *idptr);
|
||||||
|
|
||||||
|
//}
|
||||||
|
aiconn = &DX::GameConnection((unsigned int)origobjptr+0xA0);
|
||||||
|
aimove = getAIMovePtr(aiconn->identifier);
|
||||||
|
unsigned int ident=aiconn->identifier;
|
||||||
|
printf("%d\n",ident);
|
||||||
|
char movecallback[120]="";
|
||||||
|
sprintf_s<120>(movecallback,"AIMoveCallback(%d)\n",ident);
|
||||||
|
//FILE *f=fopen("AI.py","rb");
|
||||||
|
PyRun_SimpleString((std::string("import ts\nfrom ai import AIMoveCallback\nimport ai\n")+std::string(movecallback)).c_str());
|
||||||
|
//Con::evaluate(movecallback,false,NULL,NULL);
|
||||||
|
//Con::printf ("BasePointer: %08X", aiconn.base_pointer_value);
|
||||||
|
//Con::printf ("Ecx Value: %08X", origobjptr);
|
||||||
|
//Con::printf("ID: %d\n",aiconn.identifier);
|
||||||
|
//Con::evaluate ("listPlayers();",true,NULL,NULL);
|
||||||
|
|
||||||
|
//Con::printf("orig: %08X obj: %08X\n",origobjptr,0xBADABEEB);
|
||||||
|
//Con::printf("Move processed for %08X\n",(aicon.identifier));
|
||||||
|
}
|
||||||
|
//memcpy (&tmpmove,&(aimove->move),sizeof(DX::Move));
|
||||||
|
//DX::generateNullMove(&(aimove->move));
|
||||||
|
*moves = &(aimove->move);
|
||||||
|
*moveCount=1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
__declspec(dllexport) void ModInitialize(void)
|
||||||
|
{
|
||||||
|
Con::addMethodB(NULL,"enableNewAI",&conEnableNewAI,"Enables the new Move Generation code for the AI", 1,4);
|
||||||
|
Con::addMethodB(NULL,"disableNewAI",&conDisableNewAI,"Disables the new Move Generation code for the AI", 1,4);
|
||||||
|
}
|
||||||
|
|
||||||
|
__declspec(dllexport) void ServerProcess(unsigned int deltaTime)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||||
|
DWORD ul_reason_for_call,
|
||||||
|
LPVOID lpReserved
|
||||||
|
)
|
||||||
|
{
|
||||||
|
switch (ul_reason_for_call)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
case DLL_THREAD_ATTACH:
|
||||||
|
case DLL_THREAD_DETACH:
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -2,12 +2,17 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "BaseMod.h"
|
#include "BaseMod.h"
|
||||||
|
#include <ModLoader\ModLoader.h>
|
||||||
#include "LinkerAPI.h"
|
#include "LinkerAPI.h"
|
||||||
#include "randomCmds.h"
|
#include "randomCmds.h"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
BASEMOD_API unsigned int getModLoaderVersion(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
BASEMOD_API void ModInitialize(void)
|
BASEMOD_API void ModInitialize(void)
|
||||||
{
|
{
|
||||||
Con::addMethodS(NULL,"getRandom",&conMRandom,"Random number generation based upon the Mersenne Twister algorithm.",1,3);
|
Con::addMethodS(NULL,"getRandom",&conMRandom,"Random number generation based upon the Mersenne Twister algorithm.",1,3);
|
||||||
|
|
@ -18,4 +23,19 @@ extern "C"
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BASEMOD_API const char* getManagementName(void)
|
||||||
|
{
|
||||||
|
return "RandomMod";
|
||||||
|
}
|
||||||
|
|
||||||
|
BASEMOD_API ModLoader::ModLoaderCallables* getModCallables(void)
|
||||||
|
{
|
||||||
|
ModLoader::ModLoaderCallables* result = new ModLoader::ModLoaderCallables();
|
||||||
|
result->mInitializeModPointer = ModInitialize;
|
||||||
|
result->mGetManagementName = getManagementName;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -1,93 +1,95 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="source\dllmain.cpp" />
|
<ClCompile Include="source\dllmain.cpp" />
|
||||||
<ClCompile Include="source\DXBinaryObjects.cpp" />
|
<ClCompile Include="source\DXBinaryObjects.cpp" />
|
||||||
<ClCompile Include="source\DXConCmds.cpp" />
|
<ClCompile Include="source\DXConCmds.cpp" />
|
||||||
<ClCompile Include="source\DXTCPObjects.cpp" />
|
<ClCompile Include="source\DXTCPObjects.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="include\DXConCmds.h" />
|
<ClInclude Include="include\DXConCmds.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{08220905-AEC1-49C9-84E6-78672F9EF5F1}</ProjectGuid>
|
<ProjectGuid>{08220905-AEC1-49C9-84E6-78672F9EF5F1}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>BaseMod</RootNamespace>
|
<RootNamespace>BaseMod</RootNamespace>
|
||||||
<ProjectName>TSExtension</ProjectName>
|
<ProjectName>TSExtension</ProjectName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
||||||
<OutDir>$(SolutionDir)\Mods</OutDir>
|
<OutDir>$(SolutionDir)\Mods</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
||||||
<OutDir>$(SolutionDir)\Mods</OutDir>
|
<OutDir>$(SolutionDir)\Mods</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
<AdditionalIncludeDirectories>C:\Python27\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<Link>
|
</ClCompile>
|
||||||
<SubSystem>Windows</SubSystem>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<SubSystem>Windows</SubSystem>
|
||||||
<AdditionalDependencies>ws2_32.lib;Dnsapi.lib;$(SolutionDir)\Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
<AdditionalDependencies>ws2_32.lib;Dnsapi.lib;C:\Python27\libs\python27.lib;$(SolutionDir)\Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</ItemDefinitionGroup>
|
</Link>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
</ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<ClCompile>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
</ClCompile>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BASEMOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<Link>
|
<AdditionalIncludeDirectories>C:\Python27\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<SubSystem>Windows</SubSystem>
|
</ClCompile>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<Link>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<SubSystem>Windows</SubSystem>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>ws2_32.lib;Dnsapi.lib;$(SolutionDir)\Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
</Link>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
</ItemDefinitionGroup>
|
<AdditionalDependencies>ws2_32.lib;Dnsapi.lib;$(SolutionDir)\Common.lib;C:\Python27\libs\python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
</Link>
|
||||||
<ImportGroup Label="ExtensionTargets">
|
</ItemDefinitionGroup>
|
||||||
</ImportGroup>
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,505 +1,332 @@
|
||||||
// dllmain.cpp : Defines the entry point for the DLL application.
|
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||||
#include <SDKDDKVer.h>
|
#include <SDKDDKVer.h>
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
//#define TORNADO_ENABLE
|
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
//#define TORNADO_ENABLE
|
||||||
DWORD ul_reason_for_call,
|
//#define MECH_MOVE_CODE
|
||||||
LPVOID lpReserved
|
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||||
)
|
DWORD ul_reason_for_call,
|
||||||
{
|
LPVOID lpReserved
|
||||||
switch (ul_reason_for_call)
|
)
|
||||||
{
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
switch (ul_reason_for_call)
|
||||||
case DLL_THREAD_ATTACH:
|
{
|
||||||
case DLL_THREAD_DETACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_THREAD_ATTACH:
|
||||||
break;
|
case DLL_THREAD_DETACH:
|
||||||
}
|
case DLL_PROCESS_DETACH:
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
#include <DXAPI/DXAPI.h>
|
}
|
||||||
#include <LinkerAPI.h>
|
|
||||||
#include <DXAPI/Move.h>
|
#include <DXAPI/DXAPI.h>
|
||||||
#include <DXConCmds.h>
|
#include <LinkerAPI.h>
|
||||||
|
#include <DXAPI/Move.h>
|
||||||
static DX::Move curmove;
|
#include <DXConCmds.h>
|
||||||
static unsigned int tmpobjptr=0;
|
|
||||||
static char test[100];
|
|
||||||
static DX::Move *mechchangedmove;
|
|
||||||
static char test2[100];
|
|
||||||
static void * moveptrmech;
|
|
||||||
unsigned int updatemoveretptr=0x5d2d7c;
|
extern "C"
|
||||||
float maxrot=2.9f;
|
{
|
||||||
float minrot=-2.9f;
|
static DX::AIMove aimoves[1024];
|
||||||
static unsigned int playerptr=0x0;
|
static char command[256]="";
|
||||||
static float newTurn = 0.1f;
|
static const char * dataBlock;
|
||||||
static float turnStrength = 1.0f;
|
static char buf[256]="";
|
||||||
|
//#define MECH_TURNING_SPEED 0.4
|
||||||
extern "C"
|
|
||||||
{
|
// Maximum radians per 32ms tick
|
||||||
static DX::AIMove aimoves[1024];
|
void *readIntptr=(void *)0x43BF10;
|
||||||
static char command[256]="";
|
void *writeIntptr=(void *)0x43BF60;
|
||||||
static const char * dataBlock;
|
void *writeStringptr=(void *)0x43C6D0;
|
||||||
static char buf[256]="";
|
void *readStringptr=(void *)0x43C630;
|
||||||
//#define MECH_TURNING_SPEED 0.4
|
|
||||||
|
|
||||||
// Maximum radians per 32ms tick
|
|
||||||
void *readIntptr=(void *)0x43BF10;
|
|
||||||
void *writeIntptr=(void *)0x43BF60;
|
int streamReadInt(void * stream,int bitcount)
|
||||||
void *writeStringptr=(void *)0x43C6D0;
|
{
|
||||||
void *readStringptr=(void *)0x43C630;
|
int retvalue=0x0;
|
||||||
|
__asm {
|
||||||
int streamReadInt(void * stream,int bitcount)
|
mov ecx,stream
|
||||||
{
|
push bitcount
|
||||||
int retvalue=0x0;
|
call readIntptr
|
||||||
__asm {
|
mov retvalue,eax
|
||||||
mov ecx,stream
|
}
|
||||||
push bitcount
|
return retvalue;
|
||||||
call readIntptr
|
}
|
||||||
mov retvalue,eax
|
|
||||||
}
|
void streamWriteInt(void * stream,int value,int bitcount) {
|
||||||
return retvalue;
|
__asm {
|
||||||
}
|
mov ecx,stream
|
||||||
|
push bitcount
|
||||||
void streamWriteInt(void * stream,int value,int bitcount) {
|
push value
|
||||||
__asm {
|
call writeIntptr
|
||||||
mov ecx,stream
|
}
|
||||||
push bitcount
|
return;
|
||||||
push value
|
}
|
||||||
call writeIntptr
|
|
||||||
}
|
void streamWriteString(void * stream,const char * stringvar,int maxlen) {
|
||||||
return;
|
__asm {
|
||||||
}
|
mov ecx,stream
|
||||||
|
push maxlen
|
||||||
void streamWriteString(void * stream,const char * stringvar,int maxlen) {
|
push stringvar
|
||||||
__asm {
|
call writeStringptr
|
||||||
mov ecx,stream
|
}
|
||||||
push maxlen
|
return;
|
||||||
push stringvar
|
}
|
||||||
call writeStringptr
|
|
||||||
}
|
void streamReadString(void * stream,char *stringvar) {
|
||||||
return;
|
__asm {
|
||||||
}
|
mov ecx,stream
|
||||||
|
push stringvar
|
||||||
void streamReadString(void * stream,char *stringvar) {
|
call readStringptr
|
||||||
__asm {
|
}
|
||||||
mov ecx,stream
|
return;
|
||||||
push stringvar
|
}
|
||||||
call readStringptr
|
|
||||||
}
|
static char fieldnames[127][256];
|
||||||
return;
|
static char fieldvalues[127][256];
|
||||||
}
|
static DX::Player *playervar;
|
||||||
|
static DX::SimObject *playerdatavar;
|
||||||
static char fieldnames[127][256];
|
unsigned int gamebaseretptr=0x5E2A13;
|
||||||
static char fieldvalues[127][256];
|
unsigned int gboaparentptr=0x58c1e0;
|
||||||
static DX::Player *playervar;
|
static DX::GameBase *gb;
|
||||||
static DX::SimObject *playerdatavar;
|
static DX::SimObject * gbdb;
|
||||||
unsigned int gamebaseretptr=0x5E2A13;
|
static const char * gbfieldvalue;
|
||||||
unsigned int gboaparentptr=0x58c1e0;
|
void __declspec (naked) GameBaseOnAddHook() {
|
||||||
static DX::GameBase *gb;
|
void * gamebaseptr;
|
||||||
static DX::SimObject * gbdb;
|
__asm {
|
||||||
static const char * gbfieldvalue;
|
push ebp
|
||||||
void __declspec (naked) GameBaseOnAddHook() {
|
mov ebp,esp
|
||||||
void * gamebaseptr;
|
push ebx
|
||||||
__asm {
|
push esi
|
||||||
push ebp
|
mov esi,ecx
|
||||||
mov ebp,esp
|
mov gamebaseptr,esi
|
||||||
push ebx
|
call [gboaparentptr]
|
||||||
push esi
|
test al,al
|
||||||
mov esi,ecx
|
jz gboaparentfailed
|
||||||
mov gamebaseptr,esi
|
mov edx,[esi+0x248]
|
||||||
call [gboaparentptr]
|
test edx,edx
|
||||||
test al,al
|
jnz gboaworked
|
||||||
jz gboaparentfailed
|
gboaparentfailed:
|
||||||
mov edx,[esi+0x248]
|
lea esp,[ebp-0x8]
|
||||||
test edx,edx
|
xor al,al
|
||||||
jnz gboaworked
|
pop esi
|
||||||
gboaparentfailed:
|
pop ebx
|
||||||
lea esp,[ebp-0x8]
|
pop ebp
|
||||||
xor al,al
|
retn
|
||||||
pop esi
|
gboaworked:
|
||||||
pop ebx
|
pushad
|
||||||
pop ebp
|
};
|
||||||
retn
|
gb = &DX::GameBase((unsigned int)gamebaseptr);
|
||||||
gboaworked:
|
gbdb = &DX::SimObject(gb->dataBlock);
|
||||||
pushad
|
gbfieldvalue=gbdb->getFieldValue(DX::StringTableInsert("subClass",false));
|
||||||
};
|
if (gbfieldvalue!=NULL) {
|
||||||
gb = &DX::GameBase((unsigned int)gamebaseptr);
|
#ifdef TORNADO_ENABLE
|
||||||
gbdb = &DX::SimObject(gb->dataBlock);
|
if (stricmp(gbfieldvalue,"tornado")==0) {
|
||||||
gbfieldvalue=gbdb->getFieldValue(DX::StringTableInsert("subClass",false));
|
|
||||||
if (gbfieldvalue!=NULL) {
|
}
|
||||||
#ifdef TORNADO_ENABLE
|
#endif
|
||||||
if (stricmp(gbfieldvalue,"tornado")==0) {
|
}
|
||||||
|
__asm {
|
||||||
}
|
popad
|
||||||
#endif
|
jmp [gamebaseretptr]
|
||||||
}
|
}
|
||||||
__asm {
|
|
||||||
popad
|
}
|
||||||
jmp [gamebaseretptr]
|
void DBpackData(void *stream) {
|
||||||
}
|
void* thisptr;
|
||||||
|
__asm {
|
||||||
}
|
mov thisptr,ecx
|
||||||
void DBpackData(void *stream) {
|
};
|
||||||
void* thisptr;
|
DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr);
|
||||||
__asm {
|
char readcommand[256]="";
|
||||||
mov thisptr,ecx
|
sprintf_s<256>(readcommand,"return getWordCount(%d.extraNetFields);", dbobj.identifier);
|
||||||
};
|
|
||||||
DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr);
|
char str[256]="";
|
||||||
char readcommand[256]="";
|
strncpy_s<256>(str,Con::evaluate(readcommand,false,NULL,true), 256);
|
||||||
sprintf_s<256>(readcommand,"return getWordCount(%d.extraNetFields);", dbobj.identifier);
|
|
||||||
|
Con::printf ("GWC returned %s\n",str);
|
||||||
char str[256]="";
|
int realcount=atoi(str);
|
||||||
strncpy_s<256>(str,Con::evaluate(readcommand,false,NULL,true), 256);
|
int i=0;
|
||||||
|
int counter=0;
|
||||||
Con::printf ("GWC returned %s\n",str);
|
for (i; (i<126 && i<realcount); i++) {
|
||||||
int realcount=atoi(str);
|
sprintf_s<256>(readcommand,"return getWord(%d.extraNetFields,%d);",dbobj.identifier,i);
|
||||||
int i=0;
|
strncpy_s<256>(fieldnames[i],Con::evaluate(readcommand,false,NULL,true), 256);
|
||||||
int counter=0;
|
|
||||||
for (i; (i<126 && i<realcount); i++) {
|
Con::printf (fieldnames[i]);
|
||||||
sprintf_s<256>(readcommand,"return getWord(%d.extraNetFields,%d);",dbobj.identifier,i);
|
_snprintf_s<256>(readcommand,256,"return(%d.%s);",dbobj.identifier,fieldnames[i]);
|
||||||
strncpy_s<256>(fieldnames[i],Con::evaluate(readcommand,false,NULL,true), 256);
|
strncpy_s<256>(fieldvalues[i],Con::evaluate(readcommand,false,NULL,true), 256);
|
||||||
|
strcpy_s<256>(buf,dbobj.getFieldValue(DX::StringTableInsert(fieldnames[i],false)));
|
||||||
Con::printf (fieldnames[i]);
|
Con::printf ("fieldvalues[i]:%s GDF: %s\n",fieldvalues[i],buf);
|
||||||
_snprintf_s<256>(readcommand,256,"return(%d.%s);",dbobj.identifier,fieldnames[i]);
|
|
||||||
strncpy_s<256>(fieldvalues[i],Con::evaluate(readcommand,false,NULL,true), 256);
|
}
|
||||||
strcpy_s<256>(buf,dbobj.getFieldValue(DX::StringTableInsert(fieldnames[i],false)));
|
counter=i;
|
||||||
Con::printf ("fieldvalues[i]:%s GDF: %s\n",fieldvalues[i],buf);
|
Con::printf("Sending %d extra fields",counter);
|
||||||
|
streamWriteInt(stream,counter,7);
|
||||||
}
|
for (int x=0; x < counter; x++ ) {
|
||||||
counter=i;
|
streamWriteString(stream,fieldnames[x],254);
|
||||||
Con::printf("Sending %d extra fields",counter);
|
streamWriteString(stream,fieldvalues[x],254);
|
||||||
streamWriteInt(stream,counter,7);
|
}
|
||||||
for (int x=0; x < counter; x++ ) {
|
|
||||||
streamWriteString(stream,fieldnames[x],254);
|
}
|
||||||
streamWriteString(stream,fieldvalues[x],254);
|
void DBunpackData(void *stream) {
|
||||||
}
|
void* thisptr;
|
||||||
|
__asm {
|
||||||
}
|
mov thisptr,ecx
|
||||||
void DBunpackData(void *stream) {
|
};
|
||||||
void* thisptr;
|
|
||||||
__asm {
|
char setcommand[256]="";
|
||||||
mov thisptr,ecx
|
DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr);
|
||||||
};
|
int counter=streamReadInt(stream,7);
|
||||||
|
char buf[256]="";
|
||||||
char setcommand[256]="";
|
Con::printf ("Receiving %d extra fields",counter);
|
||||||
DX::SimObject dbobj = DX::SimObject((unsigned int)thisptr);
|
for (int i=0; i < counter; i++) {
|
||||||
int counter=streamReadInt(stream,7);
|
streamReadString(stream,buf);
|
||||||
char buf[256]="";
|
strcpy_s<256>(fieldnames[i],buf);
|
||||||
Con::printf ("Receiving %d extra fields",counter);
|
streamReadString(stream,buf);
|
||||||
for (int i=0; i < counter; i++) {
|
strcpy_s<256>(fieldvalues[i],buf);
|
||||||
streamReadString(stream,buf);
|
}
|
||||||
strcpy_s<256>(fieldnames[i],buf);
|
for (int i=0; i < counter; i++ ){
|
||||||
streamReadString(stream,buf);
|
Con::printf (fieldnames[i]);
|
||||||
strcpy_s<256>(fieldvalues[i],buf);
|
Con::printf (fieldvalues[i]);
|
||||||
}
|
dbobj.setDataField(DX::StringTableInsert(fieldnames[i],false),NULL,fieldvalues[i]);
|
||||||
for (int i=0; i < counter; i++ ){
|
//_snprintf (setcommand,255,"%d.%s=\"%s\";",dbobj.identifier,fieldnames[i],fieldvalues[i]);
|
||||||
Con::printf (fieldnames[i]);
|
//Con::evaluate(setcommand,false,NULL,true);
|
||||||
Con::printf (fieldvalues[i]);
|
}
|
||||||
dbobj.setDataField(DX::StringTableInsert(fieldnames[i],false),NULL,fieldvalues[i]);
|
}
|
||||||
//_snprintf (setcommand,255,"%d.%s=\"%s\";",dbobj.identifier,fieldnames[i],fieldvalues[i]);
|
|
||||||
//Con::evaluate(setcommand,false,NULL,true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
float MECH_TURNING_SPEED=0.4f;
|
|
||||||
static unsigned int playerptr2;
|
static S32 gravid=0;
|
||||||
|
static float movespeed=0.0;
|
||||||
__declspec(naked) void updateMoveHook()
|
__declspec(dllexport) void ServerProcess(unsigned int deltaTime)
|
||||||
{
|
{
|
||||||
// this gets run from 0x5D2D6E
|
//memPatch("602D1E","9090");
|
||||||
|
float pos[3];
|
||||||
__asm {
|
float rot[4];
|
||||||
mov playerptr,ebx
|
if (gravid!=0) {
|
||||||
mov eax,[ebp+0x8]
|
if (movespeed != 0.0) {
|
||||||
mov moveptrmech,eax
|
float timeinseconds=(deltaTime/1000.0f);
|
||||||
pusha
|
void * objptr = Sim::findObject(gravid);
|
||||||
};
|
if ((unsigned int)(objptr)) {
|
||||||
|
DX::SceneObject newobj=DX::SceneObject((unsigned int)objptr);
|
||||||
MECH_TURNING_SPEED=0.4f;
|
newobj.getPosition(pos);
|
||||||
|
newobj.getRotation(rot);
|
||||||
if (playerptr!=0) {
|
pos[2]+=(movespeed*timeinseconds);
|
||||||
playervar=&DX::Player(playerptr);
|
newobj.setPosition(pos);
|
||||||
mechchangedmove=(DX::Move*) moveptrmech;
|
}
|
||||||
//_snprintf (command,255,"return(%d.getDataBlock());",playervar->identifier);
|
}
|
||||||
//strncpy(buf,Con::evaluate(command,false,NULL,true),255);
|
|
||||||
if (playervar->dataBlock!=NULL) {
|
}
|
||||||
|
}
|
||||||
playerdatavar = &DX::SimObject(playervar->dataBlock);
|
static unsigned int gboaptr =(unsigned int ) &GameBaseOnAddHook;
|
||||||
//Con::printf("Datablock is %s\n",buf);
|
__declspec(dllexport) void ModInitialize(void)
|
||||||
if (playerdatavar->base_pointer_value!=0)
|
{
|
||||||
{
|
// Init WSA
|
||||||
strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechControlEnabled",false)));
|
WSADATA wsadata;
|
||||||
Con::printf("mechControlEnabled: %s",buf);
|
WSAStartup(0x0202, &wsadata);
|
||||||
|
|
||||||
if ((mechchangedmove)->freelook && ((mechchangedmove)->y>0.0) && dAtob(buf))
|
Con::addMethodS(NULL,"dumpHex",&conDumpHex,"dumpHex(addr,size,spaces)",4,5);
|
||||||
{
|
Con::addMethodS(NULL,"dumpDec",&conDumpUInt,"dumpDec(addr)",2,3);
|
||||||
//sprintf (command,"return (%d.getDataBlock().mechTurnSpeed);",playervar->identifier);
|
Con::addMethodS(NULL,"dumpFloat",&conDumpFloat,"dumpFloat(addr)",2,3);
|
||||||
strcpy_s<256>(buf,playerdatavar->getFieldValue(DX::StringTableInsert("mechTurnSpeed",false)));
|
Con::addMethodB("Player", "isjumping", &conPlayerGetJumpingState,"Returns whether or not the player is jumping", 2, 2);
|
||||||
Con::printf("mechTurnSpeed: %s",buf);
|
Con::addMethodB("Player", "isjetting", &conPlayerGetJettingState,"Returns whether or not the player is jetting", 2, 2);
|
||||||
MECH_TURNING_SPEED=atof(buf);
|
Con::addMethodB("GameConnection", "setheat", &conGameConnectionSetHeatLevel,"Sets the heat level", 3, 3);
|
||||||
|
Con::addMethodB("ShapeBase","setcloakvalue",&conShapeBaseSetCloakValue,"Sets the cloak value ex: setcloakvalue(1,0.5)",3,4);
|
||||||
// FIXME: The 3 here should reference the datablock's maximum turning angle -- we're essentially normalizing our rotation here.
|
Con::addMethodB("GrenadeProjectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);
|
||||||
float turnStrength = playervar->headRotationZ / 3;
|
Con::addMethodB("GameBase","setProcessTicks",&conSetProcessTicks,"Sets the flag for processing ticks or not", 3, 3);
|
||||||
// Use whatever is leftover in our forward movement
|
Con::addMethodB("Projectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);
|
||||||
float forwardStrength = 1 - fabs(turnStrength);
|
Con::addMethodB(NULL,"setAIMove",&consetMove,"setAIMove(%aicon, x, y, z, yaw, pitch, roll)", 2,10);
|
||||||
// Calculate a new turn value that we use for both the main body and the head.
|
Con::addMethodB(NULL,"setAITrigger", &consetTrigger, "setAITrigger(%aicon,triggerid,value);",2,6);
|
||||||
float newTurn = turnStrength * MECH_TURNING_SPEED;
|
Con::addMethodS("GrenadeProjectile", "getposition", &conGrenadeProjectileGetPosition,"Accurately gets the position of the GrenadeProjectile", 2, 2);
|
||||||
float newHeadTurn = turnStrength * (MECH_TURNING_SPEED/20);
|
Con::addMethodS("GrenadeProjectile", "getvelocity", &conGrenadeProjectileGetVelocity,"Gets the velocity of the GrenadeProjectile", 2, 2);
|
||||||
|
Con::addMethodB("Projectile", "makeNerf", &conProjectileMakeNerf,"Makes the Projectile deal no damage", 2, 2);
|
||||||
(mechchangedmove)->y = forwardStrength;
|
|
||||||
(mechchangedmove)->x += turnStrength;
|
// TCPObject
|
||||||
|
#ifdef ENABLE_TCPOBJECT
|
||||||
// FIXME: Is the yaw value definitely in radians?
|
Con::addMethodS("TCPObject", "connect", &conTCPObjectConnect, "Connects to a remote server", 3, 3);
|
||||||
playervar->mRotZ += newTurn + (mechchangedmove)->yaw;
|
Con::addMethodB("TCPObject", "send", &conTCPObjectSend, "Sends data to the remote server", 3, 3);
|
||||||
|
Con::addMethodB("TCPObject", "disconnect", &conTCPObjectDisconnect, "Disconnects from the remote server", 2, 2);
|
||||||
// Now, we must translate the turning strength into an appropriate subtraction for our
|
|
||||||
// head rotation.
|
// HTTPObject
|
||||||
playervar->headRotationZ += -newTurn;
|
Con::addMethodB("HTTPObject", "get", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
||||||
|
Con::addMethodB("HTTPObject", "post", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
||||||
(mechchangedmove)->pitch = 0;
|
Con::addMethodB("HTTPObject", "send", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
||||||
(mechchangedmove)->yaw = 0;
|
Con::addMethodB("HTTPObject", "connect", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
||||||
(mechchangedmove)->roll = 0;
|
Con::addMethodB("HTTPObject", "listen", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
||||||
(mechchangedmove)->freelook = true;
|
#endif
|
||||||
}
|
// BinaryObject
|
||||||
}
|
Con::addMethodB("BinaryObject", "openforread", &conBinaryObjectOpenForRead, "Opens the input file for reading binary data", 3, 4);
|
||||||
}
|
Con::addMethodB("BinaryObject", "save", &conBinaryObjectSave, "Saves the binary object data to a file", 3, 3);
|
||||||
}
|
Con::addMethodS("BinaryObject", "readu32", &conBinaryObjectReadU32, "Reads an unsigned int from the buffer", 2, 2);
|
||||||
__asm
|
Con::addMethodS("BinaryObject", "readf32", &conBinaryObjectReadF32, "Reads a float from the buffer", 2, 2);
|
||||||
{
|
Con::addMethodS("BinaryObject", "readu8", &conBinaryObjectReadU8, "Reads a unsigned char from the buffer", 2, 2);
|
||||||
popa
|
Con::addMethodB("BinaryObject", "setbufferpointer", &conBinaryObjectSetBufferPointer, "Sets the buffer pointer", 3, 3);
|
||||||
mov ebx,playerptr
|
Con::addMethodS("BinaryObject", "getbufferlength", &conBinaryObjectGetBufferLength, "Returns the length of the buffer", 2, 2);
|
||||||
mov eax,[ebp+8]
|
Con::addMethodS("BinaryObject", "getbufferpointer", &conBinaryObjectGetBufferPointer, "Returns the buffer pointer", 2, 2);
|
||||||
mov edx,[eax]
|
Con::addMethodB("BinaryObject", "close", &conBinaryObjectClose, "Closes the binary object", 2, 2);
|
||||||
mov [ebx+0x894],edx
|
Con::addMethodI("NetConnection","getGhostIndex", &conGetGhostIndex, "Gets a ghost index for an object id", 3, 3);
|
||||||
mov eax,[eax+4]
|
Con::addMethodB("NetConnection","forceUpdate", &conForceUpdate,"Forces an initial update for an object id", 3, 3);
|
||||||
jmp [updatemoveretptr]
|
Con::addMethodI("NetConnection","resolveGhostParent",&conResolveGhostParent,"Resolves a ghost index parent", 3, 3);
|
||||||
};
|
Con::addMethodS(NULL,"floatToHex",&conFloatToHex,"converts float to hex",2,3);
|
||||||
}
|
Con::addMethodI("NetConnection","resolveGhost",&conResolveGhost,"Resolves an object from a ghost ID for ServerConnection", 3, 3);
|
||||||
static unsigned int updatemovehookptr = (unsigned int)updateMoveHook;
|
Con::addMethodB(NULL,"clientCmdSetGhostTicks",&conclientCmdSetGhostTicks,"Client Command for disabling tick processing on ghost index",2,10);
|
||||||
DX::AIMove * getAIMovePtr(unsigned int id) {
|
Con::addMethodB(NULL,"clientCmdsetProcessTicks",&conclientCmdSetProcessTicks,"Client Command for disabling tick processing on ghost object",2,10);
|
||||||
int moveindex=0;
|
// General
|
||||||
bool foundindex=false;
|
Con::addMethodS(NULL, "sprintf", &conSprintf,"Formats a string. See the C sprintf.", 2, 20);
|
||||||
for (int x=0; x<1024; x++) {
|
Con::addMethodB(NULL, "tsExtensionUpdate", &conTSExtensionUpdate,"Updates the TSExtension.", 1, 1);
|
||||||
if (aimoves[x].id==id && aimoves[x].used==true) {
|
// memPatch Disabler
|
||||||
moveindex=x;
|
Con::addMethodB(NULL, "disableMempatch", &disableMempatch,"Disables memPatch.", 1, 1);
|
||||||
foundindex=true;
|
// Regex
|
||||||
break;
|
Con::addMethodB(NULL, "reSearch", &reSearch,"reSearch(pattern, target): Searches for a pattern within the target string.", 3, 3);
|
||||||
}
|
Con::addMethodB(NULL, "reMatch", &reMatch,"reMatch(pattern, target): Attempts to match the entire target string to a pattern.", 3, 3);
|
||||||
if (aimoves[x].used==false) {
|
Con::addMethodB(NULL, "reIterBegin", &reIterBegin,"reIterBegin(pattern, target): Begins an iterator search for patterns in the target string.", 3, 3);
|
||||||
moveindex=x;
|
Con::addMethodB(NULL, "reIterEnd", &reIterEnd,"reIterEnd(): Returns true when the iterator search ends.", 1, 1);
|
||||||
break;
|
Con::addMethodS(NULL,"reIterNext",&reIterNext,"reIterNext(): Returns the next matched pattern in the string.", 1, 1);
|
||||||
}
|
Con::addMethodS(NULL,"reReplace",&reReplace,"reReplace(pattern, target, replace): Replaces the pattern within the target string with another string.", 4, 4);
|
||||||
}
|
|
||||||
if (foundindex==true) {
|
// Add this Gvar to signify that TSExtension is active
|
||||||
return &aimoves[moveindex];
|
static bool is_active = true;
|
||||||
} else {
|
|
||||||
aimoves[moveindex].id=id;
|
|
||||||
aimoves[moveindex].used=true;
|
Con::addVariable("$TSExtension::UberGravity", TypeF32, &movespeed);
|
||||||
DX::generateNullMove(&(aimoves[moveindex].move));
|
Con::addVariable("$TSExtension::UberId",TypeS32, &gravid);
|
||||||
return &aimoves[moveindex];
|
Con::addVariable("$TSExtension::isActive", TypeBool, &is_active);
|
||||||
}
|
char mechcode[8]="\xA1\xAA\xAA\xAA\xAA\xFF\xE0";
|
||||||
}
|
char dbrwcode[8]="\xC7\x42\x18\x80\x01\x00\x00";
|
||||||
DX::Move tmpmove;
|
char dbpack[8]= "\xB8\xAA\xAA\xAA\xAA\xFF\xE0";
|
||||||
__declspec(dllexport) void __cdecl newAIMoveListGenerator(DX::Move** moves, unsigned int * moveCount) {
|
char dbunpack[8]="\xB8\xAA\xAA\xAA\xAA\xFF\xE0";
|
||||||
__asm {
|
char dbpatch3[8]="\xC7\x42\x18\x80\x01\x00\x00";
|
||||||
mov tmpobjptr,ecx
|
char dbclient2[2]="\xEB";
|
||||||
}
|
char dbclient[3]="\x90\x90";
|
||||||
|
char gboaonadd[8]="FF\x25\xAA\xAA\xAA\xAA";
|
||||||
unsigned int * origobjptr;
|
//memPatch("42e05f",
|
||||||
origobjptr=(unsigned int *) tmpobjptr;
|
#ifdef MECH_MOVE_CODE
|
||||||
DX::AIMove * aimove;
|
*((unsigned int*)(mechcode+1))=(unsigned int)&updatemovehookptr;
|
||||||
DX::GameConnection * aiconn;
|
#endif
|
||||||
//Con::printf ("Possible offsets for ID starting at 0x4\n");
|
*((unsigned int*)(dbpack+1))=(unsigned int)&DBpackData;
|
||||||
if (origobjptr !=0 ) {
|
*((unsigned int*)(dbunpack+1))=(unsigned int)&DBunpackData;
|
||||||
//unsigned int * idptr;
|
*((unsigned int*)(gboaonadd+2))=(unsigned int)&gboaptr;
|
||||||
//unsigned int offset=0x4;
|
#ifdef NEW_DB_CODE
|
||||||
//for (offset=0x4; offset<0x100; offset+=0x4) {
|
DX::memPatch(0x5D2D6E,(unsigned char *)mechcode,7);
|
||||||
|
DX::memPatch(0x438415,(unsigned char *)dbrwcode,7);
|
||||||
//idptr=(unsigned int *)((* (origobjptr))+offset);
|
DX::memPatch(0x436DF0,(unsigned char *)dbpack,7);
|
||||||
//Con::printf ("Offset: %08X Addr: %08X Data: %d",offset, idptr, *idptr);
|
DX::memPatch(0x436E00,(unsigned char *)dbunpack,7);
|
||||||
|
DX::memPatch(0x42e05f,(unsigned char *)dbclient,2);
|
||||||
//}
|
DX::memPatch(0x66E1ED,(unsigned char *)dbclient2,1);
|
||||||
aiconn = &DX::GameConnection((unsigned int)origobjptr+0xA0);
|
DX::memPatch(0x438415,(unsigned char *)dbpatch3,7);
|
||||||
aimove = getAIMovePtr(aiconn->identifier);
|
DX::memPatch(0x5E29F0,(unsigned char *)gboaonadd,7);
|
||||||
char movecallback[120]="";
|
#endif
|
||||||
sprintf_s<120>(movecallback,"AIMoveCallback(%d);",aiconn->identifier);
|
Py_SetProgramName("AIInterpreter");
|
||||||
Con::evaluate(movecallback,false,NULL,NULL);
|
}
|
||||||
//Con::printf ("BasePointer: %08X", aiconn.base_pointer_value);
|
}
|
||||||
//Con::printf ("Ecx Value: %08X", origobjptr);
|
|
||||||
//Con::printf("ID: %d\n",aiconn.identifier);
|
|
||||||
//Con::evaluate ("listPlayers();",true,NULL,NULL);
|
|
||||||
|
|
||||||
//Con::printf("orig: %08X obj: %08X\n",origobjptr,0xBADABEEB);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Con::printf("Move processed for %08X\n",(aicon.identifier));
|
|
||||||
}
|
|
||||||
//memcpy (&tmpmove,&(aimove->move),sizeof(DX::Move));
|
|
||||||
//DX::generateNullMove(&(aimove->move));
|
|
||||||
*moves = &(aimove->move);
|
|
||||||
*moveCount=1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool consetTrigger(Linker::SimObject *obj, S32 argc, const char *argv[]) {
|
|
||||||
unsigned int aiconid = atoi(argv[1]);
|
|
||||||
unsigned int index = atoi(argv[2]);
|
|
||||||
if (index < 6) {
|
|
||||||
DX::AIMove * aimove = getAIMovePtr(aiconid);
|
|
||||||
bool value = dAtob(argv[3]);
|
|
||||||
aimove->move.triggers[index]=value;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool consetMove(Linker::SimObject *obj, S32 argc, const char *argv[]) {
|
|
||||||
// setMove(%aicon, x, y, z, yaw, pitch, roll);
|
|
||||||
unsigned int aiconid = atoi(argv[1]);
|
|
||||||
DX::AIMove * aimove = getAIMovePtr(aiconid);
|
|
||||||
aimove->move.x=DX::clampFloat(std::stof(argv[2]));
|
|
||||||
aimove->move.y=DX::clampFloat(std::stof(argv[3]));
|
|
||||||
aimove->move.z=DX::clampFloat(std::stof(argv[4]));
|
|
||||||
aimove->move.yaw=DX::clampMove(std::stof(argv[5]));
|
|
||||||
aimove->move.pitch=DX::clampMove(std::stof(argv[6]));
|
|
||||||
aimove->move.roll=DX::clampMove(std::stof(argv[7]));
|
|
||||||
//Con::printf ("Set move variables for %d to x:%f y:%f z:%f yaw:%f pitch:%f roll:%f\n",aimove->id,aimove->move.x,aimove->move.y,aimove->move.z,aimove->move.yaw,aimove->move.pitch,aimove->move.roll);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool conEnableNewAI(Linker::SimObject *obj, S32 argc, const char *argv[])
|
|
||||||
{
|
|
||||||
(*((unsigned int *)0x75e360))=(unsigned int)newAIMoveListGenerator;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static S32 gravid=0;
|
|
||||||
static float movespeed=0.0;
|
|
||||||
__declspec(dllexport) void ServerProcess(unsigned int deltaTime)
|
|
||||||
{
|
|
||||||
//memPatch("602D1E","9090");
|
|
||||||
float pos[3];
|
|
||||||
float rot[4];
|
|
||||||
if (gravid!=0) {
|
|
||||||
if (movespeed != 0.0) {
|
|
||||||
float timeinseconds=(deltaTime/1000.0f);
|
|
||||||
void * objptr = Sim::findObject(gravid);
|
|
||||||
if ((unsigned int)(objptr)) {
|
|
||||||
DX::SceneObject newobj=DX::SceneObject((unsigned int)objptr);
|
|
||||||
newobj.getPosition(pos);
|
|
||||||
newobj.getRotation(rot);
|
|
||||||
pos[2]+=(movespeed*timeinseconds);
|
|
||||||
newobj.setPosition(pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static unsigned int gboaptr =(unsigned int ) &GameBaseOnAddHook;
|
|
||||||
__declspec(dllexport) void ModInitialize(void)
|
|
||||||
{
|
|
||||||
// Init WSA
|
|
||||||
WSADATA wsadata;
|
|
||||||
WSAStartup(0x0202, &wsadata);
|
|
||||||
|
|
||||||
Con::addMethodS(NULL,"dumpHex",&conDumpHex,"dumpHex(addr,size,spaces)",4,5);
|
|
||||||
Con::addMethodS(NULL,"dumpDec",&conDumpUInt,"dumpDec(addr)",2,3);
|
|
||||||
Con::addMethodS(NULL,"dumpFloat",&conDumpFloat,"dumpFloat(addr)",2,3);
|
|
||||||
Con::addMethodB("Player", "isjumping", &conPlayerGetJumpingState,"Returns whether or not the player is jumping", 2, 2);
|
|
||||||
Con::addMethodB("Player", "isjetting", &conPlayerGetJettingState,"Returns whether or not the player is jetting", 2, 2);
|
|
||||||
Con::addMethodB("GameConnection", "setheat", &conGameConnectionSetHeatLevel,"Sets the heat level", 3, 3);
|
|
||||||
Con::addMethodB("ShapeBase","setcloakvalue",&conShapeBaseSetCloakValue,"Sets the cloak value ex: setcloakvalue(1,0.5)",3,4);
|
|
||||||
Con::addMethodB("GrenadeProjectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);
|
|
||||||
Con::addMethodB("GameBase","setProcessTicks",&conSetProcessTicks,"Sets the flag for processing ticks or not", 3, 3);
|
|
||||||
Con::addMethodB("Projectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);
|
|
||||||
Con::addMethodB(NULL,"enableNewAI",&conEnableNewAI,"Enables the new Move Generation code for the AI", 1,4);
|
|
||||||
Con::addMethodB(NULL,"setAIMove",&consetMove,"setAIMove(%aicon, x, y, z, yaw, pitch, roll)", 2,10);
|
|
||||||
Con::addMethodB(NULL,"setAITrigger", &consetTrigger, "setAITrigger(%aicon,triggerid,value);",2,5);
|
|
||||||
Con::addMethodS("GrenadeProjectile", "getposition", &conGrenadeProjectileGetPosition,"Accurately gets the position of the GrenadeProjectile", 2, 2);
|
|
||||||
Con::addMethodS("GrenadeProjectile", "getvelocity", &conGrenadeProjectileGetVelocity,"Gets the velocity of the GrenadeProjectile", 2, 2);
|
|
||||||
Con::addMethodB("Projectile", "makeNerf", &conProjectileMakeNerf,"Makes the Projectile deal no damage", 2, 2);
|
|
||||||
|
|
||||||
// TCPObject
|
|
||||||
#ifdef ENABLE_TCPOBJECT
|
|
||||||
Con::addMethodS("TCPObject", "connect", &conTCPObjectConnect, "Connects to a remote server", 3, 3);
|
|
||||||
Con::addMethodB("TCPObject", "send", &conTCPObjectSend, "Sends data to the remote server", 3, 3);
|
|
||||||
Con::addMethodB("TCPObject", "disconnect", &conTCPObjectDisconnect, "Disconnects from the remote server", 2, 2);
|
|
||||||
|
|
||||||
// HTTPObject
|
|
||||||
Con::addMethodB("HTTPObject", "get", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
|
||||||
Con::addMethodB("HTTPObject", "post", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
|
||||||
Con::addMethodB("HTTPObject", "send", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
|
||||||
Con::addMethodB("HTTPObject", "connect", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
|
||||||
Con::addMethodB("HTTPObject", "listen", &conHTTPObjectDoNothing, "Disconnects from the remote server", 6, 6);
|
|
||||||
#endif
|
|
||||||
// BinaryObject
|
|
||||||
Con::addMethodB("BinaryObject", "openforread", &conBinaryObjectOpenForRead, "Opens the input file for reading binary data", 3, 4);
|
|
||||||
Con::addMethodB("BinaryObject", "save", &conBinaryObjectSave, "Saves the binary object data to a file", 3, 3);
|
|
||||||
Con::addMethodS("BinaryObject", "readu32", &conBinaryObjectReadU32, "Reads an unsigned int from the buffer", 2, 2);
|
|
||||||
Con::addMethodS("BinaryObject", "readf32", &conBinaryObjectReadF32, "Reads a float from the buffer", 2, 2);
|
|
||||||
Con::addMethodS("BinaryObject", "readu8", &conBinaryObjectReadU8, "Reads a unsigned char from the buffer", 2, 2);
|
|
||||||
Con::addMethodB("BinaryObject", "setbufferpointer", &conBinaryObjectSetBufferPointer, "Sets the buffer pointer", 3, 3);
|
|
||||||
Con::addMethodS("BinaryObject", "getbufferlength", &conBinaryObjectGetBufferLength, "Returns the length of the buffer", 2, 2);
|
|
||||||
Con::addMethodS("BinaryObject", "getbufferpointer", &conBinaryObjectGetBufferPointer, "Returns the buffer pointer", 2, 2);
|
|
||||||
Con::addMethodB("BinaryObject", "close", &conBinaryObjectClose, "Closes the binary object", 2, 2);
|
|
||||||
Con::addMethodI("NetConnection","getGhostIndex", &conGetGhostIndex, "Gets a ghost index for an object id", 3, 3);
|
|
||||||
Con::addMethodB("NetConnection","forceUpdate", &conForceUpdate,"Forces an initial update for an object id", 3, 3);
|
|
||||||
Con::addMethodI("NetConnection","resolveGhostParent",&conResolveGhostParent,"Resolves a ghost index parent", 3, 3);
|
|
||||||
Con::addMethodS(NULL,"floatToHex",&conFloatToHex,"converts float to hex",2,3);
|
|
||||||
Con::addMethodI("NetConnection","resolveGhost",&conResolveGhost,"Resolves an object from a ghost ID for ServerConnection", 3, 3);
|
|
||||||
Con::addMethodB(NULL,"clientCmdSetGhostTicks",&conclientCmdSetGhostTicks,"Client Command for disabling tick processing on ghost index",2,10);
|
|
||||||
Con::addMethodB(NULL,"clientCmdsetProcessTicks",&conclientCmdSetProcessTicks,"Client Command for disabling tick processing on ghost object",2,10);
|
|
||||||
// General
|
|
||||||
Con::addMethodS(NULL, "sprintf", &conSprintf,"Formats a string. See the C sprintf.", 2, 20);
|
|
||||||
Con::addMethodB(NULL, "tsExtensionUpdate", &conTSExtensionUpdate,"Updates the TSExtension.", 1, 1);
|
|
||||||
// memPatch Disabler
|
|
||||||
Con::addMethodB(NULL, "disableMempatch", &disableMempatch,"Disables memPatch.", 1, 1);
|
|
||||||
// Regex
|
|
||||||
Con::addMethodB(NULL, "reSearch", &reSearch,"reSearch(pattern, target): Searches for a pattern within the target string.", 3, 3);
|
|
||||||
Con::addMethodB(NULL, "reMatch", &reMatch,"reMatch(pattern, target): Attempts to match the entire target string to a pattern.", 3, 3);
|
|
||||||
Con::addMethodB(NULL, "reIterBegin", &reIterBegin,"reIterBegin(pattern, target): Begins an iterator search for patterns in the target string.", 3, 3);
|
|
||||||
Con::addMethodB(NULL, "reIterEnd", &reIterEnd,"reIterEnd(): Returns true when the iterator search ends.", 1, 1);
|
|
||||||
Con::addMethodS(NULL,"reIterNext",&reIterNext,"reIterNext(): Returns the next matched pattern in the string.", 1, 1);
|
|
||||||
Con::addMethodS(NULL,"reReplace",&reReplace,"reReplace(pattern, target, replace): Replaces the pattern within the target string with another string.", 4, 4);
|
|
||||||
|
|
||||||
// Add this Gvar to signify that TSExtension is active
|
|
||||||
static bool is_active = true;
|
|
||||||
|
|
||||||
|
|
||||||
Con::addVariable("$TSExtension::UberGravity", TypeF32, &movespeed);
|
|
||||||
Con::addVariable("$TSExtension::UberId",TypeS32, &gravid);
|
|
||||||
Con::addVariable("$TSExtension::isActive", TypeBool, &is_active);
|
|
||||||
char mechcode[8]="\xA1\xAA\xAA\xAA\xAA\xFF\xE0";
|
|
||||||
char dbrwcode[8]="\xC7\x42\x18\x80\x01\x00\x00";
|
|
||||||
char dbpack[8]= "\xB8\xAA\xAA\xAA\xAA\xFF\xE0";
|
|
||||||
char dbunpack[8]="\xB8\xAA\xAA\xAA\xAA\xFF\xE0";
|
|
||||||
char dbpatch3[8]="\xC7\x42\x18\x80\x01\x00\x00";
|
|
||||||
char dbclient2[2]="\xEB";
|
|
||||||
char dbclient[3]="\x90\x90";
|
|
||||||
char gboaonadd[8]="FF\x25\xAA\xAA\xAA\xAA";
|
|
||||||
//memPatch("42e05f",
|
|
||||||
#ifdef MECH_MOVE_CODE
|
|
||||||
*((unsigned int*)(mechcode+1))=(unsigned int)&updatemovehookptr;
|
|
||||||
#endif
|
|
||||||
*((unsigned int*)(dbpack+1))=(unsigned int)&DBpackData;
|
|
||||||
*((unsigned int*)(dbunpack+1))=(unsigned int)&DBunpackData;
|
|
||||||
*((unsigned int*)(gboaonadd+2))=(unsigned int)&gboaptr;
|
|
||||||
#ifdef NEW_DB_CODE
|
|
||||||
DX::memPatch(0x5D2D6E,(unsigned char *)mechcode,7);
|
|
||||||
DX::memPatch(0x438415,(unsigned char *)dbrwcode,7);
|
|
||||||
DX::memPatch(0x436DF0,(unsigned char *)dbpack,7);
|
|
||||||
DX::memPatch(0x436E00,(unsigned char *)dbunpack,7);
|
|
||||||
DX::memPatch(0x42e05f,(unsigned char *)dbclient,2);
|
|
||||||
DX::memPatch(0x66E1ED,(unsigned char *)dbclient2,1);
|
|
||||||
DX::memPatch(0x438415,(unsigned char *)dbpatch3,7);
|
|
||||||
DX::memPatch(0x5E29F0,(unsigned char *)gboaonadd,7);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,2 +1,2 @@
|
||||||
#v4.0:v100
|
#v4.0:v100
|
||||||
Release|Win32|C:\t2cpp\T2-CPP-master\|
|
Release|Win32|C:\Documents and Settings\NobodyBla\Desktop\T2AI\T2-CPP-master\|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,4 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
typedef void (*ServerProcessPointer)(unsigned int);
|
|
||||||
|
|
||||||
void serverProcessReplacement(unsigned int timeDelta);
|
void serverProcessReplacement(unsigned int timeDelta);
|
||||||
|
|
@ -4,16 +4,24 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <LinkerAPI.h>
|
#include <LinkerAPI.h>
|
||||||
|
#include <DXAPI\ScriptObject.h>
|
||||||
|
#include <ModLoader\ModLoader.h>
|
||||||
|
|
||||||
static std::tr1::unordered_set<ServerProcessPointer> sServerProcessResponders;
|
//! A vector of mod callables.
|
||||||
|
static std::vector<ModLoader::ModLoaderCallables*> sModCallables;
|
||||||
|
|
||||||
void serverProcessReplacement(unsigned int timeDelta)
|
void serverProcessReplacement(unsigned int timeDelta)
|
||||||
{
|
{
|
||||||
unsigned int servertickaddr=0x602350;
|
unsigned int servertickaddr=0x602350;
|
||||||
unsigned int serverthisptr=0x9E5EC0;
|
unsigned int serverthisptr=0x9E5EC0;
|
||||||
|
|
||||||
for (auto it = sServerProcessResponders.begin(); it != sServerProcessResponders.end(); it++)
|
// Call the server process hook for all eligible mods
|
||||||
(*it)(timeDelta);
|
for (auto it = sModCallables.begin(); it != sModCallables.end(); it++)
|
||||||
|
{
|
||||||
|
ModLoader::ModLoaderCallables* currentCallables = *it;
|
||||||
|
if (currentCallables->mServerProcessPointer != NULL)
|
||||||
|
currentCallables->mServerProcessPointer(timeDelta);
|
||||||
|
}
|
||||||
|
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
|
|
@ -23,48 +31,92 @@ void serverProcessReplacement(unsigned int timeDelta)
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mod Loader Implementation
|
// Mod Loader Implementation
|
||||||
|
bool conUnloadLoadMod(Linker::SimObject *obj,S32 argc, const char* argv[])
|
||||||
|
{
|
||||||
|
const char* targetName = argv[1];
|
||||||
|
|
||||||
|
for (auto it = sModCallables.begin(); it != sModCallables.end(); it++)
|
||||||
|
{
|
||||||
|
ModLoader::ModLoaderCallables* currentMod = *it;
|
||||||
|
if (strcmp(currentMod->mGetManagementName(), targetName) == 0)
|
||||||
|
{
|
||||||
|
// Deinitialize the mod and remove it from the list.
|
||||||
|
if (currentMod->mDeinitializeModPointer != NULL)
|
||||||
|
currentMod->mDeinitializeModPointer();
|
||||||
|
sModCallables.erase(it);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Something weird happened.
|
||||||
|
Con::errorf(0, "Failed to unload mod: '%s'.", targetName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool conLoadMod(Linker::SimObject *obj,S32 argc, const char* argv[])
|
bool conLoadMod(Linker::SimObject *obj,S32 argc, const char* argv[])
|
||||||
{
|
{
|
||||||
typedef void (*LPMODINIT)(void);
|
HINSTANCE hDLL = NULL;
|
||||||
HINSTANCE hDLL = NULL;
|
|
||||||
LPMODINIT lpInitMod = NULL;
|
|
||||||
|
|
||||||
std::string raw = "mods\\";
|
std::string raw = "mods\\";
|
||||||
raw += argv[1];
|
raw += argv[1];
|
||||||
raw += ".dll";
|
raw += ".dll";
|
||||||
|
|
||||||
std::wstring modification(raw.begin(), raw.end());
|
std::wstring modification(raw.begin(), raw.end());
|
||||||
|
|
||||||
hDLL = LoadLibrary(modification.c_str());
|
hDLL = LoadLibrary(modification.c_str());
|
||||||
if (hDLL == NULL)
|
if (hDLL == NULL)
|
||||||
|
{
|
||||||
|
Con::errorf(0, "loadMod(): Failed to load DLL '%s'. Does it exist in GameData\\mods? (%u)", raw.c_str(), GetLastError());
|
||||||
|
return false; // The DLL doesn't exist
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attempt to load supported loader information first
|
||||||
|
ModLoader::GetModLoaderVersionPointer getModLoaderVersion = (ModLoader::GetModLoaderVersionPointer)GetProcAddress(hDLL, "getModLoaderVersion");
|
||||||
|
if (getModLoaderVersion == NULL)
|
||||||
|
{
|
||||||
|
Con::errorf(0, "loadMod(): Failed to locate entry point 'getModLoaderVersion' in mod DLL '%s'. Is it a good mod DLL? (%u)", raw.c_str(), GetLastError());
|
||||||
|
return false; // Unable to load entry point
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if there's a server process responder in this DLL
|
||||||
|
ModLoader::GetModCallablesPointer getModCallables = (ModLoader::GetModCallablesPointer)GetProcAddress(hDLL, "getModCallables");
|
||||||
|
if (getModCallables == NULL)
|
||||||
|
{
|
||||||
|
Con::errorf(0, "loadMod(): Failed to locate entry point 'getModCallables' in mod DLL '%s'. Is it a good mod DLL? (%u)", raw.c_str(), GetLastError());
|
||||||
|
return false; // Unable to load entry point
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int modLoaderVersion = getModLoaderVersion();
|
||||||
|
ModLoader::ModLoaderCallables* callables = getModCallables();
|
||||||
|
|
||||||
|
// Management name function must be provided
|
||||||
|
if (callables->mGetManagementName == NULL)
|
||||||
|
{
|
||||||
|
Con::errorf(0, "loadMod(): Loaded mod did not provide a management name. This is required.", raw.c_str(), GetLastError());
|
||||||
|
return false; // Unable to load entry point
|
||||||
|
}
|
||||||
|
const char* managementName = callables->mGetManagementName();
|
||||||
|
|
||||||
|
// Is the mod already loaded?
|
||||||
|
for (auto it = sModCallables.begin(); it != sModCallables.end(); it++)
|
||||||
|
{
|
||||||
|
ModLoader::ModLoaderCallables* currentMod = *it;
|
||||||
|
if (strcmp(currentMod->mGetManagementName(), managementName) == 0)
|
||||||
{
|
{
|
||||||
Con::errorf(0, "loadMod(): Failed to load DLL '%s'. Does it exist in GameData\\mods? (%u)", raw.c_str(), GetLastError());
|
Con::errorf(0, "loadMod(): The mod is already loaded.", raw.c_str(), GetLastError());
|
||||||
return false; // The DLL doesn't exist
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
lpInitMod = (LPMODINIT)GetProcAddress(hDLL, "ModInitialize"); // Attempt to load our entry point
|
|
||||||
|
|
||||||
if (lpInitMod == NULL)
|
// FIXME: We should probably only run this once at init
|
||||||
{
|
Con::addMethodB(NULL, "unloadMod", &conUnloadLoadMod, "Unloads a C++ modification by name.", 2, 2);
|
||||||
Con::errorf(0, "loadMod(): Failed to locate entry point 'ModInitialize' in mod DLL '%s'. Is it a good mod DLL? (%u)", raw.c_str(), GetLastError());
|
|
||||||
return false; // Unable to load entry point
|
|
||||||
}
|
|
||||||
|
|
||||||
lpInitMod();
|
if (callables->mInitializeModPointer != NULL)
|
||||||
Con::errorf(0, "loadMod(): Loaded and executed entry point code for mod DLL '%s'", raw.c_str());
|
callables->mInitializeModPointer();
|
||||||
|
|
||||||
// Check if there's a server process responder in this DLL
|
sModCallables.push_back(callables);
|
||||||
ServerProcessPointer serverProcess = (ServerProcessPointer)GetProcAddress(hDLL, "ServerProcess"); // Attempt to load our entry point
|
return true;
|
||||||
|
|
||||||
if (serverProcess != NULL)
|
|
||||||
{
|
|
||||||
sServerProcessResponders.insert(sServerProcessResponders.end(), serverProcess);
|
|
||||||
Con::errorf(0, "loadMod(): Added server process responder for mod");
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include <stdafx.h>
|
#include <stdafx.h>
|
||||||
|
|
||||||
#include <LinkerAPI.h>
|
#include <LinkerAPI.h>
|
||||||
|
#include <DXAPI\DXAPI.h>
|
||||||
#include <modLoader.h>
|
#include <modLoader.h>
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
@ -20,8 +21,22 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const unsigned char moduroutine[] = {0x8B, 0x3D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x8B, 0x14, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0x83, 0xFA, 0x00, 0x74, 0x30, 0x8B, 0x3D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x31, 0xD2, 0x89, 0xF8, 0x8B, 0x04, 0x85, 0x00, 0xA6, 0x88, 0x00, 0xF7, 0x34, 0xBD, 0xFC, 0xA5, 0x88, 0x00, 0xFF, 0x0D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x89, 0x14, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0, 0xFF, 0x0D, 0xEC, 0x82, 0x9E, 0x00, 0xC7, 0x04, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0};
|
|
||||||
const unsigned char interpreterRoutine[] = {0x8B ,0x56 ,0x18 ,0x89 ,0x15 ,0x10 ,0xB7 ,0xA3 ,0x00 ,0x89 ,0x1D ,0x14 ,0xB7 ,0xA3 ,0x00 ,0x8B ,0x55 ,0x80 ,0x89 ,0xD0 ,0xBF ,0xD9 ,0xCE ,0x42 ,0x00 ,0x3D ,0x55 ,0x00 ,0x00 ,0x00 ,0xFF ,0xE7};
|
const unsigned char moduroutine[] = {
|
||||||
|
0x8B, 0x3D, 0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x8B, 0x14, 0x85, 0xFC,
|
||||||
|
0xA5, 0x88, 0x00, 0x83, 0xFA, 0x00, 0x74, 0x30, 0x8B, 0x3D, 0xEC, 0x82,
|
||||||
|
0x9E, 0x00, 0x89, 0xF8, 0x31, 0xD2, 0x89, 0xF8, 0x8B, 0x04, 0x85, 0x00,
|
||||||
|
0xA6, 0x88, 0x00, 0xF7, 0x34, 0xBD, 0xFC, 0xA5, 0x88, 0x00, 0xFF, 0x0D,
|
||||||
|
0xEC, 0x82, 0x9E, 0x00, 0x89, 0xF8, 0x89, 0x14, 0x85, 0xFC, 0xA5, 0x88,
|
||||||
|
0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0, 0xFF, 0x0D, 0xEC, 0x82,
|
||||||
|
0x9E, 0x00, 0xC7, 0x04, 0x85, 0xFC, 0xA5, 0x88, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0xB8, 0xC7, 0xCE, 0x42, 0x00, 0xFF, 0xE0};
|
||||||
|
|
||||||
|
const unsigned char interpreterRoutine[] = {
|
||||||
|
0x8B, 0x56, 0x18, 0x89, 0x15, 0x10, 0xB7, 0xA3 ,0x00, 0x89, 0x1D, 0x14,
|
||||||
|
0xB7, 0xA3, 0x00, 0x8B, 0x55, 0x80, 0x89, 0xD0 ,0xBF, 0xD9, 0xCE, 0x42, 0x00,
|
||||||
|
0x3D, 0x55, 0x00, 0x00, 0x00, 0xFF, 0xE7};
|
||||||
|
|
||||||
const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||||
{
|
{
|
||||||
char test[256] = "";
|
char test[256] = "";
|
||||||
|
|
@ -30,6 +45,7 @@ const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[]
|
||||||
sprintf(test2,"B8%08XFFD089EC5DC3",endian(spr));
|
sprintf(test2,"B8%08XFFD089EC5DC3",endian(spr));
|
||||||
return test2;
|
return test2;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* congetModuAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
const char* congetModuAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||||
{
|
{
|
||||||
char test[256] = "";
|
char test[256] = "";
|
||||||
|
|
@ -38,6 +54,7 @@ const char* congetModuAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||||
sprintf(test2,"B8%08XFFE0",endian(spr));
|
sprintf(test2,"B8%08XFFE0",endian(spr));
|
||||||
return test2;
|
return test2;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* congetInterpreterAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
const char* congetInterpreterAddr(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||||
{
|
{
|
||||||
char test[256] = "";
|
char test[256] = "";
|
||||||
|
|
@ -63,6 +80,7 @@ class CImmDevice
|
||||||
Con::addVariable("$cpuspeed",TypeS32,reinterpret_cast<void*>(0x8477F8)); //1 - S32, this is so i can set my cpu speed to 31337 or osmething =P
|
Con::addVariable("$cpuspeed",TypeS32,reinterpret_cast<void*>(0x8477F8)); //1 - S32, this is so i can set my cpu speed to 31337 or osmething =P
|
||||||
Con::addVariable("$GameBase::showBoundingBox",TypeBool,reinterpret_cast<void*>(0x9ECF24));
|
Con::addVariable("$GameBase::showBoundingBox",TypeBool,reinterpret_cast<void*>(0x9ECF24));
|
||||||
DWORD oldprotect=0;
|
DWORD oldprotect=0;
|
||||||
|
|
||||||
// Mod Loader Function
|
// Mod Loader Function
|
||||||
Con::addMethodB(NULL, "loadMod", &conLoadMod, "Loads a C++ modification.",2,2);
|
Con::addMethodB(NULL, "loadMod", &conLoadMod, "Loads a C++ modification.",2,2);
|
||||||
Con::addMethodS(NULL, "getServPAddr",&congetServPAddr,"Gets the memPatch data for ServerProcess",1,1);
|
Con::addMethodS(NULL, "getServPAddr",&congetServPAddr,"Gets the memPatch data for ServerProcess",1,1);
|
||||||
|
|
@ -87,6 +105,9 @@ class CImmDevice
|
||||||
else
|
else
|
||||||
lpinitT2DLL(); // The function was loaded, call TribesNext and move on to postTN Startup
|
lpinitT2DLL(); // The function was loaded, call TribesNext and move on to postTN Startup
|
||||||
|
|
||||||
|
// Initialize all engine hooks
|
||||||
|
DX::initializeHooks();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue