Skip to content

Commit 1d78791

Browse files
committed
Added missing 0 parameter overload to boxed server rpc
1 parent 50867a7 commit 1d78791

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

MLAPI/MonoBehaviours/Core/NetworkedBehaviour.RpcOverloads.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,17 @@ public void InvokeClientRpcOnEveryoneExcept<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17331733
#endregion
17341734

17351735
#region BOXED SERVER RPC
1736+
public void InvokeServerRpc(Action method, string channel = null, SecuritySendFlags security = SecuritySendFlags.None)
1737+
{
1738+
SendServerRPCBoxed(HashMethodName(method.Method.Name), channel, security);
1739+
}
1740+
1741+
public void InvokeServerRpc(string methodName, string channel = null,
1742+
SecuritySendFlags security = SecuritySendFlags.None)
1743+
{
1744+
SendServerRPCBoxed(HashMethodName(methodName), channel, security);
1745+
}
1746+
17361747
public void InvokeServerRpc<T1>(Action<T1> method, T1 t1, string channel = null, SecuritySendFlags security = SecuritySendFlags.None)
17371748
{
17381749
SendServerRPCBoxed(HashMethodName(method.Method.Name), channel, security, t1);

MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,14 @@ private void InvokeServerRPCLocal(ulong hash, uint senderClientId, Stream stream
661661
{
662662
userStream.CopyUnreadFrom(stream);
663663
userStream.Position = 0;
664+
Debug.LogError("Sender: " + senderClientId);
665+
ExecutingRpcSender = senderClientId;
664666

665667
if (rpc.reflectionMethod != null)
666668
{
667669
ExecutingRpcSender = senderClientId;
668670
rpc.reflectionMethod.Invoke(this, userStream);
669-
ExecutingRpcSender = 0;
671+
//ExecutingRpcSender = 0;
670672
}
671673

672674
if (rpc.rpcDelegate != null)
@@ -677,11 +679,15 @@ private void InvokeServerRPCLocal(ulong hash, uint senderClientId, Stream stream
677679
}
678680
else
679681
{
682+
Debug.LogError("Sender: " + senderClientId);
683+
684+
ExecutingRpcSender = senderClientId;
685+
680686
if (rpc.reflectionMethod != null)
681687
{
682688
ExecutingRpcSender = senderClientId;
683689
rpc.reflectionMethod.Invoke(this, stream);
684-
ExecutingRpcSender = 0;
690+
//ExecutingRpcSender = 0;
685691
}
686692

687693
if (rpc.rpcDelegate != null)

0 commit comments

Comments
 (0)