We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc014a6 commit 1dac317Copy full SHA for 1dac317
server/src/main/kotlin/Server.kt
@@ -89,18 +89,20 @@ private fun KtorRoute.websocketHandler() {
89
val kill = Kill(Clock.System.now(), name, ipHash)
90
val timeSinceLastKill = Clock.System.now() - (lastKill ?: Instant.DISTANT_PAST)
91
if (timeSinceLastKill >= 10.seconds) {
92
+ lastKill = Clock.System.now()
93
writeStats(
94
stats.copy(
95
stats.kills + kill,
96
count = stats.count + 1
97
)
98
99
+
100
+ sessions.forEach {
101
+ it.send(UpdateKillCounterEvent(stats.count, kill))
102
+ }
103
} else {
104
LOG.debug { "Ignoring kill, last kill was $timeSinceLastKill ago" }
105
}
- sessions.forEach {
- it.send(UpdateKillCounterEvent(stats.count, kill))
- }
106
107
108
0 commit comments