aaaaa
This commit is contained in:
40
BoneSync/Patching/PlugPatches.cs
Normal file
40
BoneSync/Patching/PlugPatches.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BoneSync.Sync;
|
||||
using BoneSync.Sync.Components;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
using StressLevelZero.Interaction;
|
||||
|
||||
namespace BoneSync.Patching
|
||||
{
|
||||
[HarmonyPatch(typeof(Socket))]
|
||||
public class SocketPatches
|
||||
{
|
||||
[HarmonyPatch(nameof(Socket.OnPlugEnter)), HarmonyPostfix]
|
||||
public static void SocketEnterPatch(Socket __instance, Plug plug)
|
||||
{
|
||||
if (!plug) return;
|
||||
MelonLogger.Msg("Plug entered: " + __instance.name + " Plug: " + plug.name);
|
||||
Syncable syncable = ObjectSyncCache.GetSyncable(plug);
|
||||
if (!syncable) return;
|
||||
byte id = syncable.GetPlugId(plug);
|
||||
MelonLogger.Msg("Plug entered: " + __instance.name + " Plug: " + plug.name + " ID: " + id);
|
||||
|
||||
}
|
||||
|
||||
[HarmonyPatch(nameof(Socket.OnPlugExit)), HarmonyPostfix]
|
||||
public static void SocketExitPatch(Socket __instance, Plug plug)
|
||||
{
|
||||
if (!plug) return;
|
||||
MelonLogger.Msg("Plug exited: " + __instance.name + " Plug: " + plug.name);
|
||||
Syncable syncable = ObjectSyncCache.GetSyncable(plug);
|
||||
if (!syncable) return;
|
||||
byte id = syncable.GetPlugId(plug);
|
||||
MelonLogger.Msg("Plug exited: " + __instance.name + " Plug: " + plug.name + " ID: " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user