From ae82027a9bd4e75582f9499d4006b18c29a4129c Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Mon, 4 Nov 2024 21:38:50 +0200 Subject: Added basic TCP networking for the server. The client's networking is still very experimental and the actual protocol is not yet specified for either side. --- src/main/scala/main.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/scala/main.scala (limited to 'src/main/scala/main.scala') diff --git a/src/main/scala/main.scala b/src/main/scala/main.scala new file mode 100644 index 0000000..18172e2 --- /dev/null +++ b/src/main/scala/main.scala @@ -0,0 +1,15 @@ + +import o1game.Client.Client +import o1game.Server.Server + +import scala.io.StdIn.readLine + +// TODO: add proper logic for starting the game +@main def main(): Unit = + print("Please choose:\n1) Client.Client\n2) Server\n> ") + readLine().toIntOption match + case Some(1) => Client("127.0.0.1", 2267).startClient() + case Some(2) => Server(2267, 5).startServer() + case _ => println("Invalid input") + + -- cgit v1.2.3