Resolved #9697 - Unciv server creates multiplayer file folder if it doesn't exist

This commit is contained in:
yairm210 2025-04-08 09:15:48 +03:00
parent a3df5e3c61
commit 15777b306f

View File

@ -123,7 +123,10 @@ private class UncivServerRunner : CliktCommand() {
private fun serverRun(serverPort: Int, fileFolderName: String) {
val portStr: String = if (serverPort == 80) "" else ":$serverPort"
echo("Starting UncivServer for ${File(fileFolderName).absolutePath} on http://localhost$portStr")
val file = File(fileFolderName)
echo("Starting UncivServer for ${file.absolutePath} on http://localhost$portStr")
if (!file.exists()) file.mkdirs()
val server = embeddedServer(Netty, port = serverPort) {
routing {
get("/isalive") {