Jump to content

About The Heartbeat Of The World


Guest blackdennis

Recommended Posts

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

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use