forked from KNEMC/KLALB
KLALB2.3
This commit is contained in:
@@ -6,6 +6,7 @@ import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringReader;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
@@ -23,9 +24,13 @@ import com.google.gson.JsonParser;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
|
||||
public class MinecraftServerPinger {
|
||||
private Socket socket;
|
||||
private MinecraftProtocolContext mpc=new MinecraftProtocolContext();
|
||||
public class MinecraftServerPinger implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private transient Socket socket;
|
||||
private transient MinecraftProtocolContext mpc=new MinecraftProtocolContext();
|
||||
private MultipurposeSocketAddress targetaddr;
|
||||
|
||||
|
||||
@@ -44,13 +49,17 @@ public class MinecraftServerPinger {
|
||||
private int klalbvport;
|
||||
|
||||
public MinecraftServerPinger(MultipurposeSocketAddress target) throws UnknownHostException, IOException {
|
||||
this(target,target.connectSocket());
|
||||
}
|
||||
|
||||
public MinecraftServerPinger(MultipurposeSocketAddress target, Socket Asocket) throws UnknownHostException, IOException{
|
||||
targetaddr=target;
|
||||
socket=target.connectSocket();
|
||||
socket=Asocket;
|
||||
socket.setTcpNoDelay(true);
|
||||
ping();
|
||||
analyseJson();
|
||||
}
|
||||
|
||||
|
||||
private void ping() throws IOException {
|
||||
MinecraftInputStream in=null;
|
||||
MinecraftOutputStream out=null;
|
||||
|
||||
Reference in New Issue
Block a user