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:
parent
aaefa415e9
commit
a74740224f
|
@ -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;
|
||||
|
|
90753
javascript/classes.js
90753
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -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";
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,23 +79,16 @@ 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();
|
||||
this.disconnected = true;
|
||||
this.mc.loadWorld((WorldClient) null);
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
focusTimer = 100;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
Binary file not shown.
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
Loading…
Reference in New Issue
Block a user