How the server can communicate with a specific client

anonymous_user_e1600e71
Mon, 23 May 2016 09:56:46 +0000
Multiplayer & Networking

Hi everyone,

I’m quite new in Unreal Engine and I think I have some issue to understand some basic concepts, like how works network in the engine.

I have a listen server and two clients (network multiplayer) and I simply want to enable VR on one client. So my idea was to have a RepNotifyinteger to keep and share the PlayerID on which the VR is enabled.
This way, when the server will set the PlayerID, both clients will be notified. Then I will just have to compare PlayerID on remote clients to know if I have to enable VR or not.

To achieve this, on the server, I get all players using “Get All Actors Of Class”. Then I check for each of them that they are remote players using “Has Authority”. When I encounter the first remote client, I get his player state and its PlayerID and set it in my RepNotify variable and break the loop.

The issue is that “Has Authority” always return me true which is obviously not what I need.
I also tried to use the “Player Array” in the Game State but I have the exact same issue.

Am I trying to achieve this the wrong way ?

Best regards.

EDIT: I think I’ve totally miss understood how actors are spawn on networked multiplayer. Is my listen server spawning himself all clients ? Or are the clients spawning themselves their own actor ?

4 posts - 1 participant