asadm / playroom-unity

9 stars 1 forks source link

Fix: RPC event being overridden #60

Closed momintlh closed 2 months ago

momintlh commented 2 months ago

Based on #59

I have tested the scenario explained in the issue, The previous RPC registered callback gets overridden when we subscribe to a new one.

PlayroomKit.RpcRegister("ShootBullet", HandleScoreUpdate, "You shot a bullet!");
PlayroomKit.RpcRegister("Hello", Hello, "You said Hello!");

And I only call the first one:

   PlayroomKit.RpcCall("ShootBullet", score, () =>
  {
      Debug.Log("shooting bullet!");
  });

This should only Invoke HandleScoreUpdate(), but that gets overridden by Hello.

Currently the issue how to filter the correct Rpc Event Names to invoke only the callback associated with the name.