Networking Event Question
I have a load from save event that executes on server. This loads all the players stats and inventory items. I have an issue where if I run the game with two clients, the load from save will work perfectly for the first player but not any players after that. When the second player "logs in" and loads from their save, the server tries to run the loading of the inventory for the first client that connected. I have to have the events that deal with inventory items run on the server to avoid cheating but in this one case I cannot figure out how to ensure the event sequence makes the loading from save happen ONLY for the client that is logging in.
Right now the user presses "log in" which calls a server event to load a save slot based on their credentials. It is loading the stats, player location, etc correctly but the inventory part (which is in the same event) is not working correctly. For example when the second client logs in from a save they cannot pick anything up because the server thinks the inventory is full even though it is showing up as blank in the UI. If I kill that second client and respawn them with a blank inventory, the server no longer thinks that and allows the player to pick up items.
Please send me some ideas on my work flow.
I swear to god whenever I take the time to write out my issues on here it gives me better ideas of what to look for. I found my issue. On my saving and loading event i was casting to player controller, and using "Get Player Controller- 0" when I should have been using "Get Controller- Self". That made all the difference. Problems solved.
answered Feb 08 '19 at 10:34 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here