aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/Server
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-14 19:52:24 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-14 19:52:24 +0200
commitea18a265a22ffc4c3f6ec3ca9d2f542552da9705 (patch)
treed1c9c832d9fdb2592227c5a05254a28d178a0efd /src/main/scala/Server
parenta43812ed462630850edbf29bda182fbf1e5e1263 (diff)
downloadscalevalapokalypsi-ea18a265a22ffc4c3f6ec3ca9d2f542552da9705.tar.gz
scalevalapokalypsi-ea18a265a22ffc4c3f6ec3ca9d2f542552da9705.zip
Added immediate turn start for client, required minor protocol tweak
Diffstat (limited to 'src/main/scala/Server')
-rw-r--r--src/main/scala/Server/Server.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/Server/Server.scala b/src/main/scala/Server/Server.scala
index a03bc53..5eb15cb 100644
--- a/src/main/scala/Server/Server.scala
+++ b/src/main/scala/Server/Server.scala
@@ -82,13 +82,17 @@ class Server(
assert(this.adventure.isDefined)
c.gameStart()
val name = c.getName
+
val entity: Option[Entity] = name match
case Some(n) => this.adventure match
case Some(a) => a.getPlayer(n)
case None => None
case None => None
entity.foreach(c.giveEntity(_))
- this.writeToClient(s"$timeLimit\r\n", c)
+
+ this.writeToClient(
+ s"$timeLimit\r\n${this.turnStartInfo(c)}", c
+ )
/** Helper function to determine if the next turn can be taken */