aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/Server/constants.scala
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-09 16:32:09 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-09 16:32:09 +0200
commit129b49a3876ceb68f271c311d5e45efb2e205300 (patch)
tree246a47a5990167c73b95fc6e02452de7f6aca6b3 /src/main/scala/Server/constants.scala
parent239571e3408a3187953bef1dd5d516461bad0e31 (diff)
downloadscalevalapokalypsi-129b49a3876ceb68f271c311d5e45efb2e205300.tar.gz
scalevalapokalypsi-129b49a3876ceb68f271c311d5e45efb2e205300.zip
Made & implemented clearer protocol, added client functionality
Diffstat (limited to 'src/main/scala/Server/constants.scala')
-rw-r--r--src/main/scala/Server/constants.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/scala/Server/constants.scala b/src/main/scala/Server/constants.scala
index ddaab00..a9e4502 100644
--- a/src/main/scala/Server/constants.scala
+++ b/src/main/scala/Server/constants.scala
@@ -2,12 +2,16 @@
package o1game.constants
val MAX_MSG_SIZE = 1024 // bytes
-val LF: Byte = 10
+val CRLF: Vector[Byte] = Vector(13.toByte, 10.toByte)
val POLL_INTERVAL = 100 // millisec.
val GAME_VERSION = "0.1.0"
+val TURN_INDICATOR = ">"
-val PROTOCOL_VERSION_GOOD = "version ok"
-val PROTOCOL_VERSION_BAD = "version bad"
+val LIST_SEPARATOR=";"
+
+val PROTOCOL_VERSION_GOOD = "1"
+val PROTOCOL_VERSION_BAD = "0"
+//assert(PROTOCOL_VERSION_BAD.length <= PROTOCOL_VERSION_GOOD.length)
enum ServerProtocolState:
case WaitingForVersion, WaitingForClientName, WaitingForGameStart, InGame