diff options
Diffstat (limited to 'src/scalevalapokalypsi/constants/constants.scala')
-rw-r--r-- | src/scalevalapokalypsi/constants/constants.scala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/scalevalapokalypsi/constants/constants.scala b/src/scalevalapokalypsi/constants/constants.scala index cb08962..970d6f7 100644 --- a/src/scalevalapokalypsi/constants/constants.scala +++ b/src/scalevalapokalypsi/constants/constants.scala @@ -9,12 +9,21 @@ val TURN_INDICATOR = ">" val SING_INDICATOR = "~" val ACTION_BLOCKING_INDICATOR='.' val ACTION_NONBLOCKING_INDICATOR='+' +val INITIAL_CONN_TIMEOUT = 5000 // millisec. +val DEFAULT_PORT: Int = 2267 +val DEFAULT_TURN_TIME_LIMIT = 30 +val DEFAULT_SERVER = "cron4.fi" val LIST_SEPARATOR=";" +val BYTE_ALLOWED = + (n: Byte) => !(n <= 31 || (n >= 127 && n <= 159)) + +val FORBIDDEN_CHARACTERS = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F" + val PROTOCOL_VERSION_GOOD = "1" val PROTOCOL_VERSION_BAD = "0" -//assert(PROTOCOL_VERSION_BAD.length <= PROTOCOL_VERSION_GOOD.length) +// assert(PROTOCOL_VERSION_BAD.length <= PROTOCOL_VERSION_GOOD.length) enum ServerProtocolState: case WaitingForVersion, WaitingForClientName, WaitingForGameStart, InGame |