# (Securely) Exclude certain clients from Multicast

**URL:** <https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598>\
**Category:** Blueprint\
**Tags:** authority, unreal-engine, Blueprint, question, CPP, replicating\
**Created:** [April 21, 2019, 7:52pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598 "2019-04-21T19:52:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mastercookerYT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mastercookerYT](https://forums.unrealengine.com/u/mastercookerYT)\
**Post date:** [April 21, 2019, 7:52pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598/1 "2019-04-21T19:52:42Z")

</div>

I am looking for a way to replicate a function only to certain players. My game is team based, and somethings, such as in game chat messages should only be replicated to the player’s team, so that they can communicate without giving away information to the enemy.

I’ve found a couple of solutions to this online, however they all assume that it is in the players interest to not replicate the function if they are not the intended recipient, for example [this post](https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/60834-exclude-local-client-from-multicast), where it is not in the interest of the player to show the effects on his screen, so it is safe to ask that player kindly to not show the effects.

The problem with implementing this for me, is I cannot trust the player to make that decision for himself. So that you can understand it, an implementation of that person’s solution for me would be something like this:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/3/613f046607f0cd2963ca8d2e3ba3f2e5e4f7fb2a.png)

The problem with this is that the enemy’s computer would receive the chat message, and it would be up to them to not show it if they’re on the wrong team. This means, if the enemy uses cheats they could bypass the branch so it instanly shows the chat message, not matter what team it was meant to be sent to. They could even just monitor their network packets and sniff out the message.

* * *

What I am asking is if their is a **secure** method of replicating a function only to specific players. If it needs to be programmed in C++, I am happy to do that.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [April 21, 2019, 11:29pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598/2 "2019-04-21T23:29:33Z")

</div>

Instead of using Multicast you could use RunOnOwningClient for those that need the message. This would also save bandwidth. The server would need a list of those PlayerControllers or Characters that need the message.

---

<div class="post-metadata">

**Author:** ![mastercookerYT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mastercookerYT](https://forums.unrealengine.com/u/mastercookerYT)\
**Post date:** [April 22, 2019, 3:14pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598/3 "2019-04-22T15:14:17Z")

</div>

I’m not 100% sure how this would work, could you provide a screenshot? Where would I store the “RunOnOwningClient” function and who would execute it?

Thanks for the answer!

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [April 22, 2019, 6:02pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598/4 "2019-04-22T18:02:41Z")

</div>

You could handle it all in the PlayerController

 ![274946-messageteam.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/9/489746c5cb17023096c3391b309afb0b6b2a98ef.png)

---

<div class="post-metadata">

**Author:** ![mastercookerYT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mastercookerYT](https://forums.unrealengine.com/u/mastercookerYT)\
**Post date:** [April 22, 2019, 6:45pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598/5 "2019-04-22T18:45:12Z")

</div>

Wow, that’s exactly what I need! Thank you very much!

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [April 22, 2019, 6:49pm UTC](https://forums.unrealengine.com/t/securely-exclude-certain-clients-from-multicast/447598/6 "2019-04-22T18:49:53Z")

</div>

You’re welcome
