fix packet spam, json decoding, change ports
This commit is contained in:
parent
ff1006c73c
commit
bd516d0d88
4 changed files with 15 additions and 3 deletions
|
@ -100,9 +100,9 @@ public class Proxy {
|
|||
private boolean checkCase = true;
|
||||
private boolean kickOnConnect = true;
|
||||
private String forwardHost = "127.0.0.1";
|
||||
private int forwardPort = 25565;
|
||||
private int forwardPort = 25563;
|
||||
private String proxyHost = "";
|
||||
private int proxyPort = 25566;
|
||||
private int proxyPort = 25564;
|
||||
private int minPassLength = 8;
|
||||
private int maxAttempts = 5;
|
||||
private ServerInfo status = getStatus(new File("icon.png"), Formatter.AQUA + "Server\n" + Formatter.GREEN + "Test!!", 90, 10, "Test1",
|
||||
|
|
|
@ -69,6 +69,7 @@ public class ProxyHandler extends User implements Handler {
|
|||
private volatile boolean connected;
|
||||
private int passwordAttempts;
|
||||
private boolean wasClosed;
|
||||
private boolean hasMoved;
|
||||
private volatile int signPreloaded;
|
||||
private String completion;
|
||||
private int spoofedId = -1;
|
||||
|
@ -134,6 +135,10 @@ public class ProxyHandler extends User implements Handler {
|
|||
this.lastPingTime = System.nanoTime() / 1000000L;
|
||||
this.sendToClient(new S00PacketKeepAlive((int)this.lastPingTime));
|
||||
}
|
||||
if(this.hasMoved) {
|
||||
this.hasMoved = false;
|
||||
this.sendToClient(new S08PacketPlayerPosLook(0.5, 65.0, 0.5, 0.0f, 0.0f));
|
||||
}
|
||||
}
|
||||
if(this.connecting || this.connected) {
|
||||
if(this.server.isChannelOpen()) {
|
||||
|
@ -223,7 +228,8 @@ public class ProxyHandler extends User implements Handler {
|
|||
this.sendToServer(packetIn);
|
||||
}
|
||||
else {
|
||||
this.sendToClient(new S08PacketPlayerPosLook(0.5, 65.0, 0.5, 0.0f, 0.0f));
|
||||
if(packetIn.isMoving())
|
||||
this.hasMoved = true;
|
||||
if(this.signPreloaded == 1) {
|
||||
this.signPreloaded = 2;
|
||||
this.setSign(Formatter.DARK_BLUE + "" + Formatter.UNDERLINE + "Enter password", Formatter.DARK_GRAY + "Use 1 or 2 lines");
|
||||
|
|
|
@ -40,6 +40,10 @@ public class C03PacketPlayer implements Packet<ProxyHandler>
|
|||
{
|
||||
buf.writeByte(this.onGround ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean isMoving() {
|
||||
return this.moving;
|
||||
}
|
||||
|
||||
public static class C04PacketPlayerPosition extends C03PacketPlayer
|
||||
{
|
||||
|
|
|
@ -51,6 +51,8 @@ public enum Formatter {
|
|||
catch(Throwable t) {
|
||||
return null;
|
||||
}
|
||||
if(elem.isJsonObject())
|
||||
return elem.getAsJsonObject().has("text") && elem.getAsJsonObject().get("text").isJsonPrimitive() ? elem.getAsJsonObject().get("text").getAsString() : null;
|
||||
return elem.isJsonPrimitive() ? elem.getAsString() : null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue