aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/xyz/brysonsteck
diff options
context:
space:
mode:
authorBryson Steck <brysonsteck@protonmail.com>2023-05-21 00:00:15 -0600
committerBryson Steck <brysonsteck@protonmail.com>2023-05-21 00:00:15 -0600
commitd38d79e9b7de14f837b02b850cbd86a5c03cfc1b (patch)
treed3a32c38fdd7307d823b8854cd28b05ce8ab6731 /src/main/kotlin/xyz/brysonsteck
parent633132c1c058a9e7bd994b350b775e1b9aa779ab (diff)
downloadServerCraft-d38d79e9b7de14f837b02b850cbd86a5c03cfc1b.tar
ServerCraft-d38d79e9b7de14f837b02b850cbd86a5c03cfc1b.tar.gz
ServerCraft-d38d79e9b7de14f837b02b850cbd86a5c03cfc1b.tar.bz2
update readme, windows still borked
Diffstat (limited to 'src/main/kotlin/xyz/brysonsteck')
-rw-r--r--src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt
index 5b26481..75ebbbd 100644
--- a/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt
+++ b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt
@@ -494,23 +494,32 @@ class PrimaryController {
builder.directory(File(directory + "ServerCraft" + File.separator + "Spigot"))
val proc = builder.start()
val reader = InputStreamReader(proc.inputStream)
+ val errors = InputStreamReader(proc.errorStream)
val br = BufferedReader(reader)
+ val ebr = BufferedReader(errors)
try {
var line = br.readLine()
+ var errorLine = ebr.readline()
var currentline = 0.0
- while (line != null) {
+ while (line != null || errorLine != null) {
if (!building) {
proc.destroy()
}
- withContext(Dispatchers.JavaFx) {log(line)}
+ withContext(Dispatchers.JavaFx) {
+ if (errorLine != null) {
+ log(errorLine)
+ }
+ log(line)
+ }
line = br.readLine()
+ errorLine = ebr.readline()
currentline++
if (currentline > 15) {
withContext(Dispatchers.JavaFx) {progressBar.progress = if (spigotBuilt) {currentline/1100.0} else {currentline/14122.0} }
}
}
} catch (e: IOException) {
- withContext(Dispatchers.JavaFx) {log("Stream Closed")}
+ withContext(Dispatchers.JavaFx) {log("Stream Closed: ${e.toString()}")}
}
}