I have the inventory working through the components. I need to transfer all the items from the lobby to the main map. The fact is that all items are created on a dedicated server and replicated to the client. The client leaves the game separately from the server, so all objects remain on the server. I could create objects on the client before changing the map, send them to GameInstance, but I still need to add them through the server to the inventory in the game itself. The server in this case does not have access to objects, and they are not transmitted through RPC. How can I be?
You need to do it on Game Instance on server side, client should not have authority on inventory as you will make it easy to hack it
The server has its own Game Instance, right? It is not replicated to clients.
One way to do it:
Use the server GameInstance to store items between levels.
On Gamrstate Beginplay server side, retrieve the items from the game instance and set them on the game state to make them replicate.
The lobby server doesn’t go to the other map after the player, so there’s no point in keeping all the items in GameInstance. I see 2 options:
Or transfer to the GameInstance client structure with data about the subject, and then on the server to create an object with the specified parameters.
Or transfer information about the items in the game database through the server, and after entering the match - to take information from the database.
The second option is more secure.