From 4de67b497e0e229fe4a42f66f833640b6e50fd5a Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sun, 17 Nov 2024 13:45:44 +0200 Subject: Moved the project to an IDEA project & wrote part of README.txt --- src/scalevalapokalypsi/constants/constants.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/scalevalapokalypsi/constants/constants.scala (limited to 'src/scalevalapokalypsi/constants/constants.scala') diff --git a/src/scalevalapokalypsi/constants/constants.scala b/src/scalevalapokalypsi/constants/constants.scala new file mode 100644 index 0000000..d5abb43 --- /dev/null +++ b/src/scalevalapokalypsi/constants/constants.scala @@ -0,0 +1,19 @@ + +package scalevalapokalypsi.constants + +val MAX_MSG_SIZE = 1024 // bytes +val CRLF: Vector[Byte] = Vector(13.toByte, 10.toByte) +val POLL_INTERVAL = 100 // millisec. +val GAME_VERSION = "0.1.0" +val TURN_INDICATOR = ">" +val ACTION_BLOCKING_INDICATOR='.' +val ACTION_NONBLOCKING_INDICATOR='+' + +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 -- cgit v1.2.3