Why does the server create a scoreboard entry twice?

Hey I’m setting up a scoreboard, but the server/host appears twice and only on the host, clients show correct number of entries, is anyone able to tell me why?

Server on the left shows one too many of itself. Client on right

How I do it:

  1. On begin play, the player controller “checks in” with the game mode to share its PlayerInfo

  2. In the game mode all the players info is stored in an array and each player should create entries in their scoreboard based on how many players there are in the game.

  3. Each controller calls its hud and executes the task

  4. Inside the widget it reads the player info array and creates all the entries

For some reason it looks like the server creates an entry once in the beginning, while there is 1 entry in the Player Info Array, then it creates two more entries later, one with the client and one with itself again.
1

Anyone know whats going on and how to fix it?

Appreciate any help :slight_smile:

Hmm, I would understand if the client registered twice…
Anyway, what if you use AddUnique instead of Add when you add Player Controller to the array?

Thanks for the reply, unfortunately it didnt do anything.

Its weird, the server widget appears firs tand says it created an entry in the log even before the player controller has had the time to check in :face_with_monocle:

What if you try doing this not on BeginPlay(), but on PostLogin() in the game mode? When a controller connects, the Game Mode reacts to it and requests the necessary data from the Controller.

1 Like

If I prevent the widget from creating entries that already exist it solves the problem, but Im not sure that is the best way of doing it. Because why does the server do it twice in the first place?


I just check the map which looks up entries for players and their unique string. If there are duplicates it doesnt create more

Hmm I tried removing the Check In Player event from begin play in the controller and move it to the game mode on OnPostLogin like you said

Unfortunately it breaks the scorebaord completely. Only the client creates one entry for itself, the server scoreboard is empty

image

looks like the server doesnt check in at all