http://www.cplusplus.com/forum/beginner/30983/
Now that I know this, and the reason this is in the Rules forum, is because one of my TODO's is to enhance the rules system by allowing configurable timers without forcing a recompile. I learned that all of these default values would function just the same if they were down in the body of the constructor, too... and apparently, this is just a matter of preference (LE's original design).
If I wanted a regenTimer to actually be 3000, I'd have to change the value and recompile the code.
My idea is to make this a Rule, and call it from within the constructor (or actually a function call from the constructor to "Init()" or something safe), and set these timers based on our Rules System.
I am posting this question to see if our devs see anything wrong with this concept, or if I am missing something. This comes about because I was designing how to add a timer for Zone Weather, a TODO in 0.7.3 coming up next year. While I am here, maybe it would be a good time to Rule-ify these Zone and World timers?
Example:
Remove regenTimer(6000) from ZoneServer() : regenTimer(6000) and put it into the constructor like this:
Code: Select all
regenTimer.Start(rule_manager.GetGlobalRule(R_Zone, RegenTimer)->GetInt32());What do you think?