Replication through game sessions

I’ve been trying to set up game sessions in my project. After days of trying to get clients to be able to join a session and travel to the appropriate level, I realized that there’s a lot of code I’ve written that may have to be changed related to replication.

So I have a few questions.

So lets say you have Client A, who creates a game session. He is the Host, so would this make him the Authority?

IF it does make Client A the Authority:

Lets say you have Client B who joins the game session for Client A. When calling events that are ‘Run on Server’, do they get called on the actual server? Or do they get called on Client A ( The Host )?

Can Client A call Multicast Events that run on all clients that have joined it’s session?

Also, would the Game Mode exist on Client A? Or would that still be on the server?

EDIT:
To add to it, when I package the game and run 2 copies of the executable, I can host a game session on one client and the other client will find it and be able to join. Also I’m calling GetWorld()->ServerTravel() on the client that is hosting the game session, and it unexpectedly works.
This happens with no dedicated server running, so does a game session create a separate dedicated server in the background? Or (again) does that client get treated as a server? I’m thinking that client will be treated as a dedicated server since the host is the only character that doesn’t function when the map loads.

When using a listening server, the host becomes the server. So yes, whenever you think “server”, you can substitute that with “client A”.

As for the question of who has Authority, I’ve recently learned that you there is no such thing as a general role. Rather, each object has its own role and who has authority over it depends on who spawned it. In practice that means that all objects that need to be replicated and thus are spawned on the server (client A) will have Authority if the code is currently executing on the server.

Since Client A would be the server, how would I go about sending information to the actual server? Could I spawn a listening client on the server?

I’m also guessing that means game mode exists on ‘Client A’.

My end goal here is to have the server be the ‘Host’ of every game that’s played, to prevent anyone from having the host advantage.

When testing in the editor, you can adjust the Play settings to use a dedicated server. Both client A and client B will then be treated the same. No idea how to construct an actual server, though.

You can force your events to be executed only on the server (or only client-side) by flagging the event with the corresponding UFUNCTION property (in C++) or by ticking the corresponding box in the event properties (Blueprint). Note that this only works for events, so these methods can’t have any return values.