diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/server/ServerChannels.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/server/ServerChannels.kt index 5cc91dcd..68263760 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/server/ServerChannels.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/server/ServerChannels.kt @@ -87,10 +87,10 @@ class ServerChannels(val server: StarboundServer) : Closeable { } } - fun broadcast(packet: IPacket) { + fun broadcast(packet: IPacket, flush: Boolean = true) { connections.forEach { if (it.isReady) { - it.send(packet) + it.send(packet, flush) } } } diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt index e4a38a6d..8701f9af 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/server/StarboundServer.kt @@ -187,7 +187,7 @@ sealed class StarboundServer(val root: File) : BlockableEventLoop("Server thread init { scheduleAtFixedRate(Runnable { - channels.broadcast(UniverseTimeUpdatePacket(universeClock.time)) + channels.broadcast(UniverseTimeUpdatePacket(universeClock.time), false) }, Globals.universeServer.clockUpdatePacketInterval, Globals.universeServer.clockUpdatePacketInterval, TimeUnit.MILLISECONDS) scheduleAtFixedRate(Runnable {