diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/scala/Client/Client.scala | 2 | ||||
-rw-r--r-- | src/main/scala/Server/Server.scala | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main/scala/Client/Client.scala b/src/main/scala/Client/Client.scala index 26b9264..1c5d1b4 100644 --- a/src/main/scala/Client/Client.scala +++ b/src/main/scala/Client/Client.scala @@ -112,7 +112,7 @@ class Client(socket: Socket): s"\n\n${this.turnInfo}\n${this.actionGetterIndicator}" private def displayAction(action: String): Unit = - println(s"> $action") + println(s"$action") if this.canAct then print(this.actionGetterIndicator) diff --git a/src/main/scala/Server/Server.scala b/src/main/scala/Server/Server.scala index ac0e010..230fe59 100644 --- a/src/main/scala/Server/Server.scala +++ b/src/main/scala/Server/Server.scala @@ -95,12 +95,15 @@ class Server( s"$timeLimit\r\n${this.turnStartInfo(c)}", c ) + this.clients.foreach(c => + if c.player != playerEntity then + c.player.foreach(_.observe(s"${name.getOrElse("Unknown player")} joins the game.")) + ) + private def writeObservations(): Unit = this.clients.foreach(c => val observations = c.player.map(_.readAndClearObservations()) -// if observations.filter(_.length > 0).isDefined then -// println(s"Observations of $c: ```$observations```") observations.foreach(_.foreach((s: String) => this.writeToClient(s"$s\r\n", c))) ) |