diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
index e85b54ed6..b2eea4eb9 100644
--- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
@@ -363,6 +363,7 @@ public static void MessageTranslated(this Player player, string words, string tr
/// 's type.
/// Property name starting with Network.
/// Value of send to target.
+ [Obsolete("Use overload with type-template instead.")]
public static void SendFakeSyncVar(this Player target, NetworkIdentity behaviorOwner, Type targetType, string propertyName, object value)
{
if (!target.IsConnected)
@@ -386,6 +387,38 @@ void CustomSyncVarGenerator(NetworkWriter targetWriter)
}
}
+ ///
+ /// Send fake values to client's .
+ ///
+ /// Target SyncVar property type.
+ /// Target to send.
+ /// of object that owns .
+ /// 's type.
+ /// Property name starting with Network.
+ /// Value of send to target.
+ public static void SendFakeSyncVar(this Player target, NetworkIdentity behaviorOwner, Type targetType, string propertyName, T value)
+ {
+ if (!target.IsConnected)
+ return;
+
+ NetworkWriterPooled writer = NetworkWriterPool.Get();
+ NetworkWriterPooled writer2 = NetworkWriterPool.Get();
+ MakeCustomSyncWriter(behaviorOwner, targetType, null, CustomSyncVarGenerator, writer, writer2);
+ target.Connection.Send(new EntityStateMessage
+ {
+ netId = behaviorOwner.netId,
+ payload = writer.ToArraySegment(),
+ });
+
+ NetworkWriterPool.Return(writer);
+ NetworkWriterPool.Return(writer2);
+ void CustomSyncVarGenerator(NetworkWriter targetWriter)
+ {
+ targetWriter.WriteULong(SyncVarDirtyBits[$"{targetType.Name}.{propertyName}"]);
+ WriterExtensions[typeof(T)]?.Invoke(null, new object[2] { targetWriter, value });
+ }
+ }
+
///
/// Force resync to client's .
///