Compare commits
No commits in common. "a28bebc626097c8c368b417351affca6271c2dca" and "03bdf4a1e0aa6dfb3aac4ccc8592829f3c7a9dc3" have entirely different histories.
a28bebc626
...
03bdf4a1e0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
BepInEx
|
BepInEx
|
||||||
FodyWeavers.xsd
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
|
||||||
<Costura>
|
|
||||||
<IncludeAssemblies>
|
|
||||||
System.*
|
|
||||||
deniszykov.WebSocketListener
|
|
||||||
Buttplug
|
|
||||||
Buttplug.Client.Connectors.WebsocketConnector
|
|
||||||
Newtonsoft.Json
|
|
||||||
</IncludeAssemblies>
|
|
||||||
</Costura>
|
|
||||||
</Weavers>
|
|
|
@ -13,38 +13,16 @@
|
||||||
</RestoreAdditionalProjectSources>
|
</RestoreAdditionalProjectSources>
|
||||||
<RootNamespace>MetalButtplug</RootNamespace>
|
<RootNamespace>MetalButtplug</RootNamespace>
|
||||||
<NoWarn>$(NoWarn);NU1603</NoWarn>
|
<NoWarn>$(NoWarn);NU1603</NoWarn>
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
|
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
|
||||||
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
|
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
|
||||||
<PackageReference Include="Buttplug" Version="3.0.1" />
|
|
||||||
<PackageReference Include="Buttplug.Client.Connectors.WebsocketConnector" Version="3.0.1" />
|
|
||||||
|
|
||||||
<Reference Include="UnityEngine.CoreModule">
|
|
||||||
<HintPath>./BepInEx/interop/UnityEngine.CoreModule.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Assembly-CSharp">
|
<Reference Include="Assembly-CSharp">
|
||||||
<HintPath>./BepInEx/interop/Assembly-CSharp.dll</HintPath>
|
<HintPath>./BepInEx/interop/Assembly-CSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Il2Cppmscorlib">
|
<Reference Include="Il2Cppmscorlib">
|
||||||
<HintPath>./BepInEx/interop/Il2Cppmscorlib.dll</HintPath>
|
<HintPath>./BepInEx/interop/Il2Cppmscorlib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Buttplug">
|
|
||||||
<HintPath>./deps/Buttplug.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Buttplug.Client.Connectors.WebsocketConnector">
|
|
||||||
<HintPath>./deps/Buttplug.Client.Connectors.WebsocketConnector.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
|
|
||||||
<!-- the crap that makes this fucking thing work -->
|
|
||||||
<PackageReference Include="Costura.Fody" Version="5.7.0">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Fody" Version="6.8.0">
|
|
||||||
<IncludeAssets>runtime; build; compile; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
12
Patches/TestPatch.cs
Normal file
12
Patches/TestPatch.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace MetalButtplug.Patches;
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(BeatSequencer), nameof(BeatSequencer.UpdateBeat))]
|
||||||
|
internal class TestPatch {
|
||||||
|
private static void Prefix(BeatStatusProvider beatStatus) {
|
||||||
|
if (beatStatus.BeatFlags.HasFlag(BeatFlags.Quarter)) {
|
||||||
|
Plugin.Log.LogInfo("Quarter beat");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,19 +0,0 @@
|
||||||
using HarmonyLib;
|
|
||||||
|
|
||||||
namespace MetalButtplug.Patches;
|
|
||||||
|
|
||||||
[HarmonyPatch(typeof(BeatSequencer), nameof(BeatSequencer.UpdateBeat))]
|
|
||||||
internal class UpdateBeatPatch {
|
|
||||||
private static void Prefix(BeatStatusProvider beatStatus) {
|
|
||||||
if (beatStatus.BeatFlags.HasFlag(BeatFlags.Quarter)) {
|
|
||||||
var playerController = UnityEngine.Object.FindObjectOfType<FirstPersonController>();
|
|
||||||
var player = playerController.m_player;
|
|
||||||
var controller = player.ScoreController;
|
|
||||||
|
|
||||||
Plugin.Log.LogInfo(
|
|
||||||
$"Quarter beat, multiplier: {controller.GetCurrentTierIndex()}/{controller.GetNumTiers()} ({1 << controller.GetCurrentTierIndex()}x)"
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@
|
||||||
using BepInEx.Logging;
|
using BepInEx.Logging;
|
||||||
using BepInEx.Unity.IL2CPP;
|
using BepInEx.Unity.IL2CPP;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using MetalButtplug.Utils;
|
|
||||||
|
|
||||||
namespace MetalButtplug;
|
namespace MetalButtplug;
|
||||||
|
|
||||||
|
@ -14,10 +13,7 @@ public class Plugin : BasePlugin {
|
||||||
Plugin.Log = base.Log;
|
Plugin.Log = base.Log;
|
||||||
|
|
||||||
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
|
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
|
||||||
|
Log.LogInfo("GAY SEX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
harmony.PatchAll(typeof(Patches.UpdateBeatPatch));
|
harmony.PatchAll(typeof(Patches.TestPatch));
|
||||||
Log.LogInfo("Applied patches");
|
|
||||||
|
|
||||||
ButtplugManager.Init();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
using System;
|
|
||||||
using Buttplug.Client;
|
|
||||||
using Buttplug.Client.Connectors.WebsocketConnector;
|
|
||||||
|
|
||||||
namespace MetalButtplug.Utils;
|
|
||||||
|
|
||||||
internal static class ButtplugManager {
|
|
||||||
public static bool enabled = false;
|
|
||||||
static ButtplugClient client;
|
|
||||||
|
|
||||||
public async static void Init() {
|
|
||||||
ButtplugManager.client = new ButtplugClient("Metal: Hellsinger");
|
|
||||||
|
|
||||||
Plugin.Log.LogInfo("Attempting buttplug connection");
|
|
||||||
|
|
||||||
try {
|
|
||||||
var connector = new ButtplugWebsocketConnector(new Uri("ws://localhost:12345"));
|
|
||||||
await client.ConnectAsync(connector);
|
|
||||||
Plugin.Log.LogInfo("Connected to buttplug server!");
|
|
||||||
enabled = true;
|
|
||||||
} catch(Exception ex) {
|
|
||||||
Plugin.Log.LogWarning($"Failed to connect: {ex.Message}\nDisabling buttplug integration - Is Intiface running?");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
client.DeviceAdded += OnDeviceAdd;
|
|
||||||
client.DeviceRemoved += OnDeviceRemove;
|
|
||||||
|
|
||||||
Plugin.Log.LogInfo($"Found devices:");
|
|
||||||
foreach (ButtplugClientDevice device in client.Devices) {
|
|
||||||
Plugin.Log.LogInfo($"- ${device.DisplayName}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnDeviceAdd(object sender, DeviceAddedEventArgs e) {
|
|
||||||
Plugin.Log.LogInfo($"Device added: {e.Device.DisplayName}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnDeviceRemove(object sender, DeviceRemovedEventArgs e) {
|
|
||||||
Plugin.Log.LogInfo($"Device removed: {e.Device.DisplayName}");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
dotnet build
|
|
||||||
rm -vrf BepInEx/plugins/MetalButtplug
|
|
||||||
mkdir -v BepInEx/plugins/MetalButtplug
|
|
||||||
#cp bin/Debug/net6.0/{MetalButtplug,Buttplug,Buttplug.Client.Connectors.WebsocketConnector,System.Threading.Channels}.dll BepInEx/plugins/MetalButtplug
|
|
||||||
cp -v bin/Debug/net6.0/MetalButtplug.{pdb,dll} BepInEx/plugins/MetalButtplug/
|
|
Loading…
Reference in a new issue