mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Corrected tick timing
This commit is contained in:
parent
187f7f087d
commit
9e212d39c4
2 changed files with 9 additions and 1 deletions
|
|
@ -101,6 +101,7 @@ object Server {
|
|||
delay(20000)
|
||||
while(running){
|
||||
if(System.currentTimeMillis() - lastHeartbeat > 1800){
|
||||
SystemLogger.logErr("Triggering reboot due to heartbeat timeout")
|
||||
running = false
|
||||
exitProcess(0)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,11 +10,14 @@ import kotlinx.coroutines.delay
|
|||
import kotlinx.coroutines.launch
|
||||
import rs09.Server
|
||||
import rs09.ServerConstants
|
||||
import rs09.game.system.SystemLogger
|
||||
import rs09.game.world.GameWorld
|
||||
import rs09.game.world.repository.Repository
|
||||
import rs09.game.world.update.UpdateSequence
|
||||
import rs09.net.packet.PacketWriteQueue
|
||||
import rs09.tools.stringtools.colorize
|
||||
import java.lang.Long.max
|
||||
import java.lang.Long.min
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
|
@ -29,8 +32,9 @@ class MajorUpdateWorker {
|
|||
val sdf = SimpleDateFormat("HHmm")
|
||||
fun start() = GlobalScope.launch {
|
||||
started = true
|
||||
delay(600L)
|
||||
while(true){
|
||||
delay(600L)
|
||||
val start = System.currentTimeMillis()
|
||||
val rmlist = ArrayList<Pulse>()
|
||||
val list = ArrayList(GameWorld.Pulser.TASKS)
|
||||
|
||||
|
|
@ -75,6 +79,9 @@ class MajorUpdateWorker {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
val end = System.currentTimeMillis()
|
||||
delay(max(600 - (end - start), 0))
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue