Hi gurus,
I am new to this place and I'm reading the MaNGOS code. I have some questions about the run() method of the
WorldRunnable class. I got confused by the comments:
// diff (D0) include time of previous sleep (d0) + tick time (t0)
// we want that next d1 + t1 == WORLD_SLEEP_CONST
// we can't know next t1 and then can use (t0 + d1) == WORLD_SLEEP_CONST requirement
// d1 = WORLD_SLEEP_CONST - t0 = WORLD_SLEEP_CONST - (D0 - d0) = WORLD_SLEEP_CONST + d0 - D0
Does the tick time mean the time spent in sWorld.Update(diff) method?
It it is, the algorithm seems to use the previous tick time to pridicate the next tick time, why not using the current
tick time to pridicate the next tick time? That is use t = getMSTime() - realCurrTime after sWorld.Update(diff). Is it
because of the overhead calling getMSTime()?
Thanks