The way I read that function is that it is not so simple:
Each zone will have a timer for each mob (presumably a 4 byte integer that is checked every tick). Updating those timers is complicated by the fact that they may be in different processes running on different computers. Also, mobs that matter will be in the database so that their repop timers will persist through reboots and zone crashes and such.
Fortunately, that code appears to do exactly what is necessary: first it updates the SQL database, then it modifies any local zone timers, and then it sends update messages over the network to tell the other zone servers to update the spawn timers if necessary. Granted, I could be wrong about all this - it's never easy to jump into a decently sized piece of code and figure out what's going on.
|