Can’t be done. It has to actually be server-sided. Otherwise people will manipulate (for example with cheat engine) the data and tell the server that they now have a 4LP red ring.
When playing in an MP setting, all these operations have to be confirmed server side, always. It was actually the reason why we had a bug exploit in Season 1 and why direct trade was removed.
Not only that, every single change to the stash is saved immediately to the DB. Same as any character changes, including just getting XP.
Having to save the whole object every single time a small part of it changes would be extremely inneficient.
You can say that a number column is saved as text if you don’t plan on querying it directly, but you do need to discriminate properties so you can make partial updates and not have to update the whole thing all the time.
I’m talking about the searches when you search for something in your stash, that can be locally, nothing changes when you do a regex search. Sending the whole item descriptor when moving around stuff in stash would be quite vulnarable, so you just send the id of the items and the coordinates. Document based schemaless databases support partial updates, so you don’t have to write the whole stuff every time some minor property changes. You can use JSON patch on your API, don’t even have to reinvent the wheel for this.
You’re right about dupes, most duping methods revole around crashing server side before it saves that an item was moved to player1 to player2 so the item stays in player1’s inventory while it’s already saved in player2’s inventory. But it has nothing to do regex searches on your own stash locally.
Anyways, the thread is already derailed, I don’t intend to push it more into the jungle. Bottom line is, 1m favor limit is a design decision, not a technical limitation and if you reach the cap then you can’t spend that much favor anyways, so it shouldn’t bother you.
If it’s solely related to searching and highlighting then it can be client-side. Hence the server providing the information of position and composition to the client but any interaction directly is going through the safeguard of the server. Searches can forego that though as it’s only about visualization, not about changing.
Oh yeah, that can be done locally, since it’s only a function to highlight stuff.
And yes, the thread has been derailed enough. Like you said, 1M is a design choice. Most likely, they saw what happened with gold and decided to keep favour limited to “sane” numbers, meaning “more than enough for everything currently in the game”.