Did first part of error handling
This commit is contained in:
parent
c83339ce42
commit
2dac8eb9f5
2 changed files with 15 additions and 7 deletions
|
@ -6,11 +6,12 @@
|
||||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
<outputRelativeToContentRoot value="true" />
|
<outputRelativeToContentRoot value="true" />
|
||||||
<module name="ButtonServerRunner" />
|
<module name="MCServerRunner" />
|
||||||
</profile>
|
</profile>
|
||||||
</annotationProcessing>
|
</annotationProcessing>
|
||||||
<bytecodeTargetLevel>
|
<bytecodeTargetLevel>
|
||||||
<module name="ButtonServerRunner" target="1.8" />
|
<module name="ButtonServerRunner" target="1.8" />
|
||||||
|
<module name="MCServerRunner" target="1.8" />
|
||||||
</bytecodeTargetLevel>
|
</bytecodeTargetLevel>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -52,13 +52,20 @@ public class ServerRunner {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
String readLine;
|
String readLine;
|
||||||
while (!stop && (readLine = reader.readLine()) != null) {
|
while (!stop) {
|
||||||
if (readLine.equalsIgnoreCase("stop"))
|
try {
|
||||||
ServerRunner.stop();
|
if ((readLine = reader.readLine()) == null)
|
||||||
serveroutput.println(readLine);
|
break;
|
||||||
serveroutput.flush();
|
if (readLine.equalsIgnoreCase("stop"))
|
||||||
|
ServerRunner.stop();
|
||||||
|
serveroutput.println(readLine);
|
||||||
|
serveroutput.flush();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Thread.sleep(100); //Sleep a bit and keep going
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
ServerRunner.stop();
|
ServerRunner.stop();
|
||||||
|
|
Loading…
Reference in a new issue