1.3. Оказывается, закрывать сокет не надо, клиент сам сделает.
This commit is contained in:
parent
34b6a5061d
commit
ffd0758857
1 changed files with 4 additions and 3 deletions
|
|
@ -12,8 +12,9 @@ public class ServerThread extends Thread {
|
||||||
|
|
||||||
private static final String MODERN_RESPONSE =
|
private static final String MODERN_RESPONSE =
|
||||||
"{\"version\": {\"name\": \"b1.7.3\",\"protocol\": -17}," +
|
"{\"version\": {\"name\": \"b1.7.3\",\"protocol\": -17}," +
|
||||||
"\"players\": {\"max\": %max%,\"online\": %now%,\"sample\": []}," +
|
"\"players\": {\"max\": %max%,\"online\": %now%}," +
|
||||||
"\"description\": {\"text\": \"%motd%\"},\"enforcesSecureChat\": false}";
|
"\"description\": {\"text\": \"%motd%\"}," +
|
||||||
|
"\"enforcesSecureChat\": false,\"previewsChat\": true}";
|
||||||
private final ServerSocket serverSocket;
|
private final ServerSocket serverSocket;
|
||||||
private final AtomicBoolean working = new AtomicBoolean(false);
|
private final AtomicBoolean working = new AtomicBoolean(false);
|
||||||
private final Server minecraftServer;
|
private final Server minecraftServer;
|
||||||
|
|
@ -62,7 +63,7 @@ public class ServerThread extends Thread {
|
||||||
this.responseForModernPing(outputStream);
|
this.responseForModernPing(outputStream);
|
||||||
}
|
}
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
socket.close();
|
//socket.close();
|
||||||
} catch (SocketTimeoutException ignore) {
|
} catch (SocketTimeoutException ignore) {
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
System.out.println("Exception caught: " + ex);
|
System.out.println("Exception caught: " + ex);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue