From 302455bac062080bf197b44e07ed53a3454be4c5 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Wed, 27 Nov 2024 17:19:46 +0200 Subject: Finishing almost the adventure --- src/scalevalapokalypsi/Server/Client.scala | 5 +++-- src/scalevalapokalypsi/Server/Server.scala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/scalevalapokalypsi/Server') diff --git a/src/scalevalapokalypsi/Server/Client.scala b/src/scalevalapokalypsi/Server/Client.scala index 940888b..becca32 100644 --- a/src/scalevalapokalypsi/Server/Client.scala +++ b/src/scalevalapokalypsi/Server/Client.scala @@ -204,7 +204,7 @@ class Client(val socket: Socket): if this.verseIndex == this.versesToSing.length then val timeQuality = 5.0*this.versesToSing.length / - max(5.0, currentTimeMillis()/1000 - t) + max(5, currentTimeMillis()/1000 - t).toDouble val songToSing = this.versesToSing.mkString("") .toLowerCase @@ -217,8 +217,9 @@ class Client(val socket: Socket): ) this.player.foreach(_.applySingEffect(quality.toFloat)) - + this.singStartTime = None + else this.versesSung += line this.startVerse() diff --git a/src/scalevalapokalypsi/Server/Server.scala b/src/scalevalapokalypsi/Server/Server.scala index 6bf21d4..d0bb402 100644 --- a/src/scalevalapokalypsi/Server/Server.scala +++ b/src/scalevalapokalypsi/Server/Server.scala @@ -102,7 +102,7 @@ class Server( val joinEvent = c.player.map(p => Event( Map.from(Vector((p, ""))), - s"${p.name} joins the game." + s"${p.name} liittyy peliin." )) joinEvent.foreach(ev => this.clients.foreach(cl => if cl != c then -- cgit v1.2.3