gradle #252
21
build.gradle
21
build.gradle
@ -130,7 +130,7 @@ def shell(String command) {
|
||||
}
|
||||
|
||||
def serverStart() {
|
||||
def proc = shell("ssh ${hostname} \"./mc Dev1.15\"")
|
||||
def proc = shell("ssh -t ${hostname} \"./mc Dev1.15\"")
|
||||
|
||||
Thread outputThread = proc.consumeProcessOutputStream(System.out)
|
||||
outputThread.setName("OutputThread")
|
||||
@ -138,13 +138,16 @@ def serverStart() {
|
||||
Thread inputThread = new Thread(new Runnable() {
|
||||
@Override
|
||||
void run() {
|
||||
// Reader reader = System.in.newReader()
|
||||
Reader reader = System.in.newReader()
|
||||
Writer writer = proc.getOutputStream().newWriter()
|
||||
while (true) {
|
||||
//String s = reader.readLine()
|
||||
Thread.sleep(10000)
|
||||
writer.write("stop\n")
|
||||
writer.flush()
|
||||
try {
|
||||
while (true) {
|
||||
String s = reader.readLine()
|
||||
writer.write(s + "\n")
|
||||
writer.flush()
|
||||
}
|
||||
} catch (InterruptedIOException e) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -162,5 +165,7 @@ def serverStart() {
|
||||
def answer(String question) {
|
||||
while (System.in.available() > 0) System.in.read()
|
||||
println(question)
|
||||
return "Yy".contains(((char)System.in.read()).toString())
|
||||
boolean valid = "Yy".contains(((char)System.in.read()).toString())
|
||||
while (System.in.available() > 0) System.in.read()
|
||||
return valid
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren