Open macb opened 6 years ago
I think this is really interesting and important to hash out. I am wondering what the best solution would be under the covers, and I think I have come up with something of a solution, both long term and short term.
For the short term, you could potentially save a JavaScript object of container serials where you put their contents, or at the very lease, a flag or timestamp. If the object does not contain that container, then you know you haven't requested it before. You could also use the timestamp to know if you should refresh the contents based on some predefined value. This does not help with doing waits however, which I think is one of the most important and time consuming parts. a waitForContents(container_serial)
function would be great for this sort of thing.
The long term solution is to hash out what we as a community think the value of no contents ought to be, whether that's throwing an error, returning null, or some other value. I think that error handling is a bit much for the community, and, instead I would suggest null if we are not privy to the contents. I am afraid though that, if the contents of containers is kept in memory, that could turn into a memory leak problem. So, not only would we need to figure out a return value, we would also need to discuss how long to keep the contents in memory. The server sends a packet, either the add item to container or add multiple items to container packet, and it contains either an item or a list of items. The client would have to capture this information and store it for as long as it is necessary. Maybe it ought to be a fifo queue that keeps a certain number that has options for the player to change the total saved?
Information we need from you if you want to have something fixed:
On UOForever.
In order to determine if a container is closed or not I issue a
Orion.FindType
.I expect
Orion.FindType
to return an empty array or undefined/null results if the container isn't open. However, in some casesOrion.FindType
seems to be returning some results. ~When I then go to move items from the container to another destination, I fail to actually move anything (likely the server thinks I don't have the container open).~ When I later search for objects of a specific type in the "closed" container, I receive 0 results.To resolve this I can move many steps away from the container, manually open it, or close my UO client and re-open. It seems randomly triggered (can macro for hours without hitting it or hit it immediately).
Maybe related I've also noticed that Orion will leave open containers after I move > 2 units away from them. If I try to interact with an object in the container I get a "you are too far away" type message. I'd expect the UI to have closed the container once I moved out of range.
The function looks like:
Not sure how helpful the uolog is here. I truncated 1mb worth of lines where it was looping trying to move the expected items forever. uolog.txt