asadm / playroom-unity

9 stars 1 forks source link

RPC API #37

Closed asadm closed 4 months ago

asadm commented 5 months ago

Integrate the RPC register and call API and the 3 modes.

We also need to cater response thingy. Use callback for response handler instead of promise.

SaadBazaz commented 4 months ago

Feature complete in #43 🎉

Features:

•⁠ ⁠⁠Integrated RPC APIs and three modes in Unity. •⁠ ⁠Implemented RPCRegister, RPCCall, and response handling through callbacks. •⁠ ⁠Final changes include code cleanup, signature updates, and handling multiple callbacks.

Stability test:

•⁠ ⁠While building the feature, we built a demo to showcase how the RPC is working with different modes. In this example, we synced the Score / UI update with RPC, while the rest of the player movements etcetera are handled with Playroom Multiplayer States •⁠ ⁠Here’s a link to the demo, for showcasing updated features like bullets and per-player scores: https://mmntlh.itch.io/playroom-demo •⁠ ⁠⁠The code for the demo is in the repository itself: https://github.com/asadm/playroom-unity/blob/main/Assets/Scripts/GameManager.cs •⁠ ⁠⁠After merging with ⁠ main ⁠, we’ve run some manual QA by doing some regression testing and integration tests. Things are reporting to be working well so far.

Slight difference between Unity and JS API:

RPC.call -> RpcCall (RPC is not a class, rather, there is just a function called RpcCall for now)