Run on Server / Has Authority

Aloa!

I’m working on a project involving networking and I was wondering:
When I call a custom event that is set to Run on Server, is there a need to start this custom event with a “has authority” node?
It sounds to me like it’s not needed since I only server can execute this event.

Most of my calls are heading to these custom events on server and I end up almost never using authority node although people talk about it a lot ^^

Thanks!

Hi

It depends mostly on where custom event is located and how you want it to respond. When an event set to Run on Server is called from Server, it only runs on server. When it’s called on a Client from a target that Client owns, it’s run on that Client and Server.

Has Authority node helps check whether only Server should run something, or split different results between Server and Client. It’s generally good practice to use it whenever there’s any possibility that something would otherwise run on both Client and Server and you don’t want it to.

There’s a lot of good information here:

Especially Multiplayer in Blueprints section:

Hope that helps!

“. When it’s called on a Client from a
target that Client owns, it’s run
on that Client and Server.”

is that mean,if i run a function marked as " Run on Server" on a widget that owns by client(or created on client side) then it will run 1st on client then it will be run on server,

is that right ?
if yes,then that is odd.

Like Muzaheed I though that Run on server was like calling server and telling him: “hey can you please do that with your authority?” it was semantically obvious in my head… but as long as you know that it also execute on client calling it’s fine.

That’s correct. Why is that odd?

Hi,

Having come to this page while googling to see if I was understanding networking in UE4… I’m now less sure! I refer to above, versus Replicating Functions documentation which says “Run on Server” ONLY runs on server:

There are 3 primary types of replicated functions: Multicast, Run on Server, and Run on owning Client. Multicast functions should be called on server, where they are executed, and then forwarded automatically to clients. Server functions are called by a client and then only executed on server. Client functions are called by server and then only execute on owning client.

I admit I am reading words in bold assuming they refer to “Run on Server” from first sentence.
I appreciate any clearing up of my misunderstanding!

thanks!