Improved ports and updated documentation of UncivServer (#7747)

* Improved ports on UncivServer

See 6315a16d98 (r83109934) for details

* Update UncivServer.kt

* Update Multiplayer.md

* Update Multiplayer.md
This commit is contained in:
Md. Touhidur Rahman
2022-09-07 13:48:47 +06:00
committed by GitHub
parent 81d2320824
commit 7c1b298a24
2 changed files with 9 additions and 6 deletions

View File

@ -27,7 +27,7 @@ private class UncivServerRunner : CliktCommand() {
"-p", "-port",
envvar = "UncivServerPort",
help = "Server port"
).int().restrictTo(1024..49151).default(80)
).int().restrictTo(0..65535).default(8080)
private val folder by option(
"-f", "-folder",
@ -40,7 +40,8 @@ private class UncivServerRunner : CliktCommand() {
}
private fun serverRun(serverPort: Int, fileFolderName: String) {
echo("Starting UncivServer for ${File(fileFolderName).absolutePath} on port $serverPort")
val portStr: String = if (serverPort == 80) "" else ":$serverPort"
echo("Starting UncivServer for ${File(fileFolderName).absolutePath} on http://localhost$portStr")
embeddedServer(Netty, port = serverPort) {
routing {
get("/isalive") {