mirror of
https://github.com/ayunami2000/ayungee.git
synced 2024-12-21 14:24:10 -08:00
fix eagler packets not working on newer protocolsupports
This commit is contained in:
parent
ab7690f366
commit
5644655282
|
@ -28,6 +28,8 @@ public class Main {
|
|||
|
||||
public static boolean forwarded = false;
|
||||
|
||||
public static boolean eaglerPackets = false;
|
||||
|
||||
public static WebSocketServer webSocketServer = null;
|
||||
|
||||
public static Map<WebSocket, Client> clients = new HashMap<>();
|
||||
|
@ -110,6 +112,7 @@ public class Main {
|
|||
port = (int) config.getOrDefault("port", 25569);
|
||||
webPort = (int) config.getOrDefault("web_port", 25565);
|
||||
forwarded = (boolean) config.getOrDefault("forwarded", false);
|
||||
eaglerPackets = (boolean) config.getOrDefault("eag_packets", false);
|
||||
|
||||
List<String> defaultMotd = new ArrayList<>();
|
||||
|
||||
|
|
|
@ -139,12 +139,14 @@ public class WebSocketProxy extends WebSocketServer {
|
|||
return;
|
||||
}
|
||||
}
|
||||
byte[] packet = message.array();
|
||||
if (!Main.eaglerPackets && packet.length >= 11 && packet[0] == -6 && packet[2] >= 4 && packet[4] == 69 && packet[6] == 65 && packet[8] == 71 && packet[10] == 124) return; // EAG|
|
||||
Client currClient = Main.clients.get(conn);
|
||||
if (currClient.socketOut == null) {
|
||||
currClient.msgCache.add(message.array());
|
||||
currClient.msgCache.add(packet);
|
||||
} else if (!currClient.socket.isOutputShutdown()) {
|
||||
try {
|
||||
currClient.socketOut.write(message.array());
|
||||
currClient.socketOut.write(packet);
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ port: 25569
|
|||
web_port: 25565
|
||||
# if this is behind a reverse proxy, such as caddy or nginx. uses X-Real-IP header.
|
||||
forwarded: false
|
||||
# forward eagler-specific packets?
|
||||
eag_packets: false
|
||||
# origin blacklist URL (leave empty to disable syncing)
|
||||
origin_blacklist: "https://g.eags.us/eaglercraft/origin_blacklist.txt"
|
||||
# whitelisted origins -- if specified, only allows the listed origins to connect
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user