aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/Client
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-15 16:45:09 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-15 16:45:09 +0200
commiteeb83ca379e7f4ab1a86596b80e206df48371454 (patch)
tree0f595308b7ba9077650e8a368b94ba75c5683c71 /src/main/scala/Client
parentea18a265a22ffc4c3f6ec3ca9d2f542552da9705 (diff)
downloadscalevalapokalypsi-eeb83ca379e7f4ab1a86596b80e206df48371454.tar.gz
scalevalapokalypsi-eeb83ca379e7f4ab1a86596b80e206df48371454.zip
Added observations for Players in model & implemented sending them to other clients
Diffstat (limited to 'src/main/scala/Client')
-rw-r--r--src/main/scala/Client/Client.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/Client/Client.scala b/src/main/scala/Client/Client.scala
index 7b0f8b2..26b9264 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(action)
+ println(s"> $action")
if this.canAct then
print(this.actionGetterIndicator)
@@ -149,7 +149,7 @@ class Client(socket: Socket):
this.lastTurnStart = currentTimeMillis / 1000
case ServerLineState.ActionDescription =>
- if line.head == ACTION_BLOCKING_INDICATOR then
+ if !line.isEmpty && line.head == ACTION_BLOCKING_INDICATOR then
this.canAct = false
this.displayAction(line.tail)