breaking(SyncDictionary): Make data available to callback handler
- OP_CLEAR will be called before the internal data is cleared, so users can iterate the items in the handler
- OP_SET will give the old value in the
itemparam instead of the new value. New value is already set in the dictionary. - OP_REMOVE will no longer send the value, just the key, because that's all we need.
BREAKING CHANGE: SyncDictionary - Make data available to callback handler
generally good to clear up the orders and confusion.
if we do this, might as well do it properly with:
- .OnClear()
- .OnSet()
- etc.
this time? then old UNET API was always a little bit strange. would also be an obvious breaking change, instead of a silent breaking change
What if we had a new type of SyncDictionary? Like AdvancedSyncDictionary or something?
Avoid breaking existing projects, and give people something to use with cleaner functionality.
One thing I found while poking around the SyncDictionary code was that OP_ADD and OP_SET seemed redundant. Maybe just OP_CLEAR, OP_SET, and OP_REMOVE? Events could include OnClear, OnSet, and OnRemove.
I could draft up a PR if you're interested or have better things to do.
Closing - work was merged in a series of PR's.