Is it possible to create an RPC function which is only available inside a match?

I’m using TS for my Server Authoritative Game and Unity as my client side engine. in that game i need to send a info instantly or wait for that info to receive and proceed further. It seems like RPC will work for this. I have checked the Documentation and I’m unable to find such RPC whose lifetime is only inside the Match(Coz need the match ID and Some other info).

I have tried with matchState events. but it sometimes receiving a little bit late for me. So i’m unable to use that.

So here is my problem statement

I need a reponse from the server with some data as a return value like RPC. but it should available only inside that match only (will send the current match ID and State).

Kindly help me on this!

@ragavendranbala Sorry I don’t really follow what you need. You can use the match handler dispatcher to send netcode messages to presences who’re connected to the match. Why would you need to use a socket RPC function? What do you mean by “I have tried with matchState events. but it sometimes receiving a little bit late for me.”?

Since you said the matchstate isn’t handled fast enough, have you thought about increasing the tickrate for the match loop?

Hi @novabyte Sorry for the delay. basically using broadcastMessage needs to subscribe to the match state to receive. and If there is an network problem on the client side, it might delay in receiving the state.

But on RPC… We will call the method on the server. and the function will till the message return from the RPC function. Even there’s is network delay the function will wait for the RPC function.

On Broadcastmessage, it’s independent of waiting for the value to receive.

Hi @MWFIAE , Match loop is good. I’m on slow data on client side. so the event is receiving slowly. But on RPC no matter what the network speed is, it’ll wait till i get the response from the server.

Sorry @ragavendranbala I have no idea what you’re trying to achieve. I don’t think I can help.

1 Like