From 350296d2bb67017416c97d846b985d09378866b5 Mon Sep 17 00:00:00 2001 From: ayunami2000 Date: Fri, 6 Oct 2023 15:05:41 -0400 Subject: [PATCH] Way for anyone to connect to Eaglercraft servers --- .../me/ayunami2000/ayunViaProxyEagUtils/FunnyConfig.java | 5 +++++ .../java/me/ayunami2000/ayunViaProxyEagUtils/Main.java | 6 ++++++ src/main/resources/vpeagutils.yml | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/FunnyConfig.java b/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/FunnyConfig.java index cdd1ef1..fc58746 100644 --- a/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/FunnyConfig.java +++ b/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/FunnyConfig.java @@ -12,6 +12,7 @@ public class FunnyConfig extends Config { public static boolean premiumSkins = false; public static boolean eaglerSkins = true; public static boolean eaglerVoice = true; + public static int eaglerServerMode = 0; protected FunnyConfig(File configFile) { super(configFile); @@ -36,6 +37,10 @@ public class FunnyConfig extends Config { if (item instanceof Boolean) { eaglerVoice = (Boolean) item; } + item = map.get("eagler-server-mode"); + if (item instanceof Integer) { + eaglerServerMode = (Integer) item; + } } @Override diff --git a/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/Main.java b/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/Main.java index a08d60c..7f90351 100644 --- a/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/Main.java +++ b/src/main/java/me/ayunami2000/ayunViaProxyEagUtils/Main.java @@ -90,6 +90,12 @@ public class Main extends ViaProxyPlugin { addr = ((ProxyConnection) proxyConnection).getServerAddress(); } + if (FunnyConfig.eaglerServerMode == 1) { + c2p.attr(secureWs).set(false); + } else if (FunnyConfig.eaglerServerMode == 2) { + c2p.attr(secureWs).set(true); + } + if (c2p.hasAttr(secureWs)) { doWsServerStuff(ch, proxyConnection, c2p, addr); if (!event.isLegacyPassthrough()) { diff --git a/src/main/resources/vpeagutils.yml b/src/main/resources/vpeagutils.yml index 2f25676..db4f73a 100644 --- a/src/main/resources/vpeagutils.yml +++ b/src/main/resources/vpeagutils.yml @@ -3,4 +3,9 @@ premium-skins: false # Sync Eagler skins eagler-skins: true # Enable Eagler voice chat -eagler-voice: true \ No newline at end of file +eagler-voice: true +# Eaglercraft server mode +# 0 - Default (non-Eaglercraft) +# 1 - Force non-secure (ws) +# 2 - Force secure (wss) +eagler-server-mode: 0 \ No newline at end of file