diff --git a/MiraAPI/Networking/CustomMurderRpc.cs b/MiraAPI/Networking/CustomMurderRpc.cs
index 7629ebc..1e3f08f 100644
--- a/MiraAPI/Networking/CustomMurderRpc.cs
+++ b/MiraAPI/Networking/CustomMurderRpc.cs
@@ -7,10 +7,12 @@ using Assets.CoreScripts;
using BepInEx.Unity.IL2CPP.Utils;
using MiraAPI.Events;
using MiraAPI.Events.Vanilla.Gameplay;
+using MiraAPI.Utilities;
using Reactor.Networking.Attributes;
using Reactor.Networking.Rpc;
using Reactor.Utilities;
using Reactor.Utilities.Extensions;
+using Rewired;
using UnityEngine;
using Object = UnityEngine.Object;
@@ -22,7 +24,7 @@ namespace MiraAPI.Networking;
public static class CustomMurderRpc
{
///
- /// Networked Custom Murder method.
+ /// Networked Custom Murder method, ran by clients for the host to confirm kills.
///
/// The killer.
/// The player to murder.
@@ -54,7 +56,7 @@ public static class CustomMurderRpc
}
///
- /// Networked Custom Murder method, which checks for meetings as well.
+ /// Networked Custom Murder method, which checks for meetings as well, ran by clients for the host to confirm kills.
///
/// The killer.
/// The player to murder.
@@ -96,6 +98,52 @@ public static class CustomMurderRpc
murderResultFlags = MurderResultFlags.FailedError;
}
+ if (!PlayerControl.LocalPlayer.IsHost())
+ {
+ return;
+ }
+
+ RpcConfirmCustomMurder(
+ PlayerControl.LocalPlayer,
+ source,
+ target,
+ murderResultFlags,
+ resetKillTimer,
+ createDeadBody,
+ teleportMurderer,
+ showKillAnim,
+ playKillSound);
+ }
+
+ ///
+ /// Networked Custom Murder method, which checks for meetings as well, ran by clients for the host to confirm kills.
+ ///
+ /// The game host.
+ /// The killer.
+ /// The player to murder.
+ /// End result for the murder.
+ /// Should the kill timer be reset.
+ /// Should a dead body be created.
+ /// Should the killer be snapped to the dead player.
+ /// Should the kill animation be shown.
+ /// Should the kill sound be played.
+ [MethodRpc((uint)MiraRpc.ConfirmCustomMurder, LocalHandling = RpcLocalHandling.Before)]
+ public static void RpcConfirmCustomMurder(
+ this PlayerControl host,
+ PlayerControl source,
+ PlayerControl target,
+ MurderResultFlags murderResultFlags,
+ bool resetKillTimer = true,
+ bool createDeadBody = true,
+ bool teleportMurderer = true,
+ bool showKillAnim = true,
+ bool playKillSound = true)
+ {
+ if (LobbyBehaviour.Instance || !host.IsHost() || target.Data.IsDead || target.Data.Disconnected)
+ {
+ return;
+ }
+
var murderResultFlags2 = MurderResultFlags.DecisionByHost | murderResultFlags;
source.CustomMurder(
diff --git a/MiraAPI/Networking/MiraRpc.cs b/MiraAPI/Networking/MiraRpc.cs
index 28c6c7a..edc3a94 100644
--- a/MiraAPI/Networking/MiraRpc.cs
+++ b/MiraAPI/Networking/MiraRpc.cs
@@ -35,6 +35,11 @@ public enum MiraRpc : uint
///
CustomMurder,
+ ///
+ /// Custom Murder RPC Confirmation.
+ ///
+ ConfirmCustomMurder,
+
///
/// Custom Game Over RPC.
///