22w13e Test fix to 'End of Stream', fixed ENTER on macOs, fixed stuck CTRL in copy

This commit is contained in:
LAX1DUDE 2022-04-01 14:53:34 -07:00
parent 436315c15e
commit 4f72bb5fd4
11 changed files with 59039 additions and 59008 deletions

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 = "22w13d";
public static final String version = "22w13e";
public static final String mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";

View File

@ -10,6 +10,7 @@ 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;
@ -79,6 +80,9 @@ 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) {

View File

@ -189,9 +189,9 @@ public class GuiScreen extends Gui {
return;
}
if (isMacOs && var1 == 28 && var2 == 0) {
var1 = 29;
}
//if (isMacOs && var1 == 28 && var2 == 0) {
// var1 = 29;
//}
this.keyTyped(var2, var1);
}

View File

@ -44,8 +44,8 @@ public class NetClientHandler extends NetHandler {
public List playerInfoList = new ArrayList();
public int currentServerMaxPlayers = 20;
private GuiScreen field_98183_l = null;
private int updateCounter = 0;
private int lastKeepAlive = 0;
public int updateCounter = 0;
public int lastKeepAlive = 0;
private int focusTimer = 0;
/** RNG. */
@ -83,9 +83,14 @@ public class NetClientHandler extends NetHandler {
*/
public void processReadPackets() {
++this.updateCounter;
if (!this.disconnected && this.netManager != null) {
this.netManager.processReadPackets();
}
if(EaglerAdapter.isFocused()) {
--focusTimer;
if((focusTimer < 0 && updateCounter - lastKeepAlive > 200) || !EaglerAdapter.connectionOpen()) {
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;
@ -93,14 +98,7 @@ public class NetClientHandler extends NetHandler {
return;
}
}else {
focusTimer = 60;
}
if (!this.disconnected && this.netManager != null) {
this.netManager.processReadPackets();
}
if (this.netManager != null) {
this.netManager.wakeThreads();
focusTimer = 100;
}
}

View File

@ -1612,9 +1612,13 @@ public class EaglerAdapterImpl2 {
public static native String getClipboard();
private static void getClipboard(final AsyncCallback<String> cb) {
final long start = System.currentTimeMillis();
getClipboard0(new StupidFunctionResolveString() {
@Override
public void resolveStr(String s) {
if(System.currentTimeMillis() - start > 500l) {
keyStates[28] = false; //un-press ctrl
}
cb.complete(s);
}
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long