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" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="ButtonServerRunner" />
|
||||
<module name="MCServerRunner" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="ButtonServerRunner" target="1.8" />
|
||||
<module name="MCServerRunner" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
|
@ -52,13 +52,20 @@ public class ServerRunner {
|
|||
public void run() {
|
||||
try {
|
||||
String readLine;
|
||||
while (!stop && (readLine = reader.readLine()) != null) {
|
||||
if (readLine.equalsIgnoreCase("stop"))
|
||||
ServerRunner.stop();
|
||||
serveroutput.println(readLine);
|
||||
serveroutput.flush();
|
||||
while (!stop) {
|
||||
try {
|
||||
if ((readLine = reader.readLine()) == null)
|
||||
break;
|
||||
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();
|
||||
}
|
||||
ServerRunner.stop();
|
||||
|
|
Loading…
Reference in a new issue