Compare commits
87 Commits
db6211c7f8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d3f9f8afb | |||
| 1fa8516ebe | |||
| 3dbe62a64d | |||
|
|
6d7f9aa8c0 | ||
| 671d8e4ad6 | |||
| 335df69fcd | |||
| 54ec8da1fe | |||
| f6f484549a | |||
| 5f148bc86f | |||
| b72add4e81 | |||
| b9390bbf03 | |||
| f5ad619ed5 | |||
|
|
8edfcff56f | ||
|
|
e29f0ebb70 | ||
|
|
77a6101e08 | ||
|
|
9a468564e8 | ||
|
|
b004b725f0 | ||
|
|
ff52da9542 | ||
|
|
3d879a605d | ||
|
|
143505f762 | ||
| 21e44cc4c7 | |||
| ba6d71a2ec | |||
| f06af0647d | |||
| 253f29f5be | |||
|
|
64b2005beb | ||
|
|
922c33d4a1 | ||
|
|
2f27e39610 | ||
|
|
104c52c183 | ||
| 95cd554eb0 | |||
| f1f8f1cbcf | |||
| 1843410a4d | |||
| 3f359ed4ec | |||
| 632230b8b2 | |||
| 756deee097 | |||
|
|
a7769147e3 | ||
|
|
3238fb7acf | ||
|
|
92ab39ed69 | ||
|
|
f27e325526 | ||
|
|
a7dc4441a7 | ||
|
|
68aa949591 | ||
|
|
a479fa8dd6 | ||
|
|
52f3d57721 | ||
|
|
00f0a33a47 | ||
|
|
f9db5be09b | ||
|
|
3b0c26a687 | ||
|
|
20a624fb0f | ||
|
|
adbd7f4704 | ||
|
|
eb66d0b089 | ||
|
|
a892e80068 | ||
|
|
7bc1b21098 | ||
|
|
252f6ba49a | ||
|
|
c0e912be87 | ||
|
|
0030f68f99 | ||
|
|
28715ef80d | ||
| 54301cbf37 | |||
| 84e3efe3e9 | |||
| 2c8f1af97d | |||
| 44776c3499 | |||
| 5f0b1d40fb | |||
| 2004f9cd0d | |||
| 4bd96e59bd | |||
| 8c887ae0e4 | |||
| 03127bd810 | |||
| 7ab5f9779b | |||
| 7b5b4b2744 | |||
| bc10f6b1b7 | |||
| e2e91ce513 | |||
| 51d7d81605 | |||
| 6402afc72b | |||
|
|
c11256f9a1 | ||
|
|
9295ba43e3 | ||
|
|
b7bd646520 | ||
|
|
7f266321db | ||
|
|
fc744fd1ab | ||
|
|
055ee44da5 | ||
|
|
b485ab3259 | ||
|
|
76062e026e | ||
|
|
061e7e6d8d | ||
| d0eb7f89be | |||
| 1dce1960f6 | |||
| ff70bad234 | |||
| ee1b827c91 | |||
| 43f6710697 | |||
| b721e2d25e | |||
| c1c879c80c | |||
| b16c90f4e2 | |||
| da196057e5 |
13
.idea/.idea.BoneSync/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.BoneSync/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/contentModel.xml
|
||||||
|
/.idea.BoneSync.iml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/modules.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
4
.idea/.idea.BoneSync/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.BoneSync/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
8
.idea/.idea.BoneSync/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.BoneSync/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/.idea.BoneSync/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.BoneSync/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -5,8 +5,6 @@ VisualStudioVersion = 17.9.34616.47
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BoneSync", "BoneSync\BoneSync.csproj", "{C33921DC-5778-4EEC-A2D0-E0AE522CC701}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BoneSync", "BoneSync\BoneSync.csproj", "{C33921DC-5778-4EEC-A2D0-E0AE522CC701}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Win64", "Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj", "{FBEAD21F-E45E-4EC5-86A3-1FA6089E140D}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -17,10 +15,6 @@ Global
|
|||||||
{C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{FBEAD21F-E45E-4EC5-86A3-1FA6089E140D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{FBEAD21F-E45E-4EC5-86A3-1FA6089E140D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{FBEAD21F-E45E-4EC5-86A3-1FA6089E140D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{FBEAD21F-E45E-4EC5-86A3-1FA6089E140D}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\packages\xunit.runner.visualstudio.3.0.2\build\net472\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.3.0.2\build\net472\xunit.runner.visualstudio.props')" />
|
|
||||||
<Import Project="..\packages\xunit.core.2.9.3\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.9.3\build\xunit.core.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@@ -27,6 +25,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
@@ -36,43 +35,29 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="MelonLoader">
|
<Reference Include="0Harmony, Version=2.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Stationeers\MelonLoader\MelonLoader.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<Private>False</Private>
|
<HintPath>A:\SteamLibrary\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\0Harmony.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="Assembly-CSharp">
|
||||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\Assembly-CSharp.dll</HintPath>
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.TestPlatform.PlatformAbstractions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="Il2Cppmscorlib">
|
||||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\Il2Cppmscorlib.dll</HintPath>
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="MelonLoader, Version=0.5.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.12.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<Private>False</Private>
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\MelonLoader.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MSTest.TestFramework.3.8.2\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MSTest.TestFramework.3.8.2\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Runtime" />
|
<Reference Include="System.Runtime" />
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@@ -80,64 +65,258 @@
|
|||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
<Reference Include="UnhollowerBaseLib">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnhollowerBaseLib.dll</HintPath>
|
||||||
<HintPath>..\..\..\..\.nuget\packages\xunit.abstractions\2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="xunit.assert, Version=2.9.3.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
<Reference Include="UnityEngine">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.dll</HintPath>
|
||||||
<HintPath>..\..\..\..\.nuget\packages\xunit.assert\2.9.3\lib\netstandard1.1\xunit.assert.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="xunit.core, Version=2.9.3.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
<Reference Include="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\.nuget\packages\xunit.extensibility.core\2.9.3\lib\net452\xunit.core.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.AnimationModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="xunit.execution.desktop, Version=2.9.3.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
<Reference Include="UnityEngine.AssetBundleModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\.nuget\packages\xunit.extensibility.execution\2.9.3\lib\net452\xunit.execution.desktop.dll</HintPath>
|
<HintPath>A:\SteamLibrary\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.CoreModule">
|
||||||
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.PhysicsModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.UI.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.UIElementsModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\MelonLoader\Managed\UnityEngine.UIModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Data\ByteEncoder.cs" />
|
||||||
|
<Compile Include="Data\Debugger.cs" />
|
||||||
|
<Compile Include="Data\EmebeddedAssetBundle.cs" />
|
||||||
|
<Compile Include="Data\PlayerScripts.cs" />
|
||||||
|
<Compile Include="Data\SpawnableManager.cs" />
|
||||||
|
<Compile Include="Data\Structs.cs" />
|
||||||
|
<Compile Include="Networking\Messages\AISyncMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\DiscardSyncableMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\GunSyncMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\SceneChangeMessage.cs" />
|
||||||
|
<Compile Include="Patching\AIHealthPatches.cs" />
|
||||||
|
<Compile Include="Patching\ButtonTogglePatches.cs" />
|
||||||
|
<Compile Include="Patching\CartPatches.cs" />
|
||||||
|
<Compile Include="Patching\HolsterSlotPatches.cs" />
|
||||||
|
<Compile Include="Networking\Messages\MagazineSyncMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\ObjectDamageMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\ObjectSyncMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\OwnershipTransferMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\PlugSyncMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\RegisterSyncableMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\SimpleSyncableEventMessage.cs" />
|
||||||
|
<Compile Include="Patching\CallPatchedMethod.cs" />
|
||||||
|
<Compile Include="Patching\DebugPatches.cs" />
|
||||||
|
<Compile Include="Patching\GripPatches.cs" />
|
||||||
|
<Compile Include="Patching\GunPatches.cs" />
|
||||||
|
<Compile Include="Patching\InteractableHostPatches.cs" />
|
||||||
|
<Compile Include="Patching\ObjectHealthPatches.cs" />
|
||||||
|
<Compile Include="Patching\PlugPatches.cs" />
|
||||||
|
<Compile Include="Patching\PrefabSpawnerPatches.cs" />
|
||||||
|
<Compile Include="Patching\SceneManagerPatches.cs" />
|
||||||
|
<Compile Include="Patching\SkeletonHandPatches.cs" />
|
||||||
|
<Compile Include="Patching\UnityEventPatching.cs" />
|
||||||
|
<Compile Include="Patching\ZonePatches.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncableAI.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncableBase.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncableDamage.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncableNetworking.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncablePhysics.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncablePlugs.cs" />
|
||||||
|
<Compile Include="Sync\Components\SyncableProperties.cs" />
|
||||||
|
<Compile Include="Sync\ObjectSync.cs" />
|
||||||
|
<Compile Include="Sync\ObjectSyncCache.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Callbacks\CallResult.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Callbacks\ICallbackData.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Classes\AuthTicket.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Classes\Dispatch.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Classes\SteamApi.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Classes\SteamGameServer.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Classes\SteamInternal.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Enum\LeaderboardDisplay.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Enum\LeaderboardSort.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Enum\SendType.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\CustomEnums.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamAppList.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamApps.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamClient.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamController.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamFriends.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamGameSearch.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamGameServer.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamGameServerStats.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamHTMLSurface.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamHTTP.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamInput.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamInventory.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMatchmaking.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMatchmakingPingResponse.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMatchmakingPlayersResponse.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMatchmakingRulesResponse.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMatchmakingServerListResponse.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMatchmakingServers.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMusic.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamMusicRemote.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamNetworking.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamNetworkingConnectionCustomSignaling.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamNetworkingCustomSignalingRecvContext.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamNetworkingSockets.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamNetworkingUtils.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamParentalSettings.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamParties.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamRemotePlay.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamRemoteStorage.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamScreenshots.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamTV.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamUGC.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamUser.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamUserStats.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamUtils.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\Interfaces\ISteamVideo.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\SteamCallbacks.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\SteamConstants.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\SteamEnums.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\SteamStructFunctions.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\SteamStructs.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Generated\SteamTypes.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\Connection.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\ConnectionInfo.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\ConnectionManager.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\IConnectionManager.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\ISocketManager.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetAddress.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetDebugFunc.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetErrorMessage.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetIdentity.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetKeyValue.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetMsg.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\NetPingLocation.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\Socket.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\SocketManager.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Networking\SteamDatagramRelayAuthTicket.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\Base.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\Favourites.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\Friends.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\History.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\Internet.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\IpList.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\ServerList\LocalNetwork.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamApps.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamClient.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamFriends.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamInput.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamInventory.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamMatchmaking.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamMatchmakingServers.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamMusic.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamNetworking.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamNetworkingSockets.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamNetworkingUtils.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamParental.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamParties.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamRemotePlay.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamRemoteStorage.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamScreenshots.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamServer.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamServerStats.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamUgc.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamUser.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamUserStats.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamUtils.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\SteamVideo.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Achievement.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\AppId.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Controller.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\DepotId.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\DlcInformation.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\DownloadProgress.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\DurationControl.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\FileDetails.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Friend.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\GameId.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Image.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\InventoryDef.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\InventoryItem.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\InventoryPurchaseResult.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\InventoryRecipe.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\InventoryResult.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Leaderboard.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\LeaderboardEntry.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\LeaderboardUpdate.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Lobby.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\LobbyQuery.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\MatchMakingKeyValuePair.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\NumericalFilter.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\OutgoingPacket.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\P2Packet.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\PartyBeacon.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\RemotePlaySession.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Screenshot.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Server.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\ServerInit.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Stat.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\SteamId.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\SteamIpAddress.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\SteamParamStringArray.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\Ugc.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\UgcEditor.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\UgcItem.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\UgcQuery.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\UgcResultPage.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Structs\UserItemVote.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\Epoch.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\Helpers.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\Platform.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\SourceServerQuery.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\SteamInterface.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\Utf8String.cs" />
|
||||||
|
<Compile Include="Facepunch.Steamworks\Utility\Utility.cs" />
|
||||||
<Compile Include="MelonLoaderMod.cs" />
|
<Compile Include="MelonLoaderMod.cs" />
|
||||||
<Compile Include="Networking\LobbyManager\LobbyManager.cs" />
|
<Compile Include="Networking\LobbyManager\LobbyManager.cs" />
|
||||||
<Compile Include="Networking\LobbyManager\SteamLobbyManager.cs" />
|
<Compile Include="Networking\LobbyManager\SteamLobbyManager.cs" />
|
||||||
<Compile Include="Networking\Messages\LobbyInfoMessage.cs" />
|
<Compile Include="Networking\Messages\LobbyInfoMessage.cs" />
|
||||||
<Compile Include="Networking\Messages\NetworkMessage.cs" />
|
<Compile Include="Networking\NetworkMessage.cs" />
|
||||||
|
<Compile Include="Networking\Messages\PlayerSyncMessage.cs" />
|
||||||
<Compile Include="Networking\Packet.cs" />
|
<Compile Include="Networking\Packet.cs" />
|
||||||
<Compile Include="Networking\PacketTypes.cs" />
|
<Compile Include="Networking\PacketTypes.cs" />
|
||||||
<Compile Include="Networking\Transport\SteamTransport.cs" />
|
<Compile Include="Networking\Transport\SteamTransport.cs" />
|
||||||
<Compile Include="Networking\Transport\TransportBase.cs" />
|
<Compile Include="Networking\Transport\TransportBase.cs" />
|
||||||
|
<Compile Include="Patching\PoolPatches.cs" />
|
||||||
|
<Compile Include="Player\PlayerRig.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Networking\ByteEncoder.cs" />
|
<Compile Include="Sync\SceneSync.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<WCFMetadata Include="Connected Services\" />
|
<Content Include="Facepunch.Steamworks\LICENSE.txt" />
|
||||||
|
<EmbeddedResource Include="steam_api.dll" />
|
||||||
|
<EmbeddedResource Include="steam_api64.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<EmbeddedResource Include="playerrep.eres" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Analyzer Include="..\packages\MSTest.Analyzers.3.8.2\analyzers\dotnet\cs\MSTest.Analyzers.CodeFixes.dll" />
|
|
||||||
<Analyzer Include="..\packages\MSTest.Analyzers.3.8.2\analyzers\dotnet\cs\MSTest.Analyzers.dll" />
|
|
||||||
<Analyzer Include="..\packages\xunit.analyzers.1.20.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
|
|
||||||
<Analyzer Include="..\packages\xunit.analyzers.1.20.0\analyzers\dotnet\cs\xunit.analyzers.fixes.dll" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>xcopy /Y "$(TargetPath)" "A:\SteamLibrary\steamapps\common\BONEWORKS\BONEWORKS\Mods\"
|
||||||
</PostBuildEvent>
|
xcopy /Y "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\Mods\"</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\xunit.core.2.9.3\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.9.3\build\xunit.core.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\xunit.core.2.9.3\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.9.3\build\xunit.core.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.3.0.2\build\net472\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.3.0.2\build\net472\xunit.runner.visualstudio.props'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\xunit.core.2.9.3\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.9.3\build\xunit.core.targets')" />
|
|
||||||
</Project>
|
</Project>
|
||||||
384
BoneSync/Data/ByteEncoder.cs
Normal file
384
BoneSync/Data/ByteEncoder.cs
Normal file
@@ -0,0 +1,384 @@
|
|||||||
|
using BoneSync.Networking.Messages;
|
||||||
|
using StressLevelZero;
|
||||||
|
using StressLevelZero.Combat;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace BoneSync.Data
|
||||||
|
{
|
||||||
|
public static class BitPacking
|
||||||
|
{
|
||||||
|
public static byte[] PackBits(bool[] bits)
|
||||||
|
{
|
||||||
|
int byteCount = bits.Length / 8;
|
||||||
|
if (bits.Length % 8 != 0)
|
||||||
|
{
|
||||||
|
byteCount++;
|
||||||
|
}
|
||||||
|
byte[] bytes = new byte[byteCount];
|
||||||
|
for (int i = 0; i < bits.Length; i++)
|
||||||
|
{
|
||||||
|
int byteIndex = i / 8;
|
||||||
|
int bitIndex = i % 8;
|
||||||
|
if (bits[i])
|
||||||
|
{
|
||||||
|
bytes[byteIndex] |= (byte)(1 << bitIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool[] UnpackBits(byte[] bytes, int bitCount)
|
||||||
|
{
|
||||||
|
bool[] bits = new bool[bitCount];
|
||||||
|
for (int i = 0; i < bitCount; i++)
|
||||||
|
{
|
||||||
|
int byteIndex = i / 8;
|
||||||
|
int bitIndex = i % 8;
|
||||||
|
bits[i] = (bytes[byteIndex] & (1 << bitIndex)) != 0;
|
||||||
|
}
|
||||||
|
return bits;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal class ByteEncoder
|
||||||
|
{
|
||||||
|
private MemoryStream stream;
|
||||||
|
private BinaryWriter writer;
|
||||||
|
private BinaryReader reader;
|
||||||
|
private bool isWriting;
|
||||||
|
|
||||||
|
public ByteEncoder()
|
||||||
|
{
|
||||||
|
stream = new MemoryStream();
|
||||||
|
writer = new BinaryWriter(stream);
|
||||||
|
isWriting = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ByteEncoder(byte[] data)
|
||||||
|
{
|
||||||
|
stream = new MemoryStream(data);
|
||||||
|
reader = new BinaryReader(stream);
|
||||||
|
isWriting = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] ToArray()
|
||||||
|
{
|
||||||
|
byte[] buf = stream.GetBuffer();
|
||||||
|
int start, len;
|
||||||
|
if (isWriting)
|
||||||
|
{
|
||||||
|
start = 0;
|
||||||
|
len = (int)stream.Length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
start = (int)stream.Position;
|
||||||
|
len = (int)stream.Length - start;
|
||||||
|
}
|
||||||
|
byte[] res = new byte[len];
|
||||||
|
Array.Copy(buf, start, res, 0, len);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetBytes(byte[] data)
|
||||||
|
{
|
||||||
|
if (stream != null)
|
||||||
|
{
|
||||||
|
stream.Dispose();
|
||||||
|
}
|
||||||
|
stream = new MemoryStream(data);
|
||||||
|
reader = new BinaryReader(stream);
|
||||||
|
writer = null;
|
||||||
|
isWriting = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteByte(byte value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteBytes(byte[] value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] ReadBytes(int count)
|
||||||
|
{
|
||||||
|
byte[] value = reader.ReadBytes(count);
|
||||||
|
if (value.Length != count)
|
||||||
|
{
|
||||||
|
throw new Exception("Not enough data to read, expected " + count + " but only have " + value.Length);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte ReadByte()
|
||||||
|
{
|
||||||
|
return reader.ReadByte();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteBool(bool value)
|
||||||
|
{
|
||||||
|
WriteByte((byte)(value ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ReadBool()
|
||||||
|
{
|
||||||
|
return ReadByte() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteInt(int value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int ReadInt()
|
||||||
|
{
|
||||||
|
return reader.ReadInt32();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteLong(long value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long ReadLong()
|
||||||
|
{
|
||||||
|
return reader.ReadInt64();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteFloat(float value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float ReadFloat()
|
||||||
|
{
|
||||||
|
return reader.ReadSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteUShort(ushort value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ushort ReadUShort()
|
||||||
|
{
|
||||||
|
return reader.ReadUInt16();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteDouble(double value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double ReadDouble()
|
||||||
|
{
|
||||||
|
return reader.ReadDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteString(string value)
|
||||||
|
{
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(value);
|
||||||
|
WriteInt(bytes.Length);
|
||||||
|
WriteBytes(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ReadString()
|
||||||
|
{
|
||||||
|
int length = ReadInt();
|
||||||
|
return Encoding.UTF8.GetString(ReadBytes(length));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteULong(ulong value)
|
||||||
|
{
|
||||||
|
writer.Write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ulong ReadULong()
|
||||||
|
{
|
||||||
|
return reader.ReadUInt64();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteVector3(Vector3 value)
|
||||||
|
{
|
||||||
|
WriteFloat(value.x);
|
||||||
|
WriteFloat(value.y);
|
||||||
|
WriteFloat(value.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 ReadVector3()
|
||||||
|
{
|
||||||
|
float x = ReadFloat();
|
||||||
|
float y = ReadFloat();
|
||||||
|
float z = ReadFloat();
|
||||||
|
return new Vector3(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteQuaternion(Quaternion value)
|
||||||
|
{
|
||||||
|
WriteVector3(value.eulerAngles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Quaternion ReadQuaternion()
|
||||||
|
{
|
||||||
|
Vector3 eulerAngles = ReadVector3();
|
||||||
|
return Quaternion.Euler(eulerAngles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteSimpleTransform(SimpleSyncTransform value)
|
||||||
|
{
|
||||||
|
WriteVector3(value.position);
|
||||||
|
WriteQuaternion(value.rotation);
|
||||||
|
WriteBool(value.scale.HasValue);
|
||||||
|
if (value.scale.HasValue)
|
||||||
|
WriteVector3(value.scale.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleSyncTransform ReadSimpleTransform()
|
||||||
|
{
|
||||||
|
Vector3 position = ReadVector3();
|
||||||
|
Quaternion rotation = ReadQuaternion();
|
||||||
|
bool hasScale = ReadBool();
|
||||||
|
Vector3? scale = null;
|
||||||
|
if (hasScale)
|
||||||
|
{
|
||||||
|
scale = ReadVector3();
|
||||||
|
}
|
||||||
|
return new SimpleSyncTransform()
|
||||||
|
{
|
||||||
|
position = position,
|
||||||
|
rotation = rotation,
|
||||||
|
scale = scale
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteMatrix4x4(Matrix4x4 matrix)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
WriteFloat(matrix[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix4x4 ReadMatrix4x4()
|
||||||
|
{
|
||||||
|
Matrix4x4 matrix = new Matrix4x4();
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
matrix[i] = ReadFloat();
|
||||||
|
}
|
||||||
|
return matrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteBoolArray(bool[] array)
|
||||||
|
{
|
||||||
|
byte[] bytes = BitPacking.PackBits(array);
|
||||||
|
WriteByte((byte)bytes.Length);
|
||||||
|
WriteBytes(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool[] ReadBoolArray()
|
||||||
|
{
|
||||||
|
byte length = ReadByte();
|
||||||
|
byte[] bytes = ReadBytes(length);
|
||||||
|
return BitPacking.UnpackBits(bytes, length * 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteAmmoVariables(AmmoVariables ammoVariables)
|
||||||
|
{
|
||||||
|
WriteBool(ammoVariables.Tracer);
|
||||||
|
WriteFloat(ammoVariables.ProjectileMass);
|
||||||
|
WriteFloat(ammoVariables.ExitVelocity);
|
||||||
|
WriteFloat(ammoVariables.AttackDamage);
|
||||||
|
WriteByte((byte)ammoVariables.AttackType);
|
||||||
|
WriteByte((byte)ammoVariables.cartridgeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AmmoVariables ReadAmmoVariables()
|
||||||
|
{
|
||||||
|
AmmoVariables ammoVariables = new AmmoVariables()
|
||||||
|
{
|
||||||
|
Tracer = ReadBool(),
|
||||||
|
ProjectileMass = ReadFloat(),
|
||||||
|
ExitVelocity = ReadFloat(),
|
||||||
|
AttackDamage = ReadFloat(),
|
||||||
|
AttackType = (AttackType)ReadByte(),
|
||||||
|
cartridgeType = (Cart)ReadByte()
|
||||||
|
};
|
||||||
|
return ammoVariables;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteMagazineData(MagazineData magazineData)
|
||||||
|
{
|
||||||
|
WriteByte((byte)magazineData.weight);
|
||||||
|
WriteByte((byte)magazineData.platform);
|
||||||
|
WriteUShort((byte)magazineData.cartridgeType);
|
||||||
|
BulletObject[] bulletObjects = magazineData.AmmoSlots;
|
||||||
|
WriteByte((byte)bulletObjects.Length);
|
||||||
|
for (int i = 0; i < bulletObjects.Length; i++)
|
||||||
|
{
|
||||||
|
WriteAmmoVariables(bulletObjects[i].ammoVariables);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MagazineData ReadMagazineData()
|
||||||
|
{
|
||||||
|
MagazineData mag = new MagazineData();
|
||||||
|
mag.weight = (Weight)ReadByte();
|
||||||
|
mag.platform = (Platform)ReadByte();
|
||||||
|
mag.cartridgeType = (Cart)ReadUShort();
|
||||||
|
byte bulletCount = ReadByte();
|
||||||
|
|
||||||
|
mag.AmmoSlots = new BulletObject[bulletCount];
|
||||||
|
for (int i = 0; i < bulletCount; i++)
|
||||||
|
{
|
||||||
|
mag.AmmoSlots[i] = new BulletObject()
|
||||||
|
{
|
||||||
|
ammoVariables = ReadAmmoVariables()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return mag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteCompressedFloat(float value)
|
||||||
|
{
|
||||||
|
value = Mathf.Clamp01(value);
|
||||||
|
int rounded = Mathf.FloorToInt(value * 255f);
|
||||||
|
WriteByte((byte)rounded);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float ReadCompressedFloat()
|
||||||
|
{
|
||||||
|
return ReadByte() / 255f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteFingerCurl(SimpleFingerCurl fingerCurl)
|
||||||
|
{
|
||||||
|
WriteCompressedFloat(fingerCurl.thumb);
|
||||||
|
WriteCompressedFloat(fingerCurl.index);
|
||||||
|
WriteCompressedFloat(fingerCurl.middle);
|
||||||
|
WriteCompressedFloat(fingerCurl.ring);
|
||||||
|
WriteCompressedFloat(fingerCurl.pinky);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleFingerCurl ReadFingerCurl()
|
||||||
|
{
|
||||||
|
SimpleFingerCurl fingerCurl = new SimpleFingerCurl()
|
||||||
|
{
|
||||||
|
thumb = ReadCompressedFloat(),
|
||||||
|
index = ReadCompressedFloat(),
|
||||||
|
middle = ReadCompressedFloat(),
|
||||||
|
ring = ReadCompressedFloat(),
|
||||||
|
pinky = ReadCompressedFloat()
|
||||||
|
};
|
||||||
|
return fingerCurl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
110
BoneSync/Data/Debugger.cs
Normal file
110
BoneSync/Data/Debugger.cs
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
using MelonLoader;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace BoneSync.Data
|
||||||
|
{
|
||||||
|
internal static class SyncLogger
|
||||||
|
{
|
||||||
|
private static string GetCleanCaller(string className, string methodName)
|
||||||
|
{
|
||||||
|
if (className.Contains("BoneSync"))
|
||||||
|
className = className.Replace("BoneSync.", "");
|
||||||
|
if (methodName.Contains("BoneSync"))
|
||||||
|
methodName = methodName.Replace("BoneSync.", "");
|
||||||
|
return $"{className}.{methodName}";
|
||||||
|
}
|
||||||
|
public static void Msg(string message, ConsoleColor color = ConsoleColor.White, int frame = 1)
|
||||||
|
{
|
||||||
|
StackTrace stackTrace = new StackTrace();
|
||||||
|
StackFrame stackFrame = stackTrace.GetFrame(frame);
|
||||||
|
MethodBase methodBase = stackFrame.GetMethod();
|
||||||
|
|
||||||
|
string methodName = methodBase.Name;
|
||||||
|
string className = methodBase.DeclaringType.Name;
|
||||||
|
string cleanCaller = GetCleanCaller(className, methodName);
|
||||||
|
|
||||||
|
MelonLogger.Msg(color, $"[{cleanCaller}] {message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Warning(string message)
|
||||||
|
{
|
||||||
|
Msg(message, ConsoleColor.Yellow, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Error(string message)
|
||||||
|
{
|
||||||
|
Msg(message, ConsoleColor.Red, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void Debug(string v)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
Msg($"[DEBUG] {v}", ConsoleColor.Gray, 2);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*internal static class SyncDebugUI
|
||||||
|
{
|
||||||
|
public static Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
||||||
|
public static Text debugText;
|
||||||
|
public static void CreateUI()
|
||||||
|
{
|
||||||
|
if (debugText != null)
|
||||||
|
return;
|
||||||
|
GameObject canvas = new GameObject("BoneSyncDebugCanvas");
|
||||||
|
canvas.AddComponent<Canvas>();
|
||||||
|
canvas.AddComponent<CanvasScaler>();
|
||||||
|
canvas.AddComponent<GraphicRaycaster>();
|
||||||
|
canvas.GetComponent<Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
|
||||||
|
|
||||||
|
GameObject panel = new GameObject("BoneSyncDebugPanel");
|
||||||
|
panel.transform.SetParent(canvas.transform);
|
||||||
|
panel.AddComponent<CanvasRenderer>();
|
||||||
|
panel.AddComponent<Image>();
|
||||||
|
panel.GetComponent<Image>().color = new Color(0, 0, 0, 0.5f);
|
||||||
|
panel.GetComponent<RectTransform>().anchorMin = new Vector2(0, 0);
|
||||||
|
panel.GetComponent<RectTransform>().anchorMax = new Vector2(1, 1);
|
||||||
|
panel.GetComponent<RectTransform>().offsetMin = new Vector2(0, 0);
|
||||||
|
panel.GetComponent<RectTransform>().offsetMax = new Vector2(0, 0);
|
||||||
|
|
||||||
|
GameObject text = new GameObject("BoneSyncDebugText");
|
||||||
|
text.transform.SetParent(panel.transform);
|
||||||
|
text.AddComponent<RectTransform>();
|
||||||
|
text.AddComponent<Text>();
|
||||||
|
text.GetComponent<Text>().font = Font.CreateDynamicFontFromOSFont("Arial", 12);
|
||||||
|
text.GetComponent<Text>().color = Color.white;
|
||||||
|
text.GetComponent<Text>().alignment = TextAnchor.UpperLeft;
|
||||||
|
text.GetComponent<Text>().resizeTextForBestFit = true;
|
||||||
|
text.GetComponent<Text>().resizeTextMaxSize = 12;
|
||||||
|
text.GetComponent<Text>().resizeTextMinSize = 8;
|
||||||
|
text.GetComponent<Text>().text = "BoneSync Debug";
|
||||||
|
text.GetComponent<RectTransform>().anchorMin = new Vector2(0, 0);
|
||||||
|
text.GetComponent<RectTransform>().anchorMax = new Vector2(1, 1);
|
||||||
|
text.GetComponent<RectTransform>().offsetMin = new Vector2(0, 0);
|
||||||
|
text.GetComponent<RectTransform>().offsetMax = new Vector2(0, 0);
|
||||||
|
|
||||||
|
debugText = text.GetComponent<Text>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UpdateUI()
|
||||||
|
{
|
||||||
|
CreateUI();
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
foreach (var kvp in keyValuePairs)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"{kvp.Key}: {kvp.Value}");
|
||||||
|
}
|
||||||
|
debugText.text = sb.ToString();
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
42
BoneSync/Data/EmebeddedAssetBundle.cs
Normal file
42
BoneSync/Data/EmebeddedAssetBundle.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MelonLoader;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace BoneSync.Data
|
||||||
|
{
|
||||||
|
public static class EmebeddedAssetBundle
|
||||||
|
{
|
||||||
|
// Credit to the "Entanglement" mod. The playerrep asset bundle is also by them.
|
||||||
|
public static AssetBundle LoadFromAssembly(string name)
|
||||||
|
{
|
||||||
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
|
string[] manifestResources = assembly.GetManifestResourceNames();
|
||||||
|
|
||||||
|
if (manifestResources.Contains(name))
|
||||||
|
{
|
||||||
|
SyncLogger.Msg($"Loading embedded bundle data {name}...");
|
||||||
|
|
||||||
|
byte[] bytes;
|
||||||
|
using (Stream str = assembly.GetManifestResourceStream(name))
|
||||||
|
using (MemoryStream memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
str.CopyTo(memoryStream);
|
||||||
|
bytes = memoryStream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
SyncLogger.Msg($"Loading bundle from data {name}, please be patient...");
|
||||||
|
AssetBundle temp = AssetBundle.LoadFromMemory(bytes);
|
||||||
|
SyncLogger.Msg($"Done!");
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
SyncLogger.Warning($"Failed to load embedded bundle data {name}! Bundle not found.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
63
BoneSync/Data/PlayerScripts.cs
Normal file
63
BoneSync/Data/PlayerScripts.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MelonLoader;
|
||||||
|
using StressLevelZero.Interaction;
|
||||||
|
using StressLevelZero.Player;
|
||||||
|
using StressLevelZero.Rig;
|
||||||
|
using StressLevelZero.VRMK;
|
||||||
|
using UnhollowerBaseLib;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace BoneSync.Data
|
||||||
|
{
|
||||||
|
// copied from Entanglement mod
|
||||||
|
public static class PlayerScripts
|
||||||
|
{
|
||||||
|
public static GameObject localPlayerGameObject;
|
||||||
|
public static RigManager playerRig;
|
||||||
|
public static PhysBody playerPhysBody;
|
||||||
|
public static Player_Health playerHealth;
|
||||||
|
public static PhysGrounder playerGrounder;
|
||||||
|
public static Hand playerLeftHand;
|
||||||
|
public static Hand playerRightHand;
|
||||||
|
public static bool reloadLevelOnDeath;
|
||||||
|
public static RuntimeAnimatorController playerAnimatorController;
|
||||||
|
public static Il2CppStringArray playerHandPoses = null;
|
||||||
|
|
||||||
|
public static void GetPlayerScripts()
|
||||||
|
{
|
||||||
|
if (playerRig != null)
|
||||||
|
return;
|
||||||
|
localPlayerGameObject = GameObject.Find("[RigManager (Default Brett)]");
|
||||||
|
playerRig = localPlayerGameObject.GetComponentInChildren<RigManager>();
|
||||||
|
playerHealth = playerRig.playerHealth;
|
||||||
|
|
||||||
|
reloadLevelOnDeath = playerHealth.reloadLevelOnDeath;
|
||||||
|
|
||||||
|
playerHealth.reloadLevelOnDeath = !BoneSync.IsConnected;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PhysicsRig physicsRig = playerRig.physicsRig;
|
||||||
|
playerPhysBody = physicsRig.physBody;
|
||||||
|
playerGrounder = playerPhysBody.physG;
|
||||||
|
playerLeftHand = physicsRig.leftHand;
|
||||||
|
playerRightHand = physicsRig.rightHand;
|
||||||
|
playerAnimatorController = playerRig.gameWorldSkeletonRig.characterAnimationManager.animator.runtimeAnimatorController;
|
||||||
|
} catch
|
||||||
|
{
|
||||||
|
SyncLogger.Warning("Failed to get physicsRig player scripts!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GetHandPoses()
|
||||||
|
{
|
||||||
|
// Checks if we already got the hand poses to prevent crashes
|
||||||
|
if (playerHandPoses == null)
|
||||||
|
CharacterAnimationManager.FetchHandPoseList(out playerHandPoses); // Lets hope this is constant!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
84
BoneSync/Data/SpawnableManager.cs
Normal file
84
BoneSync/Data/SpawnableManager.cs
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
using BoneSync.Patching;
|
||||||
|
using MelonLoader;
|
||||||
|
using StressLevelZero.Data;
|
||||||
|
using StressLevelZero.Pool;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnhollowerBaseLib;
|
||||||
|
using UnhollowerRuntimeLib;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityObject = UnityEngine.Object;
|
||||||
|
|
||||||
|
namespace BoneSync.Data
|
||||||
|
{
|
||||||
|
public static class SpawnableManager
|
||||||
|
{
|
||||||
|
private static Dictionary<string, SpawnableObject> _spawnableCache = new Dictionary<string, SpawnableObject>();
|
||||||
|
private static Dictionary<string, SpawnableObject> _spawnablePrefabNameCache = new Dictionary<string, SpawnableObject>();
|
||||||
|
|
||||||
|
public static void AddUnregisteredSpawnables()
|
||||||
|
{
|
||||||
|
Il2CppReferenceArray<UnityObject> foundSpawnables = UnityObject.FindObjectsOfTypeIncludingAssets(Il2CppType.Of<SpawnableObject>());
|
||||||
|
foreach (UnityObject obj in foundSpawnables)
|
||||||
|
{
|
||||||
|
SpawnableObject spawnable = obj.Cast<SpawnableObject>();
|
||||||
|
RegisterSpawnable(spawnable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void _ClearCache()
|
||||||
|
{
|
||||||
|
_spawnableCache.Clear();
|
||||||
|
_spawnablePrefabNameCache.Clear();
|
||||||
|
}
|
||||||
|
public static void RegisterSpawnable(SpawnableObject spawnable)
|
||||||
|
{
|
||||||
|
if (!_spawnableCache.ContainsKey(spawnable?.title))
|
||||||
|
_spawnableCache.Add(spawnable?.title, spawnable);
|
||||||
|
if (spawnable?.prefab?.name != null && !_spawnablePrefabNameCache.ContainsKey(spawnable.prefab.name))
|
||||||
|
_spawnablePrefabNameCache.Add(spawnable.prefab.name, spawnable);
|
||||||
|
}
|
||||||
|
public static SpawnableObject GetSpawnable(string title)
|
||||||
|
{
|
||||||
|
if (_spawnableCache.ContainsKey(title))
|
||||||
|
return _spawnableCache[title];
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SpawnableObject GetSpawnableByPrefabName(string prefabName)
|
||||||
|
{
|
||||||
|
if (_spawnablePrefabNameCache.ContainsKey(prefabName))
|
||||||
|
return _spawnablePrefabNameCache[prefabName];
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Pool GetPool(SpawnableObject spawnable) {
|
||||||
|
PoolManager.RegisterPool(spawnable);
|
||||||
|
return PoolManager.GetPool(spawnable.title);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Poolee SpawnPoolee(SpawnableObject spawnableObject, Vector3 position, Quaternion rotation)
|
||||||
|
{
|
||||||
|
if (spawnableObject == null) return null;
|
||||||
|
Pool pool = GetPool(spawnableObject);
|
||||||
|
if (pool == null)
|
||||||
|
{
|
||||||
|
SyncLogger.Warning("Failed to find pool: " + spawnableObject.title);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Poolee poolee = CallPatchedMethods.InstantiatePoolee(pool, position, rotation, pool.Prefab.transform.localScale);
|
||||||
|
|
||||||
|
return poolee;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Initialize()
|
||||||
|
{
|
||||||
|
_ClearCache();
|
||||||
|
AddUnregisteredSpawnables();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
BoneSync/Data/Structs.cs
Normal file
32
BoneSync/Data/Structs.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace BoneSync.Data
|
||||||
|
{
|
||||||
|
|
||||||
|
public static class SimpleTransformExtensions
|
||||||
|
{
|
||||||
|
public static void ApplySimpleTransform(this Transform transform, SimpleSyncTransform simpleTransform)
|
||||||
|
{
|
||||||
|
transform.position = simpleTransform.position;
|
||||||
|
transform.rotation = simpleTransform.rotation;
|
||||||
|
if (simpleTransform.scale.HasValue) transform.localScale = simpleTransform.scale.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public struct SimpleSyncTransform
|
||||||
|
{
|
||||||
|
public Vector3 position;
|
||||||
|
public Quaternion rotation;
|
||||||
|
public Vector3? scale;
|
||||||
|
public SimpleSyncTransform(Transform transform, bool withScale = true)
|
||||||
|
{
|
||||||
|
position = transform.position;
|
||||||
|
rotation = transform.rotation;
|
||||||
|
scale = withScale ? transform.localScale : (Vector3?)null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user