How to execute an event on the server from the client?

I have been reading this https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Replication/RPCs/index.html and notice that in the multicast section it says “If they are called from clients, they will only execute locally, and will not execute on the server”. I there anyway to execute a custom event with multicast relpication called from a client on the server?

This is not supported directly, but you may be able to achieve a similar result with two replicated events that work together:

  1. A multicast event that performs the logic to be done on the server and the clients.
  2. A “Run on Server” event, that simply calls the multicast event from #1.

Now you should be able to call event #2 from any client, and when the server receives it, it will multicast event #1 back to all the clients.

I have a question about that. Okay, So I ran an event on the server and the server has a Switch has authority that if so will toggle a replicated variable and set it to true, then it calls to a multicast event. In this multicast event if the previous replicated variable is true, it will fire on each client. It works, but my question is, Am I doing it right? Am I suppose to call a event on the server and the multicast it from the server to everyone else? It seems like that is the solution because it works, but I dont want to slow down my game because I did something inccorect…

I don’t think you really have any other alternatives if you are a client and you want to tell other clients something.