Don't flush when writing universe time packet

This commit is contained in:
DBotThePony 2024-04-18 14:52:05 +07:00
parent 32b8c4e6d5
commit 46900554c3
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 3 additions and 3 deletions

View File

@ -87,10 +87,10 @@ class ServerChannels(val server: StarboundServer) : Closeable {
} }
} }
fun broadcast(packet: IPacket) { fun broadcast(packet: IPacket, flush: Boolean = true) {
connections.forEach { connections.forEach {
if (it.isReady) { if (it.isReady) {
it.send(packet) it.send(packet, flush)
} }
} }
} }

View File

@ -187,7 +187,7 @@ sealed class StarboundServer(val root: File) : BlockableEventLoop("Server thread
init { init {
scheduleAtFixedRate(Runnable { scheduleAtFixedRate(Runnable {
channels.broadcast(UniverseTimeUpdatePacket(universeClock.time)) channels.broadcast(UniverseTimeUpdatePacket(universeClock.time), false)
}, Globals.universeServer.clockUpdatePacketInterval, Globals.universeServer.clockUpdatePacketInterval, TimeUnit.MILLISECONDS) }, Globals.universeServer.clockUpdatePacketInterval, Globals.universeServer.clockUpdatePacketInterval, TimeUnit.MILLISECONDS)
scheduleAtFixedRate(Runnable { scheduleAtFixedRate(Runnable {