Update #50 - Bug fixes and shader improvements

This commit is contained in:
lax1dude
2025-02-22 16:52:35 -08:00
parent b0a2739fe1
commit 7e772e2502
133 changed files with 3064 additions and 2299 deletions

View File

@ -19,6 +19,7 @@ package net.lax1dude.eaglercraft.v1_8.sp.ipc;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class IPCPacket15Crashed implements IPCPacketBase {
@ -35,12 +36,17 @@ public class IPCPacket15Crashed implements IPCPacketBase {
@Override
public void deserialize(DataInput bin) throws IOException {
crashReport = bin.readUTF();
int len = bin.readInt();
byte[] bytes = new byte[len];
bin.readFully(bytes);
crashReport = new String(bytes, StandardCharsets.UTF_8);
}
@Override
public void serialize(DataOutput bin) throws IOException {
bin.writeUTF(crashReport);
byte[] bytes = crashReport.getBytes(StandardCharsets.UTF_8);
bin.writeInt(bytes.length);
bin.write(bytes);
}
@Override
@ -50,7 +56,7 @@ public class IPCPacket15Crashed implements IPCPacketBase {
@Override
public int size() {
return IPCPacketBase.strLen(crashReport);
return IPCPacketBase.strLen(crashReport) + 2;
}
}

View File

@ -66,6 +66,7 @@ public class RelayQueryImpl implements RelayQuery {
try {
connectionOpenedAt = EagRuntime.steadyTimeMillis();
s = PlatformNetworking.openWebSocketUnsafe(uri);
s.setEnableStringFrames(false);
}catch(Throwable t) {
connectionOpenedAt = 0l;
sock = null;
@ -79,10 +80,6 @@ public class RelayQueryImpl implements RelayQuery {
@Override
public void update() {
if(sock == null) return;
if(sock.availableStringFrames() > 0) {
logger.warn("[{}] discarding {} string frames recieved on a binary connection", uri, sock.availableStringFrames());
sock.clearStringFrames();
}
List<IWebSocketFrame> frames = sock.getNextBinaryFrames();
if(frames != null) {
for(int i = 0, l = frames.size(); i < l; ++i) {

View File

@ -51,6 +51,7 @@ public class RelayServerSocketImpl implements RelayServerSocket {
IWebSocketClient s;
try {
s = PlatformNetworking.openWebSocketUnsafe(uri);
s.setEnableStringFrames(false);
}catch(Throwable t) {
exceptions.add(t);
sock = null;
@ -63,10 +64,6 @@ public class RelayServerSocketImpl implements RelayServerSocket {
@Override
public void update() {
if(sock == null) return;
if(sock.availableStringFrames() > 0) {
logger.warn("[{}] discarding {} string frames recieved on a binary connection", uri, sock.availableStringFrames());
sock.clearStringFrames();
}
List<IWebSocketFrame> frames = sock.getNextBinaryFrames();
if(frames != null) {
for(int i = 0, l = frames.size(); i < l; ++i) {

View File

@ -62,6 +62,7 @@ public class RelayWorldsQueryImpl implements RelayWorldsQuery {
try {
openedAt = EagRuntime.steadyTimeMillis();
s = PlatformNetworking.openWebSocketUnsafe(uri);
s.setEnableStringFrames(false);
}catch(Throwable t) {
sock = null;
failed = true;
@ -73,10 +74,6 @@ public class RelayWorldsQueryImpl implements RelayWorldsQuery {
@Override
public void update() {
if(sock == null) return;
if(sock.availableStringFrames() > 0) {
logger.warn("[{}] discarding {} string frames recieved on a binary connection", uri, sock.availableStringFrames());
sock.clearStringFrames();
}
List<IWebSocketFrame> frames = sock.getNextBinaryFrames();
if(frames != null) {
for(int i = 0, l = frames.size(); i < l; ++i) {

View File

@ -87,7 +87,8 @@ public class EaglerIntegratedServerWorker {
}
}
}
if(ServerPlatformSingleplayer.isTabAboutToCloseWASM() && !isServerStopped()) {
if (!ServerPlatformSingleplayer.isSingleThreadMode() && ServerPlatformSingleplayer.isTabAboutToCloseWASM()
&& !isServerStopped()) {
logger.info("Autosaving worlds because the tab is about to close!");
currentProcess.getConfigurationManager().saveAllPlayerData();
currentProcess.saveAllWorlds(false);