aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Server/Client.scala
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-17 22:32:25 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-17 22:32:25 +0200
commita98f089035dbcc94c14c9cd6246c3150bee84241 (patch)
tree228ffa0d5e4a3e86c454cd297644c97abc994ef3 /src/scalevalapokalypsi/Server/Client.scala
parentc954ca4d1ec677a34a6d787a23f9d01396f7e585 (diff)
downloadscalevalapokalypsi-a98f089035dbcc94c14c9cd6246c3150bee84241.tar.gz
scalevalapokalypsi-a98f089035dbcc94c14c9cd6246c3150bee84241.zip
Improved client recovery from singing & added better logic for observations
The logic should still be implemented for all observations
Diffstat (limited to 'src/scalevalapokalypsi/Server/Client.scala')
-rw-r--r--src/scalevalapokalypsi/Server/Client.scala4
1 files changed, 1 insertions, 3 deletions
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 =>