Save variable value when connected to a dedicated server

Hi guys,

Here’s some context :

When I start my game, the player enter in a Start_Map with a HUD displayed. The HUD allows the player to log in with his username and password, and when he presses Log_In button, an external server send a request to my postgresql database in order to check username and password, and send back an ID which identifies every single player. So, thanks to this HUD, I can retrieve the player ID in my UserID string variable. All of this id done in my HUD_Widget, displayed in my Start_Map only.

Once done, the player connects to my dedicated server using an Execute Console Command. This is defined in my Pawn blueprint, and he is teleported to the server map.

My issue here is that when I connect to my dedicated server, every variables in my Pawn blueprint are reinitialized. So the UserID string I just retrieved become empty.

So here’s my question : How can I manage to retrieve a value (my UserID string) after connecting to a dedicated server and changing a map ? I think it’s linked to the EventBeginPlay in my Pawn that triggers again when I connect to my dedicated server, and remove every value stored in my variables.

Thank you !

Hello again !

The answer is : store data in a GameSave object, and load it when needed.