Add newer protocolsupport support & change domain

This commit is contained in:
ayunami2000 2022-07-23 16:43:07 -04:00
parent eddde27c20
commit c21abb5dfd
3 changed files with 28 additions and 9 deletions

View File

@ -57,6 +57,7 @@ public class ServerConnector extends PacketHandler
private State thisState;
private SecretKey secretkey;
private boolean sentMessages;
private boolean protocolSupport = BungeeCord.getInstance().config.getProtocolSupport();
@Override
public void exception(final Throwable t) throws Exception {
@ -73,13 +74,15 @@ public class ServerConnector extends PacketHandler
public void connected(final ChannelWrapper channel) throws Exception {
this.ch = channel;
channel.write(this.user.getPendingConnection().getHandshake());
final ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Login");
out.writeUTF(this.user.getAddress().getHostString());
out.writeInt(this.user.getAddress().getPort());
channel.write(new PacketFAPluginMessage("BungeeCord", out.toByteArray()));
if (this.user.getPendingConnection().getForgeLogin() == null) {
channel.write(PacketConstants.CLIENT_LOGIN);
if (!protocolSupport) {
final ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Login");
out.writeUTF(this.user.getAddress().getHostString());
out.writeInt(this.user.getAddress().getPort());
channel.write(new PacketFAPluginMessage("BungeeCord", out.toByteArray()));
if (this.user.getPendingConnection().getForgeLogin() == null) {
channel.write(PacketConstants.CLIENT_LOGIN);
}
}
}
@ -160,6 +163,16 @@ public class ServerConnector extends PacketHandler
@Override
public void handle(final PacketFDEncryptionRequest encryptRequest) throws Exception {
Preconditions.checkState(this.thisState == State.ENCRYPT_REQUEST, (Object)"Not expecting ENCRYPT_REQUEST");
if (protocolSupport) {
final ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Login");
out.writeUTF(this.user.getAddress().getHostString());
out.writeInt(this.user.getAddress().getPort());
this.user.unsafe().sendPacket(new PacketFAPluginMessage("BungeeCord", out.toByteArray()));
if (this.user.getPendingConnection().getForgeLogin() == null) {
this.user.unsafe().sendPacket(PacketConstants.CLIENT_LOGIN);
}
}
if (this.user.getPendingConnection().getForgeLogin() != null) {
final PublicKey publickey = EncryptionUtil.getPubkey(encryptRequest);
this.secretkey = EncryptionUtil.getSecret();

View File

@ -27,6 +27,7 @@ public class Configuration {
private AuthServiceInfo authInfo;
private boolean onlineMode;
private boolean voiceEnabled;
private boolean protocolSupport;
private int playerLimit;
private String name;
private boolean showBanType;
@ -61,6 +62,7 @@ public class Configuration {
this.authInfo = adapter.getAuthSettings();
this.onlineMode = false;
this.voiceEnabled = adapter.getBoolean("voice_enabled", true);
this.protocolSupport = adapter.getBoolean("protocol_support_fix", false);
this.playerLimit = adapter.getInt("player_limit", this.playerLimit);
this.name = adapter.getString("server_name", EaglercraftBungee.name + " Server");
this.showBanType = adapter.getBoolean("display_ban_type_on_kick", false);
@ -123,6 +125,10 @@ public class Configuration {
return voiceEnabled;
}
public boolean getProtocolSupport() {
return protocolSupport;
}
public String getServerName() {
return name;
}

View File

@ -298,7 +298,7 @@ public class YamlConfig implements ConfigurationAdapter {
Collection<String> c = this.get("origin_blacklist_subscriptions", null);
if(c == null) {
c = new ArrayList();
c.add("https://g.eags.us/eaglercraft/origin_blacklist.txt");
c.add("https://g.lax1dude.net/eaglercraft/origin_blacklist.txt");
c.add("https://raw.githubusercontent.com/LAX1DUDE/eaglercraft/main/stable-download/origin_blacklist.txt");
c = this.get("origin_blacklist_subscriptions", c);
}
@ -312,7 +312,7 @@ public class YamlConfig implements ConfigurationAdapter {
c = new ArrayList();
c.add("type the name of your client's domain here");
c.add("(if 'origin_blacklist_use_simple_whitelist' is true)");
c.add("g.eags.us");
c.add("g.lax1dude.net");
c = this.get("origin_blacklist_simple_whitelist", c);
}
return c;