mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-12 08:41:00 -05:00
Add flag for printing DNS resolution errors.
This commit is contained in:
parent
5f73b5a7ae
commit
5291bea6a0
2 changed files with 12 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
package com.github.steveice10.packetlib;
|
||||
|
||||
public class BuiltinFlags {
|
||||
public static final String PRINT_DNS_ERRORS = "print-dns-errors";
|
||||
|
||||
private BuiltinFlags() {
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.github.steveice10.packetlib.tcp;
|
||||
|
||||
import com.github.steveice10.packetlib.BuiltinFlags;
|
||||
import com.github.steveice10.packetlib.Client;
|
||||
import com.github.steveice10.packetlib.ProxyInfo;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
|
@ -113,6 +114,9 @@ public class TcpClientSession extends TcpSession {
|
|||
port = srv.getPort();
|
||||
}
|
||||
} catch(TextParseException e) {
|
||||
if(getFlag(BuiltinFlags.PRINT_DNS_ERRORS, false)) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap.remoteAddress(host, port);
|
||||
|
|
Loading…
Reference in a new issue