From a98f089035dbcc94c14c9cd6246c3150bee84241 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sun, 17 Nov 2024 22:32:25 +0200 Subject: Improved client recovery from singing & added better logic for observations The logic should still be implemented for all observations --- src/scalevalapokalypsi/Server/Client.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/scalevalapokalypsi/Server/Client.scala') diff --git a/src/scalevalapokalypsi/Server/Client.scala b/src/scalevalapokalypsi/Server/Client.scala index ceeff1f..1af83bf 100644 --- a/src/scalevalapokalypsi/Server/Client.scala +++ b/src/scalevalapokalypsi/Server/Client.scala @@ -169,10 +169,8 @@ class Client(val socket: Socket): this.singStartTime match case Some(t) => val timePassed = currentTimeMillis()/1000 - t - this.player.flatMap(_.applySingEffect( + this.player.foreach(_.applySingEffect( 5 / max(5, timePassed) - )).foreach(s => this.player.foreach((c: Player) => - c.observe(s"Lakkaat laulamasta.\n$s") )) this.singStartTime = None case None => -- cgit v1.2.3