# SendMatchState vs RPC for client to server messages in authoritative multiplayer

**URL:** <https://forum.heroiclabs.com/t/sendmatchstate-vs-rpc-for-client-to-server-messages-in-authoritative-multiplayer/2673>\
**Category:** Runtime Framework\
**Created:** [May 27, 2022, 1:47pm UTC](https://forum.heroiclabs.com/t/sendmatchstate-vs-rpc-for-client-to-server-messages-in-authoritative-multiplayer/2673 "2022-05-27T13:47:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umut](https://avatars.discourse-cdn.com/v4/letter/u/54ee81/32.png) [@Umut](https://forum.heroiclabs.com/u/Umut)\
**Post date:** [May 27, 2022, 1:47pm UTC](https://forum.heroiclabs.com/t/sendmatchstate-vs-rpc-for-client-to-server-messages-in-authoritative-multiplayer/2673/1 "2022-05-27T13:47:50Z")

</div>

Hello,  
I am new to Nakama and currently designing a server authoritative clash royale-like game.  
Should I send played cards via match state messages (which is used by relayed multiplayer) or RPC functions?

Can we prevent match state messages to be automatically relayed to other clients? Can we restrict particular op codes to be sent by servers or clients? Or should clients send all messages(which we don’t want to be relayed) to the server through RPCs in an authoritative match?  
I also want to broadcast match state messages in the match loop of the server, can we make sure clients can’t send those op codes as well? (through hacking or network spoofing for example) I want them to be completely ignored by the server instead of being relayed.

What do you think about this workflow? Is this a good approach?  
The client sends played card info to the server through RPC \> Server processes it in the match loop ticks \> The server broadcasts match state messages(positions, health stats etc.) to both clients to keep them updated. (those messages should be restricted to server-only)

---

<div class="post-metadata">

**Author:** ![amuuu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/amuuu/32/1048_2.png) [@amuuu](https://forum.heroiclabs.com/u/amuuu)\
**Post date:** [May 30, 2022, 10:21am UTC](https://forum.heroiclabs.com/t/sendmatchstate-vs-rpc-for-client-to-server-messages-in-authoritative-multiplayer/2673/2 "2022-05-30T10:21:06Z")

</div>

Hello,

If you use the authoritative match handler feature of Nakama, the match state messages sent by each client are received in the `match_loop` function and won’t be automatically relayed to other clients. Unless you explicitly write the code in `match_loop` to relay them.

You can have the `match_loop` ignore the opcodes that are not allowed. You can also have the runtime match handler send match state messages that it generates by itself or just have it relay the messages it receives.
