Add item to Ownerless crate inventory

I am trying to add an item to an ownerless storage box. So technically I guess it is owned by the server. I have struggled with having the RPC going all over the place but I always just get the “No owner Connection”

On the client widget that is created after interacting with the Box,

Simple enough.

I have a reference of the interacted Box on my player controller. That I then call to have an item added.

On the box BP, I have this event that adds to the actual inventory component on the box. The BPC does all it’s various inventory check stuff.

As far as I know, this should work. But it Clearly does not work since I get the “No owner Connection” warning. I am at my wits end about this.

I have seen a bit of text about this issue. But I guess I am to frustrated and inexperianced to fully comprehend how it should be without any visual aids.

You have the right idea, I think there are some implementation details that are off. Once on the server, there’s no need for your “AddToInventory” function to be replicated, so change that. Same thing with “SRAddItem”. Neither should need to be set to replicated at this stage.

But it should not prevent if from working at all should it?
Since it is not working at all. It seams to only be running on Client even with all set to run on server or when implementing your suggestion.

Everything of any relevancy to the client and box interaction is set to be replicated.

i could be wrong here but try doing all your RPCs on the player controller or pawn itself,

ie dont call it from the widget, call a normal event (client) that then calls the server RPC from the controller itself.

While I do appreciate the help you two are coming with. The solutions did not work. No matter what replication mode I set on those events the that event chain, the item has not ben able to reach the box inventory on the server. There must be something else that is going on.

Does work for the host of the listen server but that does not really help much.

The issue was just me being stupid.

I sat the Storage Box reference on the PC through a OnClient event.

I know that it is better to basically threat Server and Client like separate objects and I know why setting a variable on the client does not translate to the server knowing about it. I don’t know why I did not realize this issue before spending a week trying to fix the issue in more obscure ways.

Just added a new RPC setting the storage box reference on the Controller on the Server side.