Steam Avatar not replicated/loaded on client

I’m trying to implement a lobby system where when the player loads in, their Steam info is used (steam name, avatar). On the host side, it loads in both just fine. But on the client side, it only loads in the steam name, and never the avatar. I’ve tried sending the information from the game mode and game state to each player controller, but the client PCs never get the information. Does anyone have any idea why? I’ve looked at people’s posts having similar problems, but none of the solutions fix my problem.

What information are you sending to clients?
I had the following working:

  1. In Game Mode, when a client connects, get UniqueNetID from the controller;
  2. Convert UniqueNetID to String and send it to clients;
  3. On clients, convert the string back to UniqueNetID and get Steam data with it;

Maybe in blueprints only you don’t even have to convert to string, it’s just that in c++ I couldn’t really use UniqueNetID in RPC functions.

I am sending the Steam name and avatar to the client. When the client loads in, or when they have a player controller, the client is supposed to get their own Steam name and avatar and save it in their player state. When the client makes everyone’s player card (the widget), i get the game state’s player array, which is supposed to hold references to all player states, loop through them, and get the player’s info. But only the host’s name and avatar is loaded on the host’s screen, and only the host’s name is loaded on the client’s screen. The client’s info is not displayed at all.

I had a previous implementation that loaded both names on both screens (should’ve kept that one lol), but the client never displayed the avatars.

Do you replicate the the name and the avatar to the server?
I’m not sure everything in the player state replicates automatically. If you get them on the client, it doesn’t mean that it will be available to the server and/or other clients. Check if the name and the avatar are being replicated.
But then again, why would you send an image through the network, if you can send a SteamID, and every client will be able to locally retrieve names and avatars of other players?

I thought I was replicating them to the server. I will check and make sure.

That is a good point. I’m not exactly sure why I don’t do that honestly. I’ll try that.

Unsurprisingly, just sending the unique net ID to the clients and having them load it works, and is much easier than saving it all and sending it. Now, I’m running into a problem where the client doesn’t display anything. I’ll have to check everything more carefully to see why.






@Tuerer do you see anything immediately wrong here? I’m getting the unique net IDs from each player as soon as PostLogin is called, but the client never displays anything, and the host displays it 3 times for 2 players. Also, it should be a blank card with the green guy icon thingy. That is what the default is if no steam avatar can be loaded. And it gets the steam persona from the unique net ID passed in.

“SteamID” should be saved in “Player State”.“Game State” has a property named “Player Array”.You can use it to get all player states.

Here’s how I will save it. Tell me if there is a flaw somewhere. I tried before and it didn’t quite work.

GameMode::OnPostLogin() = get the new controller, cast it to LobbyPC (my custom player controller), save it to connected players array, get the unique id, get the casted controller’s player state, cast it to LobbyPlayerState (my custom player state), save the unique ID in LobbyPlayerState.

When i want to access the player states to make everyone create a player card for everyone in the lobby, should I do that in the Game Mode or Game State?

After some testing, and more testing, I finally found the solution. It was a mixture of @zblogin and @Tuerer answers, so thanks to both of them. Here is how I solved it for anyone that runs into the same problem.

  1. In Event PostLogin in the Game Mode, I cast the new player to my custom Player Controller class. I then add it to an array (Connected Players) stored on the Game Mode so I have a reference to everyone’s player controller.
  2. I loop through Connected Players and for each player controller, get my custom Game State, get the Player Array, and send that to a function (Add Player Info) on my Player Controller.
  3. In Add Player Info, I create a lobby widget if need be (the reference is not valid), or if it is valid, I clear any player cards (widget containing Steam avatar and Steam name) that may be in the lobby widget. Then for each Player State in the Player Array (sent from step 2), I use the “Get Unique Net ID From Player State” node, and with that ID, send it to another function in the lobby widget which just creates a player card using the Unique Net ID.
    Add Player Info and the function in my lobby widget that creates the player card both have the “Run on owning Client” replication option, and both are reliable. The lobby widget function may not need to be replicated/reliable.