How to send message to a target by broadcastMessage

Hi. in relayed matches players can send targeted messages to others. how do this in authoritative match?

dispatcher.broadcastMessage(message.opCode, Targets, message.sender, true);

what is the best practice to determinate sender targets?

Hello @mrbug,

There’s a few examples of how to use broadcastMessage in our project-template.

If you set the value to null then the message is broadcast to all the players connected to the match.

If you need to target specific subsets of players that will depend on your message handling server logic.

Best.

ty for respond!
in template there is no targeted broadcast! and i don’t know how to get the targets list when using
SendMatchStateAsync function in unity c# code.
how relayed match code works on server?

In some places in the template it’s omitted, which effectively defaults to nil (broadcast to all).

In an authoritative multiplayer game you send some data to the server based on the protocol you’ve defined, and it’s up to the match loop implementation to target specific player or broadcast to all depending match state and received message.