mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Remove inactive server code and music (#5017)
This commit is contained in:
parent
5a6a9c9759
commit
5403f28c77
Binary file not shown.
@ -68,7 +68,6 @@ project(":desktop") {
|
|||||||
"implementation"("com.badlogicgames.gdx:gdx-tools:$gdxVersion") // This is for the TexturePacker class
|
"implementation"("com.badlogicgames.gdx:gdx-tools:$gdxVersion") // This is for the TexturePacker class
|
||||||
|
|
||||||
"implementation"("com.github.MinnDevelopment:java-discord-rpc:v2.0.1")
|
"implementation"("com.github.MinnDevelopment:java-discord-rpc:v2.0.1")
|
||||||
"implementation"("io.ktor:ktor-server-netty:1.3.2")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,13 +15,6 @@ import com.unciv.logic.GameSaver
|
|||||||
import com.unciv.models.metadata.GameSettings
|
import com.unciv.models.metadata.GameSettings
|
||||||
import com.unciv.models.translations.tr
|
import com.unciv.models.translations.tr
|
||||||
import com.unciv.ui.utils.Fonts
|
import com.unciv.ui.utils.Fonts
|
||||||
import io.ktor.application.*
|
|
||||||
import io.ktor.http.*
|
|
||||||
import io.ktor.request.*
|
|
||||||
import io.ktor.response.*
|
|
||||||
import io.ktor.routing.*
|
|
||||||
import io.ktor.server.engine.*
|
|
||||||
import io.ktor.server.netty.*
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.concurrent.timer
|
import kotlin.concurrent.timer
|
||||||
|
|
||||||
@ -64,56 +57,6 @@ internal object DesktopLauncher {
|
|||||||
LwjglApplication(game, config)
|
LwjglApplication(game, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work in Progress?
|
|
||||||
@Suppress("unused")
|
|
||||||
private fun startMultiplayerServer() {
|
|
||||||
// val games = HashMap<String, GameSetupInfo>()
|
|
||||||
val files = HashMap<String, String>()
|
|
||||||
embeddedServer(Netty, 8080) {
|
|
||||||
routing {
|
|
||||||
get("/files/getFile/{fileName}") {
|
|
||||||
val fileName = call.parameters["fileName"]
|
|
||||||
if (!files.containsKey(fileName)) call.respond(HttpStatusCode.NotFound,
|
|
||||||
"Game with the name $fileName does not exist")
|
|
||||||
else call.respondText(files[fileName]!!)
|
|
||||||
}
|
|
||||||
|
|
||||||
post("/files/{fileName}") {
|
|
||||||
val fileName = call.parameters["fileName"]!!
|
|
||||||
val body = call.receiveText()
|
|
||||||
files[fileName] = body
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// get("/getGame/{gameName}") {
|
|
||||||
// val gameName = call.parameters["gameName"]
|
|
||||||
// if(!games.containsKey(gameName)) call.respond(HttpStatusCode.NotFound,
|
|
||||||
// "Game with the name $gameName does not exist")
|
|
||||||
// else call.respondText(Json().toJson(games[gameName]))
|
|
||||||
// }
|
|
||||||
// get("/getGameNames"){
|
|
||||||
// call.respondText(Json().toJson(games.keys.toList()))
|
|
||||||
// }
|
|
||||||
// post("/addNewGame/{gameName}") {
|
|
||||||
// val gameName = call.parameters["gameName"]!!
|
|
||||||
// if (games.containsKey(gameName)) {
|
|
||||||
// call.respond(HttpStatusCode.NotAcceptable, "A game with the name $gameName already exists")
|
|
||||||
// return@post
|
|
||||||
// }
|
|
||||||
// val body = call.receiveText()
|
|
||||||
// val newGameInfo:GameSetupInfo
|
|
||||||
// try{
|
|
||||||
// newGameInfo = Json().apply { ignoreUnknownFields }.fromJson(GameSetupInfo::class.java, body)
|
|
||||||
// }
|
|
||||||
// catch (ex:Exception){
|
|
||||||
// call.respond(HttpStatusCode.NotAcceptable, "Could not deserialize json")
|
|
||||||
// return@post
|
|
||||||
// }
|
|
||||||
// games[gameName] = newGameInfo
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun tryActivateDiscord(game: UncivGame) {
|
private fun tryActivateDiscord(game: UncivGame) {
|
||||||
try {
|
try {
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user