Hi there,
This question is really asking for advice about how best structurally to tackle a problem we are having with RepNotify.
We have lots of Characters in the world. Each character has a CharacterSheet, which contains most importantly an integer array of stats, e.g. Agility, Strength, Armour, Health. The stat array is indexed by a StatType enum.
The Character Sheet has a function on it called SetStat(StatType stat, int32 newValue).
We currently have the Stat int array set to RepNotify and the OnRep_Stats function calls an EventDispatcher called OnStatChanged which notifies the UI binds to so that it can update when a stat has changed.
This was working fine, however now we need more information. When the stat changes, I need the OnStatChanged Event to know what stat has changed, what the old value was and what the new value is. i.e. OnStatChanged( StatType Stat, int32 OldValue, int32 New Value). However, RepNotify only tells clients when a stat has changed, and doesn’t know have this information.
Is there a nice way to do this? We have ideas, but none of them seem great. Any advice would be much appreciated.
Thanks,
- Rich