Giving clients player info from room (Advanced sessions)

Hi, I’m still getting used to online multiplayer using blueprints in UE4 along with advanced sessions (+ steam), and despite having previous experience with online from another engine I can’t seem to figure how to get this to work; I’m attempting to allow clients to press a key, which will ping the host, grab the list of players and their info then send it back over to the client and print out this info.

If I do this in my gamemode, it does not function on the clients as the clients do not have access to the gamemode. While if I get the clients to directly ping the host’s player controller, ask for the information then send it back the game crashes (presumably there’s a loop somewhere, or it doesn’t like giving this information). The crashes are related to storing an array of all players in a player. It’s also worth noting in the project steam is 100% functional so it is not a network issue.

First method I tried (ping host, host gets all actor info, returns it to player):

Second method I tried (works perfectly as host, client cannot pick up any players [including themselves]):

For reference the actual usage I want this for is a pause menu, which when opened displays all current players within the room. The menu is fully functional right now except for feeding player information to the clients.

Thanks in advance.

I am not sure exactly what’s wrong but consider two things:

Game Mode only works for server. For clients you best pretend it doesn’t exist. To send RPCs and info to the server it is usually best to have a playercontroller tell the GameState to execute the Server RPC. Gamemmode will not help you there.Game mode belongs to the server and nobody else can access it.

Playercontrollers only exist on the server and the client machine that owns them. Other clients cannot see a client’s player controller or even the server’s playercontrollers. However, after a replication cycle or two, every client can see all Player States.

For anyone who happens to end up running into this issue in the future, storing a BPUnique Net ID array as a BPUnique Net ID array and not a string will apparently make a crash. First example should work but with net ID being a string, then you convert back from string to net ID whenever you need to.