diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-09 22:32:01 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-09 22:32:01 +0200 |
commit | c87263e9e493fe6c130f5ad6a523871c08987f4c (patch) | |
tree | d7ee9df308a80c7a1b58ae413a7e5217fba89e6c /src/main/scala/main.scala | |
parent | 129b49a3876ceb68f271c311d5e45efb2e205300 (diff) | |
download | scalevalapokalypsi-c87263e9e493fe6c130f5ad6a523871c08987f4c.tar.gz scalevalapokalypsi-c87263e9e493fe6c130f5ad6a523871c08987f4c.zip |
Minor change in concurrency model
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() |