Update #40 - FPS boost and fixed IndexOutOfBoundsException

This commit is contained in:
lax1dude
2024-10-19 16:52:27 -07:00
parent 85f4db5ac6
commit bcd575e87e
79 changed files with 1054 additions and 448 deletions

View File

@ -12,6 +12,7 @@ import java.util.Map.Entry;
import net.lax1dude.eaglercraft.v1_8.ArrayUtils;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
@ -441,10 +442,7 @@ public class ConnectionHandshake {
if(client.getState().isClosed()) {
return null;
}
try {
Thread.sleep(50l);
} catch (InterruptedException e) {
}
EagUtils.sleep(50);
if(EagRuntime.steadyTimeMillis() - millis > timeout) {
client.close();
return null;

View File

@ -144,9 +144,11 @@ public class GameProtocolMessageController {
pkt = sendQueueV4.remove(0);
sendFunction.sendPluginMessage(GamePluginMessageConstants.V4_CHANNEL, pkt);
}else {
int i, j, sendCount = 0, totalLen = 0;
int i, j, sendCount, totalLen;
PacketBuffer sendBuffer;
while(sendQueueV4.size() > 0) {
sendCount = 0;
totalLen = 0;
do {
i = sendQueueV4.get(sendCount++).readableBytes();
totalLen += GamePacketOutputBuffer.getVarIntSize(i) + i;