Closed SaadBazaz closed 2 months ago
if I register 2 RPCs on 2 names like
RpcRegister("one", MethodOne); RpcRegister("two", MethodTwo);
And I try to call the first one
RpcCall("one",null ,RpcMode.ALL, () => { Debug.Log("Called RPC One"); });
MethodTwo will be called instead of MethodOne, even though I RpcCalled "one"
I think this happens because in PlayroomKit.cs
private static Action<string, string> RpcRegisterCallback = null; [DllImport("__Internal")] private extern static void RpcRegisterInternal(string name, Action<string, string> rpcRegisterCallback, string onResponseReturn = null); public static void RpcRegister(string name, Action<string, string> rpcRegisterCallback, string onResponseReturn = null) { RpcRegisterCallback = rpcRegisterCallback; RpcRegisterInternal(name, InvokeRpcRegisterCallBack, onResponseReturn); }
RpcRegisterCallback is just one Action that gets overridden whenever you register another RPC
Unknown
No response
https://discord.com/channels/997752993598419044/1128151935669764096/1231043443925450864
Closing as resolved in #60
What happened?
if I register 2 RPCs on 2 names like
And I try to call the first one
MethodTwo will be called instead of MethodOne, even though I RpcCalled "one"
I think this happens because in PlayroomKit.cs
RpcRegisterCallback is just one Action that gets overridden whenever you register another RPC
Version
Unknown
What is your environment?
No response
Link to original discussion
https://discord.com/channels/997752993598419044/1128151935669764096/1231043443925450864
Relevant log output
No response