22w13h Deleted 'End of Stream' check entirely. Should fix the crash, but in exchange for the client not to detect some server crashes anymore

This commit is contained in:
LAX1DUDE 2022-04-02 20:43:12 -07:00
parent aaefa415e9
commit a74740224f
12 changed files with 76437 additions and 76491 deletions

View File

@ -35,7 +35,7 @@ public class WebSocketListener extends WebSocketServer {
public WebSocketListener(ListenerInfo info, InetSocketAddress sock, ProxyServer bungeeCord) {
super(info.getHost());
this.setTcpNoDelay(true);
this.setConnectionLostTimeout(5);
this.setConnectionLostTimeout(20);
this.start();
this.info = info;
this.bungeeProxy = sock;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ public class ConfigConstants {
public static boolean profanity = false;
public static final String version = "22w13g";
public static final String version = "22w13h";
public static final String mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";

View File

@ -10,7 +10,6 @@ import java.nio.ByteBuffer;
import java.util.LinkedList;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.NetClientHandler;
import net.minecraft.src.NetHandler;
import net.minecraft.src.Packet;
@ -80,10 +79,6 @@ public class WebsocketNetworkManager implements INetworkManager {
readChunks.add(ByteBuffer.wrap(packet));
}
if(!readChunks.isEmpty()) {
if(this.netHandler instanceof NetClientHandler) {
((NetClientHandler)this.netHandler).lastKeepAlive = ((NetClientHandler)this.netHandler).updateCounter;
}
int cap = 0;
for(ByteBuffer b : readChunks) {
cap += b.limit();

View File

@ -44,9 +44,6 @@ public class NetClientHandler extends NetHandler {
public List playerInfoList = new ArrayList();
public int currentServerMaxPlayers = 20;
private GuiScreen field_98183_l = null;
public int updateCounter = 0;
public int lastKeepAlive = 0;
private int focusTimer = 0;
/** RNG. */
EaglercraftRandom rand = new EaglercraftRandom();
@ -82,24 +79,17 @@ public class NetClientHandler extends NetHandler {
* function.
*/
public void processReadPackets() {
++this.updateCounter;
if (!this.disconnected && this.netManager != null) {
this.netManager.processReadPackets();
}
if(EaglerAdapter.isFocused()) {
--focusTimer;
if((focusTimer < 0 && updateCounter - lastKeepAlive > 400) || !EaglerAdapter.connectionOpen()) {
this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect." + (EaglerAdapter.connectionOpen() ? "endOfStream" :" timeout"), null));
this.netManager.closeConnections();
if(!EaglerAdapter.connectionOpen()) {
this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.endOfStream", null));
this.disconnected = true;
this.mc.loadWorld((WorldClient) null);
return;
}
}else {
focusTimer = 100;
}
}
public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) {
@ -1082,8 +1072,6 @@ public class NetClientHandler extends NetHandler {
* Handle a keep alive packet.
*/
public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) {
//System.out.println(updateCounter - lastKeepAlive);
lastKeepAlive = updateCounter;
this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId));
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long