From c87263e9e493fe6c130f5ad6a523871c08987f4c Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 9 Nov 2024 22:32:01 +0200 Subject: Minor change in concurrency model --- src/main/scala/main.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/scala/main.scala') diff --git a/src/main/scala/main.scala b/src/main/scala/main.scala index 362c270..d68664a 100644 --- a/src/main/scala/main.scala +++ b/src/main/scala/main.scala @@ -1,6 +1,7 @@ import o1game.Client.newClient import o1game.Server.Server +import java.lang.Thread import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global @@ -11,7 +12,7 @@ import scala.io.StdIn.readLine print("How do you want to play?\n1) Host and join local game\n2) Join local game\n> ") readLine().toIntOption match case Some(1) => - Future(Server(2267, 5, 30, true).startServer()) + Thread(() => Server(2267, 5, 30, true).startServer()).start() println("Server started in background.") print("Choose a name:\n> ") val name = readLine() -- cgit v1.2.3