22w35a Bug fixes & ability to disable title screen panorama blur

This commit is contained in:
ayunami2000 2022-08-30 22:38:41 -04:00
parent effb1cd426
commit 12527419b1
25 changed files with 51768 additions and 51703 deletions

View File

@ -1,5 +1,7 @@
# Eaglercraft
**Currently maintained by [ayunami2000](https://github.com/ayunami2000)**
### Client: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/)
### Offline Download: [Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html)

View File

@ -62,7 +62,7 @@ public class ServerConnector extends PacketHandler
@Override
public void exception(final Throwable t) throws Exception {
final String message = "Exception Connecting:" + Util.exception(t);
if (this.user.getServer() == null) {
if (this.user.getServer() == null || this.user.getServer().getInfo() == null) {
this.user.disconnect(message);
}
else {
@ -94,7 +94,9 @@ public class ServerConnector extends PacketHandler
@Override
public void handle(final Packet1Login login) throws Exception {
Preconditions.checkState(this.thisState == State.LOGIN || this.thisState == State.ENCRYPT_REQUEST, (Object)"Not expecting LOGIN/ENCRYPT_REQUEST");
if (this.thisState == State.ENCRYPT_REQUEST) this.thisState = State.LOGIN;
if (this.thisState == State.ENCRYPT_REQUEST) {
this.thisState = State.LOGIN;
}
final ServerConnection server = new ServerConnection(this.ch, this.target);
final ServerConnectedEvent event = new ServerConnectedEvent(this.user, server);
this.bungee.getPluginManager().callEvent(event);
@ -117,7 +119,7 @@ public class ServerConnector extends PacketHandler
this.ch.write(this.user.getSettings());
}
synchronized (this.user.getSwitchMutex()) {
if (this.user.getServer() == null) {
if (this.user.getServer() == null || this.user.getServer().getInfo() == null) {
this.user.setClientEntityId(login.getEntityId());
this.user.setServerEntityId(login.getEntityId());
Packet1Login modLogin;
@ -210,7 +212,7 @@ public class ServerConnector extends PacketHandler
return;
}
final String message = this.bungee.getTranslation("connect_kick") + this.target.getName() + ": " + kick.getMessage();
if (this.user.getServer() == null) {
if (this.user.getServer() == null || this.user.getServer().getInfo() == null) {
this.user.disconnect(message);
}
else {
@ -220,8 +222,8 @@ public class ServerConnector extends PacketHandler
@Override
public void handle(final PacketFAPluginMessage pluginMessage) throws Exception {
if (pluginMessage.equals(PacketConstants.I_AM_BUNGEE)) {
throw new IllegalStateException("May not connect to another BungeCord!");
if (pluginMessage.equals(PacketConstants.I_AM_BUNGEE) && !BungeeCord.getInstance().config.allowBungeeOnBungee()) {
throw new IllegalStateException("May not connect to another BungeeCord!");
}
if (pluginMessage.getTag().equals("FML") && (pluginMessage.getData()[0] & 0xFF) == 0x0) {
final ByteArrayDataInput in = ByteStreams.newDataInput(pluginMessage.getData());

View File

@ -130,7 +130,7 @@ public final class UserConnection implements ProxiedPlayer {
return;
}
final BungeeServerInfo target = (BungeeServerInfo) event.getTarget();
if (this.getServer() != null && Objects.equals(this.getServer().getInfo(), target)) {
if (this.getServer() != null && this.getServer().getInfo() != null && Objects.equals(this.getServer().getInfo(), target)) {
//this.sendMessage(ChatColor.RED + "Cannot connect to server you are already on!");
return;
}
@ -151,10 +151,10 @@ public final class UserConnection implements ProxiedPlayer {
future.channel().close();
UserConnection.this.pendingConnects.remove(target);
final ServerInfo def = ProxyServer.getInstance().getServers().get(UserConnection.this.getPendingConnection().getListener().getFallbackServer());
if ((retry & target != def) && (UserConnection.this.getServer() == null || def != UserConnection.this.getServer().getInfo())) {
if ((retry & target != def) && ((UserConnection.this.getServer() == null || UserConnection.this.getServer().getInfo() == null) || def != UserConnection.this.getServer().getInfo())) {
UserConnection.this.sendMessage(UserConnection.this.bungee.getTranslation("fallback_lobby"));
UserConnection.this.connect(def, false);
} else if (UserConnection.this.server == null) {
} else if (UserConnection.this.getServer() == null || UserConnection.this.getServer().getInfo() == null) {
UserConnection.this.disconnect(UserConnection.this.bungee.getTranslation("fallback_kick") + future.cause().getClass().getName());
} else {
UserConnection.this.sendMessage(UserConnection.this.bungee.getTranslation("fallback_kick") + future.cause().getClass().getName());
@ -176,7 +176,7 @@ public final class UserConnection implements ProxiedPlayer {
this.bungee.getLogger().log(Level.INFO, "[" + this.getName() + "] disconnected with: " + reason);
this.unsafe().sendPacket(new PacketFFKick(reason));
this.ch.close();
if (this.server != null) {
if (this.server != null && this.server.getInfo() != null) {
this.server.disconnect("Quitting");
}
}

View File

@ -10,7 +10,7 @@ import net.md_5.bungee.api.plugin.Command;
public class CommandEnd extends Command {
public CommandEnd() {
super("end", "bungeecord.command.end", new String[0]);
super("end", "bungeecord.command.end", new String[] { "stop", "exit", "quit" });
}
@Override

View File

@ -21,7 +21,7 @@ public class CommandFind extends Command {
sender.sendMessage(ChatColor.RED + "Please follow this command by a user name");
} else {
final ProxiedPlayer player = ProxyServer.getInstance().getPlayer(args[0]);
if (player == null || player.getServer() == null) {
if (player == null || player.getServer() == null || player.getServer().getInfo() == null) {
sender.sendMessage(ChatColor.RED + "That user is not online");
} else {
sender.sendMessage(ChatColor.BLUE + args[0] + " is online at " + player.getServer().getInfo().getName());

View File

@ -52,7 +52,7 @@ public class CommandSend extends Command {
}
private void summon(final ProxiedPlayer player, final ServerInfo target, final CommandSender sender) {
if (player.getServer() != null && !player.getServer().getInfo().equals(target)) {
if (player.getServer() != null && player.getServer().getInfo() != null && !player.getServer().getInfo().equals(target)) {
player.connect(target);
player.sendMessage(ChatColor.GOLD + "Summoned to " + target.getName() + " by " + sender.getName());
}

View File

@ -39,6 +39,7 @@ public class Configuration {
private boolean acceptBukkitConsoleCommandPacket;
private Collection<String> disabledCommands;
private Collection<String> iceServers;
private boolean bungeeOnBungee;
public Configuration() {
this.timeout = 30000;
@ -73,6 +74,7 @@ public class Configuration {
this.blacklistOriginless = adapter.getBoolean("origin_blacklist_block_missing_origin_header", true);
this.simpleWhitelistEnabled = adapter.getBoolean("origin_blacklist_use_simple_whitelist", false);
this.acceptBukkitConsoleCommandPacket = adapter.getBoolean("accept_bukkit_console_command_packets", false);
this.bungeeOnBungee = adapter.getBoolean("bungee_on_bungee", false);
this.disabledCommands = adapter.getDisabledCommands();
this.iceServers = adapter.getICEServers();
Preconditions.checkArgument(this.listeners != null && !this.listeners.isEmpty(), (Object) "No listeners defined.");
@ -170,5 +172,9 @@ public class Configuration {
public Collection<String> getICEServers() {
return iceServers;
}
public boolean allowBungeeOnBungee() {
return bungeeOnBungee;
}
}

View File

@ -47,7 +47,7 @@ public class UpstreamBridge extends PacketHandler {
this.bungee.getPluginManager().callEvent(event);
this.con.getTabList().onDisconnect();
BungeeCord.getInstance().removeConnection(this.con);
if (this.con.getServer() != null) {
if (this.con.getServer() != null && this.con.getServer().getInfo() == null) {
this.con.getServer().disconnect("Quitting");
}
}

View File

@ -1,8 +1,10 @@
package net.md_5.bungee.eaglercraft;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ServerConnection;
@ -11,6 +13,7 @@ import net.md_5.bungee.Util;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.connection.CancelSendSignal;
import net.md_5.bungee.connection.UpstreamBridge;
import net.md_5.bungee.netty.ChannelWrapper;
import net.md_5.bungee.netty.HandlerBoss;
@ -21,7 +24,8 @@ import net.md_5.bungee.protocol.packet.Packet0DPositionAndLook;
import net.md_5.bungee.protocol.packet.Packet3Chat;
import net.md_5.bungee.protocol.packet.Packet0KeepAlive;
import net.md_5.bungee.protocol.packet.PacketCCSettings;
// import net.md_5.bungee.protocol.packet.PacketFAPluginMessage;
import net.md_5.bungee.protocol.packet.PacketFAPluginMessage;
import net.md_5.bungee.protocol.packet.PacketFEPing;
public class AuthHandler extends PacketHandler {
private static final AuthSystem authSystem = BungeeCord.getInstance().authSystem;
@ -78,12 +82,18 @@ public class AuthHandler extends PacketHandler {
}
}
/*
private List<PacketFAPluginMessage> pms = new ArrayList<>();
@Override
public void handle(final PacketFAPluginMessage pm) throws Exception {
this.con.getPendingConnection().handle(pm);
public void handle(final PacketFAPluginMessage p) throws Exception {
pms.add(p);
throw new CancelSendSignal();
}
@Override
public void handle(final PacketFEPing p) throws Exception {
this.con.getPendingConnection().handle(p);
}
*/
@Override
public void handle(final Packet3Chat chat) throws Exception {
@ -148,10 +158,20 @@ public class AuthHandler extends PacketHandler {
private void onLogin() throws Exception {
this.loggedIn = true;
this.bungee.getPluginManager().callEvent(new PostLoginEvent(this.con));
handlerBoss.setHandler(new UpstreamBridge(this.bungee, this.con));
UpstreamBridge ub = new UpstreamBridge(this.bungee, this.con);
handlerBoss.setHandler(ub);
final ServerInfo server = this.bungee.getReconnectHandler().getServer(this.con);
this.con.setServer(new ServerConnection(null, null));
this.con.connect(server, true);
for (PacketFAPluginMessage pm : pms) {
try {
ub.handle(pm);
this.con.getPendingConnection().getLoginMessages().add(pm);
} catch (CancelSendSignal e) {
// don't forward to server
}
}
pms.clear();
}
@Override

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,6 +21,7 @@ const relayId = Math.floor(Math.random() * 3);
window.eaglercraftOpts = {
container: "game_frame", assetsURI: "assets.epk", serverWorkerURI: "worker_bootstrap.js", worldsFolder: "TEST",
assetOverrides: {
// "title/no-pano-blur.flag": "",
"records/wait.mp3": "wait.mp3",
"records/mellohi.mp3": "https://stream.nightride.fm/chillsynth.m4a",
"records/far.mp3": "https://stream.nightride.fm/nightride.m4a",

View File

@ -6,7 +6,7 @@ public class ConfigConstants {
public static boolean profanity = false;
public static final String version = "22w34d";
public static final String version = "22w35a";
public static final String mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/lax1dude/eaglercraft";
@ -26,5 +26,7 @@ public class ConfigConstants {
public static List<RelayEntry> relays = null;
public static boolean eaglercraftTitleLogo = false;
public static boolean panoramaBlur = true;
}

View File

@ -5,6 +5,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import net.lax1dude.eaglercraft.AssetRepository;
import net.lax1dude.eaglercraft.ConfigConstants;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.EaglercraftRandom;
@ -169,6 +170,8 @@ public class GuiMainMenu extends GuiScreen {
this.field_92020_v = this.field_92022_t + var6;
this.field_92019_w = this.field_92021_u + 12;
}
ConfigConstants.panoramaBlur = AssetRepository.getResource("/title/no-pano-blur.flag") == null;
if(this.ackLines.isEmpty()) {
int width = 315;
@ -313,7 +316,11 @@ public class GuiMainMenu extends GuiScreen {
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_PROJECTION);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glLoadIdentity();
EaglerAdapter.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F);
if (ConfigConstants.panoramaBlur) {
EaglerAdapter.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F);
} else {
EaglerAdapter.gluPerspective(120.0F, (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, 10.0F);
}
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glLoadIdentity();
@ -362,7 +369,11 @@ public class GuiMainMenu extends GuiScreen {
titlePanoramaPaths[var10].bindTexture();
var4.startDrawingQuads();
var4.setColorRGBA_I(16777215, 255 / (var6 + 1));
if (ConfigConstants.panoramaBlur) {
var4.setColorRGBA_I(16777215, 255 / (var6 + 1));
} else {
var4.setColorRGBA_I(16777215, 255);
}
float var11 = 0.0F;
var4.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double) (0.0F + var11), (double) (0.0F + var11));
var4.addVertexWithUV(1.0D, -1.0D, 1.0D, (double) (1.0F - var11), (double) (0.0F + var11));
@ -422,34 +433,39 @@ public class GuiMainMenu extends GuiScreen {
* Renders the skybox in the main menu
*/
private void renderSkybox(int par1, int par2, float par3) {
EaglerAdapter.glViewport(0, 0, 256, 256);
this.drawPanorama(par1, par2, par3);
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
EaglerAdapter.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
Tessellator var4 = Tessellator.instance;
var4.startDrawingQuads();
float var5 = this.width > this.height ? 120.0F / (float) this.width : 120.0F / (float) this.height;
float var6 = (float) this.height * var5 / 256.0F;
float var7 = (float) this.width * var5 / 256.0F;
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_LINEAR);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_LINEAR);
var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
int var8 = this.width;
int var9 = this.height;
var4.addVertexWithUV(0.0D, (double) var9, (double) this.zLevel, (double) (0.5F - var6), (double) (0.5F + var7));
var4.addVertexWithUV((double) var8, (double) var9, (double) this.zLevel, (double) (0.5F - var6), (double) (0.5F - var7));
var4.addVertexWithUV((double) var8, 0.0D, (double) this.zLevel, (double) (0.5F + var6), (double) (0.5F - var7));
var4.addVertexWithUV(0.0D, 0.0D, (double) this.zLevel, (double) (0.5F + var6), (double) (0.5F + var7));
var4.draw();
if (ConfigConstants.panoramaBlur) {
EaglerAdapter.glViewport(0, 0, 256, 256);
this.drawPanorama(par1, par2, par3);
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
this.rotateAndBlurSkybox(par3);
EaglerAdapter.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
Tessellator var4 = Tessellator.instance;
var4.startDrawingQuads();
float var5 = this.width > this.height ? 120.0F / (float) this.width : 120.0F / (float) this.height;
float var6 = (float) this.height * var5 / 256.0F;
float var7 = (float) this.width * var5 / 256.0F;
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MIN_FILTER, EaglerAdapter.GL_LINEAR);
EaglerAdapter.glTexParameteri(EaglerAdapter.GL_TEXTURE_2D, EaglerAdapter.GL_TEXTURE_MAG_FILTER, EaglerAdapter.GL_LINEAR);
var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
int var8 = this.width;
int var9 = this.height;
var4.addVertexWithUV(0.0D, (double) var9, (double) this.zLevel, (double) (0.5F - var6), (double) (0.5F + var7));
var4.addVertexWithUV((double) var8, (double) var9, (double) this.zLevel, (double) (0.5F - var6), (double) (0.5F - var7));
var4.addVertexWithUV((double) var8, 0.0D, (double) this.zLevel, (double) (0.5F + var6), (double) (0.5F - var7));
var4.addVertexWithUV(0.0D, 0.0D, (double) this.zLevel, (double) (0.5F + var6), (double) (0.5F + var7));
var4.draw();
} else {
EaglerAdapter.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
this.drawPanorama(par1, par2, par3);
}
}
private static final TextureLocation mclogo = new TextureLocation("/title/mclogo.png");
@ -469,8 +485,10 @@ public class GuiMainMenu extends GuiScreen {
short var5 = 274;
int var6 = this.width / 2 - var5 / 2;
byte var7 = 30;
this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
if (ConfigConstants.panoramaBlur) {
this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
}
if(ConfigConstants.eaglercraftTitleLogo) {
eag.bindTexture();

View File

@ -191,6 +191,10 @@ public class EaglerAdapterImpl2 {
public static native byte[] downloadURL(String url);
private static void downloadURL(String url, final AsyncCallback<byte[]> cb) {
if(url.isEmpty()) {
cb.complete(new byte[0]);
return;
}
final XMLHttpRequest request = XMLHttpRequest.create();
request.setResponseType("arraybuffer");
request.open("GET", url, true);
@ -3940,6 +3944,7 @@ public class EaglerAdapterImpl2 {
rtcLANClient.setRemoteDataChannelHandler(new EaglercraftLANClient.ClientSignalHandler() {
@Override
public void call() {
clientDataChannelClosed = false;
clientDataChannelOpen = true;
}
});
@ -3973,7 +3978,7 @@ public class EaglerAdapterImpl2 {
clientICECandidate = null;
clientDescription = null;
clientDataChannelOpen = false;
clientDataChannelClosed = false;
clientDataChannelClosed = true;
}
public static final String clientLANAwaitICECandidate() {

File diff suppressed because one or more lines are too long

View File

@ -84,7 +84,7 @@ permissions:
- bungeecord.command.eag.blockdomainname
- bungeecord.command.eag.unblockdomain
origin_blacklist_subscriptions:
- https://g.eags.us/eaglercraft/origin_blacklist.txt
- https://g.lax1dude.net/eaglercraft/origin_blacklist.txt
- https://raw.githubusercontent.com/LAX1DUDE/eaglercraft/main/stable-download/origin_blacklist.txt
display_ban_type_on_kick: false
timeout: 30000

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long