Hello, so I've been trying to come up with an idea to store data in a multiplayer/networked enviorment, for example ammo count, health, ect. I want to avoid storing sensitive data like that locally as anyone with cheat engine could just change the values and be able to give themselves an unfair advantage. My first taught was to store a players data in the player state, as suggested by various posts and documentaions, however I had trouble getting a working reference to player state associated with any particular character from within the character blueprint. To get around this I used the post login event in the game mode which gives me a controller reference for the connected player, I can then get the pawn reference and player state and directly set a variable in the pawn to the player state, this works perfectly, and since the server never connects but will be playing as the host I just do get player controller in the game mode with index 0 and do the same thing with that controller.
What I would like to know is, is there a better way of doing all of this or is this fine? If anyone has done anything similar then please let me know how you did it, thanks.
What I would like to know is, is there a better way of doing all of this or is this fine? If anyone has done anything similar then please let me know how you did it, thanks.
Comment