1.3. Оказывается, закрывать сокет не надо, клиент сам сделает.

This commit is contained in:
Dereku 2023-12-04 02:25:04 +07:00
parent 34b6a5061d
commit ffd0758857

View file

@ -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);