diff options
Diffstat (limited to 'src/main/scala/main.scala')
-rw-r--r-- | src/main/scala/main.scala | 3 |
1 files changed, 2 insertions, 1 deletions
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() |