@@ -32,13 +32,11 @@ public class MethodRpc : UnsafeCustomRpc
3232 /// <param name="id">The id of the rpc.</param>
3333 /// <param name="option">The send option of the rpc.</param>
3434 /// <param name="localHandling">The local handling method of the rpc.</param>
35- /// <param name="sendImmediately">The value indicating whether the rpc should be sent immediately.</param>
36- public MethodRpc ( BasePlugin plugin , MethodInfo method , uint id , SendOption option , RpcLocalHandling localHandling , bool sendImmediately ) : base ( plugin , id )
35+ public MethodRpc ( BasePlugin plugin , MethodInfo method , uint id , SendOption option , RpcLocalHandling localHandling ) : base ( plugin , id )
3736 {
3837 Method = method ;
3938 LocalHandling = localHandling ;
4039 SendOption = option ;
41- SendImmediately = sendImmediately ;
4240
4341 var parameters = method . GetParameters ( ) ;
4442
@@ -71,6 +69,22 @@ public MethodRpc(BasePlugin plugin, MethodInfo method, uint id, SendOption optio
7169 _handle = Hook ( method , parameters , method . IsStatic ) ;
7270 }
7371
72+ /// <summary>
73+ /// Initializes a new instance of the <see cref="MethodRpc"/> class.
74+ /// </summary>
75+ /// <param name="plugin">The plugin that the rpc is attached to.</param>
76+ /// <param name="method">The method of the method rpc.</param>
77+ /// <param name="id">The id of the rpc.</param>
78+ /// <param name="option">The send option of the rpc.</param>
79+ /// <param name="localHandling">The local handling method of the rpc.</param>
80+ /// <param name="sendImmediately">The value indicating whether the rpc should be sent immediately.</param>
81+ [ Obsolete ( "Non-immediate RPCs were removed in 2025.5.20. All RPCs are immediate. Remove sendImmediately from the parameter list." ) ]
82+ public MethodRpc ( BasePlugin plugin , MethodInfo method , uint id , SendOption option , RpcLocalHandling localHandling , bool sendImmediately )
83+ : this ( plugin , method , id , option , localHandling )
84+ {
85+ SendImmediately = sendImmediately ;
86+ }
87+
7488 /// <summary>
7589 /// Gets the method of the method rpc.
7690 /// </summary>
@@ -92,7 +106,7 @@ public MethodRpc(BasePlugin plugin, MethodInfo method, uint id, SendOption optio
92106 /// Gets a value indicating whether the method rpc should be sent immediately.
93107 /// </summary>
94108 [ Obsolete ( "Non-immediate RPCs were removed in 2025.5.20. All RPCs are immediate. This property will be removed in a future version." ) ]
95- public bool SendImmediately { get ; }
109+ public bool SendImmediately { get ; } = true ;
96110
97111 /// <inheritdoc />
98112 public override void UnsafeWrite ( MessageWriter writer , object ? data )
@@ -135,7 +149,7 @@ public override void UnsafeHandle(InnerNetObject innerNetObject, object? data)
135149 /// <param name="args">The arguments to serialize and send.</param>
136150 public void Send ( InnerNetObject innerNetObject , object [ ] args )
137151 {
138- UnsafeSend ( innerNetObject , args , SendImmediately ) ;
152+ UnsafeSend ( innerNetObject , args ) ;
139153 }
140154
141155 private static readonly MethodInfo _sendMethod = AccessTools . Method ( typeof ( MethodRpc ) , nameof ( Send ) ) ;
0 commit comments