mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #24 - 1000s of optimizations, shared worlds on desktop
This commit is contained in:
@ -12,17 +12,14 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftSoundManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.ipc.*;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -475,7 +472,8 @@ public class SingleplayerServerController implements ISaveFormat {
|
||||
private static void loadSaveComparators() {
|
||||
saveListMap.clear();
|
||||
saveListCache.clear();
|
||||
for(NBTTagCompound nbt : saveListNBT) {
|
||||
for(int j = 0, l = saveListNBT.size(); j < l; ++j) {
|
||||
NBTTagCompound nbt = saveListNBT.get(j);
|
||||
String folderName = nbt.getString("folderNameEagler");
|
||||
if(!StringUtils.isEmpty(folderName)) {
|
||||
WorldInfo worldinfo = new WorldInfo(nbt.getCompoundTag("Data"));
|
||||
|
@ -118,7 +118,7 @@ public class GuiScreenBackupWorldSelection extends GuiScreen {
|
||||
public void confirmClicked(boolean par1, int par2) {
|
||||
if(par1) {
|
||||
SingleplayerServerController.clearPlayerData(worldName);
|
||||
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.clearplayers", "singleplayer.failed.clearplayers", () -> SingleplayerServerController.isReady()));
|
||||
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.clearplayers", "singleplayer.failed.clearplayers", SingleplayerServerController::isReady));
|
||||
}else {
|
||||
mc.displayGuiScreen(this);
|
||||
}
|
||||
|
@ -46,11 +46,13 @@ public class GuiScreenConnectOption extends GuiScreen {
|
||||
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if(par1GuiButton.id == 0) {
|
||||
guiScreen.cancelDirectConnect();
|
||||
mc.displayGuiScreen(guiScreen);
|
||||
}else if(par1GuiButton.id == 1) {
|
||||
mc.displayGuiScreen(new GuiScreenServerList(guiScreen, guiScreen.getSelectedServer()));
|
||||
}else if(par1GuiButton.id == 2) {
|
||||
if(LANServerController.supported()) {
|
||||
guiScreen.cancelDirectConnect();
|
||||
mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenLANConnect(guiScreen)));
|
||||
}else {
|
||||
mc.displayGuiScreen(new GuiScreenLANNotSupported(this));
|
||||
|
@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8.sp.gui;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCreateWorld;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.world.demo.DemoWorldServer;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.gui;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult;
|
||||
@ -61,7 +59,7 @@ public class GuiScreenNameWorldImport extends GuiScreen {
|
||||
if(definetlyTimeToImport && !isImporting) {
|
||||
isImporting = true;
|
||||
SingleplayerServerController.importWorld(GuiCreateWorld.func_146317_a(mc.getSaveLoader(), this.theGuiTextField.getText().trim()), world.fileData, importFormat, (byte) ((loadSpawnChunks ? 2 : 0) | (enhancedGameRules ? 1 : 0)));
|
||||
mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen, "singleplayer.busy.importing." + (importFormat + 1), "singleplayer.failed.importing." + (importFormat + 1), () -> SingleplayerServerController.isReady()));
|
||||
mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen, "singleplayer.busy.importing." + (importFormat + 1), "singleplayer.failed.importing." + (importFormat + 1), SingleplayerServerController::isReady));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class GuiShareToLan extends GuiScreen {
|
||||
}
|
||||
this.mc.displayGuiScreen(null);
|
||||
LoadingScreenRenderer ls = mc.loadingScreen;
|
||||
String code = LANServerController.shareToLAN((str) -> ls.resetProgressAndMessage(str), worldName, hiddenToggle);
|
||||
String code = LANServerController.shareToLAN(ls::resetProgressAndMessage, worldName, hiddenToggle);
|
||||
if (code != null) {
|
||||
SingleplayerServerController.configureLAN(WorldSettings.GameType.getByName(this.gameMode), this.allowCommands);
|
||||
this.mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(I18n.format("lanServer.opened")
|
||||
|
@ -39,8 +39,8 @@ public class IPCPacket14StringList implements IPCPacketBase {
|
||||
|
||||
public IPCPacket14StringList(int opcode, String[] list) {
|
||||
stringList = new ArrayList();
|
||||
for(String s : list) {
|
||||
s = s.trim();
|
||||
for(int i = 0; i < list.length; ++i) {
|
||||
String s = list[i].trim();
|
||||
if(s.length() > 0) {
|
||||
stringList.add(s);
|
||||
}
|
||||
@ -50,8 +50,8 @@ public class IPCPacket14StringList implements IPCPacketBase {
|
||||
|
||||
public IPCPacket14StringList(int opcode, List<String> list) {
|
||||
stringList = new ArrayList();
|
||||
for(String s : list) {
|
||||
s = s.trim();
|
||||
for(int i = 0, l = list.size(); i < l; ++i) {
|
||||
String s = list.get(i).trim();
|
||||
if(s.length() > 0) {
|
||||
stringList.add(s);
|
||||
}
|
||||
@ -72,9 +72,10 @@ public class IPCPacket14StringList implements IPCPacketBase {
|
||||
@Override
|
||||
public void serialize(DataOutput bin) throws IOException {
|
||||
bin.writeByte(opCode);
|
||||
bin.writeInt(stringList.size());
|
||||
for(String str : stringList) {
|
||||
bin.writeUTF(str);
|
||||
int l = stringList.size();
|
||||
bin.writeInt(l);
|
||||
for(int i = 0; i < l; ++i) {
|
||||
bin.writeUTF(stringList.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,8 +87,8 @@ public class IPCPacket14StringList implements IPCPacketBase {
|
||||
@Override
|
||||
public int size() {
|
||||
int len = 5;
|
||||
for(String str : stringList) {
|
||||
len += IPCPacketBase.strLen(str);
|
||||
for(int i = 0, l = stringList.size(); i < l; ++i) {
|
||||
len += IPCPacketBase.strLen(stringList.get(i));
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
@ -3,9 +3,6 @@ package net.lax1dude.eaglercraft.v1_8.sp.ipc;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023-2024 lax1dude. All Rights Reserved.
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.ipc;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutput;
|
||||
@ -11,6 +9,8 @@ import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@ -54,7 +54,7 @@ public class IPCPacket16NBTList implements IPCPacketBase {
|
||||
for(int i = 0, size = list.size(); i < size; ++i) {
|
||||
NBTTagCompound tag = list.get(i);
|
||||
try {
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bao = new EaglerOutputStream();
|
||||
CompressedStreamTools.write(tag, new DataOutputStream(bao));
|
||||
tagList.add(bao.toByteArray());
|
||||
}catch(IOException e) {
|
||||
@ -75,7 +75,7 @@ public class IPCPacket16NBTList implements IPCPacketBase {
|
||||
bin.readFully(toRead);
|
||||
tagList.add(toRead);
|
||||
try {
|
||||
nbtTagList.add(CompressedStreamTools.read(new DataInputStream(new ByteArrayInputStream(toRead))));
|
||||
nbtTagList.add(CompressedStreamTools.read(new DataInputStream(new EaglerInputStream(toRead))));
|
||||
}catch(IOException e) {
|
||||
System.err.println("Failed to read tag #" + i + " in IPCPacket16NBTList");
|
||||
}
|
||||
@ -85,8 +85,10 @@ public class IPCPacket16NBTList implements IPCPacketBase {
|
||||
@Override
|
||||
public void serialize(DataOutput bin) throws IOException {
|
||||
bin.writeInt(opCode);
|
||||
bin.writeInt(tagList.size());
|
||||
for(byte[] str : tagList) {
|
||||
int l = tagList.size();
|
||||
bin.writeInt(l);
|
||||
for(int i = 0; i < l; ++i) {
|
||||
byte[] str = tagList.get(i);
|
||||
bin.writeInt(str.length);
|
||||
bin.write(str);
|
||||
}
|
||||
@ -100,9 +102,9 @@ public class IPCPacket16NBTList implements IPCPacketBase {
|
||||
@Override
|
||||
public int size() {
|
||||
int len = 8;
|
||||
for(byte[] str : tagList) {
|
||||
for(int i = 0, l = tagList.size(); i < l; ++i) {
|
||||
len += 4;
|
||||
len += str.length;
|
||||
len += tagList.get(i).length;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
@ -32,32 +32,32 @@ public class IPCPacketManager {
|
||||
public static final DataOutputStream IPC_DATA_OUTPUT_STREAM = new DataOutputStream(IPC_OUTPUT_STREAM);
|
||||
|
||||
static {
|
||||
mappings.put(IPCPacket00StartServer.ID, () -> new IPCPacket00StartServer());
|
||||
mappings.put(IPCPacket01StopServer.ID, () -> new IPCPacket01StopServer());
|
||||
mappings.put(IPCPacket02InitWorld.ID, () -> new IPCPacket02InitWorld());
|
||||
mappings.put(IPCPacket03DeleteWorld.ID, () -> new IPCPacket03DeleteWorld());
|
||||
mappings.put(IPCPacket05RequestData.ID, () -> new IPCPacket05RequestData());
|
||||
mappings.put(IPCPacket06RenameWorldNBT.ID, () -> new IPCPacket06RenameWorldNBT());
|
||||
mappings.put(IPCPacket07ImportWorld.ID, () -> new IPCPacket07ImportWorld());
|
||||
mappings.put(IPCPacket09RequestResponse.ID, () -> new IPCPacket09RequestResponse());
|
||||
mappings.put(IPCPacket0ASetWorldDifficulty.ID, () -> new IPCPacket0ASetWorldDifficulty());
|
||||
mappings.put(IPCPacket0BPause.ID, () -> new IPCPacket0BPause());
|
||||
mappings.put(IPCPacket0CPlayerChannel.ID, () -> new IPCPacket0CPlayerChannel());
|
||||
mappings.put(IPCPacket0DProgressUpdate.ID, () -> new IPCPacket0DProgressUpdate());
|
||||
mappings.put(IPCPacket0EListWorlds.ID, () -> new IPCPacket0EListWorlds());
|
||||
mappings.put(IPCPacket0FListFiles.ID, () -> new IPCPacket0FListFiles());
|
||||
mappings.put(IPCPacket10FileRead.ID, () -> new IPCPacket10FileRead());
|
||||
mappings.put(IPCPacket12FileWrite.ID, () -> new IPCPacket12FileWrite());
|
||||
mappings.put(IPCPacket13FileCopyMove.ID, () -> new IPCPacket13FileCopyMove());
|
||||
mappings.put(IPCPacket14StringList.ID, () -> new IPCPacket14StringList());
|
||||
mappings.put(IPCPacket15Crashed.ID, () -> new IPCPacket15Crashed());
|
||||
mappings.put(IPCPacket16NBTList.ID, () -> new IPCPacket16NBTList());
|
||||
mappings.put(IPCPacket17ConfigureLAN.ID, () -> new IPCPacket17ConfigureLAN());
|
||||
mappings.put(IPCPacket18ClearPlayers.ID, () -> new IPCPacket18ClearPlayers());
|
||||
mappings.put(IPCPacket19Autosave.ID, () -> new IPCPacket19Autosave());
|
||||
mappings.put(IPCPacket20LoggerMessage.ID, () -> new IPCPacket20LoggerMessage());
|
||||
mappings.put(IPCPacket21EnableLogging.ID, () -> new IPCPacket21EnableLogging());
|
||||
mappings.put(IPCPacketFFProcessKeepAlive.ID, () -> new IPCPacketFFProcessKeepAlive());
|
||||
mappings.put(IPCPacket00StartServer.ID, IPCPacket00StartServer::new);
|
||||
mappings.put(IPCPacket01StopServer.ID, IPCPacket01StopServer::new);
|
||||
mappings.put(IPCPacket02InitWorld.ID, IPCPacket02InitWorld::new);
|
||||
mappings.put(IPCPacket03DeleteWorld.ID, IPCPacket03DeleteWorld::new);
|
||||
mappings.put(IPCPacket05RequestData.ID, IPCPacket05RequestData::new);
|
||||
mappings.put(IPCPacket06RenameWorldNBT.ID, IPCPacket06RenameWorldNBT::new);
|
||||
mappings.put(IPCPacket07ImportWorld.ID, IPCPacket07ImportWorld::new);
|
||||
mappings.put(IPCPacket09RequestResponse.ID, IPCPacket09RequestResponse::new);
|
||||
mappings.put(IPCPacket0ASetWorldDifficulty.ID, IPCPacket0ASetWorldDifficulty::new);
|
||||
mappings.put(IPCPacket0BPause.ID, IPCPacket0BPause::new);
|
||||
mappings.put(IPCPacket0CPlayerChannel.ID, IPCPacket0CPlayerChannel::new);
|
||||
mappings.put(IPCPacket0DProgressUpdate.ID, IPCPacket0DProgressUpdate::new);
|
||||
mappings.put(IPCPacket0EListWorlds.ID, IPCPacket0EListWorlds::new);
|
||||
mappings.put(IPCPacket0FListFiles.ID, IPCPacket0FListFiles::new);
|
||||
mappings.put(IPCPacket10FileRead.ID, IPCPacket10FileRead::new);
|
||||
mappings.put(IPCPacket12FileWrite.ID, IPCPacket12FileWrite::new);
|
||||
mappings.put(IPCPacket13FileCopyMove.ID, IPCPacket13FileCopyMove::new);
|
||||
mappings.put(IPCPacket14StringList.ID, IPCPacket14StringList::new);
|
||||
mappings.put(IPCPacket15Crashed.ID, IPCPacket15Crashed::new);
|
||||
mappings.put(IPCPacket16NBTList.ID, IPCPacket16NBTList::new);
|
||||
mappings.put(IPCPacket17ConfigureLAN.ID, IPCPacket17ConfigureLAN::new);
|
||||
mappings.put(IPCPacket18ClearPlayers.ID, IPCPacket18ClearPlayers::new);
|
||||
mappings.put(IPCPacket19Autosave.ID, IPCPacket19Autosave::new);
|
||||
mappings.put(IPCPacket20LoggerMessage.ID, IPCPacket20LoggerMessage::new);
|
||||
mappings.put(IPCPacket21EnableLogging.ID, IPCPacket21EnableLogging::new);
|
||||
mappings.put(IPCPacketFFProcessKeepAlive.ID, IPCPacketFFProcessKeepAlive::new);
|
||||
}
|
||||
|
||||
public static byte[] IPCSerialize(IPCPacketBase pkt) throws IOException {
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.lan;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerZLIB;
|
||||
import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
@ -17,7 +19,6 @@ import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
@ -299,7 +300,8 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
|
||||
if(packets == null) {
|
||||
return;
|
||||
}
|
||||
for(byte[] data : packets) {
|
||||
for(int k = 0, l = packets.size(); k < l; ++k) {
|
||||
byte[] data = packets.get(k);
|
||||
byte[] fullData;
|
||||
boolean compressed = false;
|
||||
|
||||
@ -336,11 +338,14 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
|
||||
if(fullData.length < 4) {
|
||||
throw new IOException("Recieved invalid " + fullData.length + " byte compressed packet");
|
||||
}
|
||||
ByteArrayInputStream bi = new ByteArrayInputStream(fullData);
|
||||
EaglerInputStream bi = new EaglerInputStream(fullData);
|
||||
int i = (bi.read() << 24) | (bi.read() << 16) | (bi.read() << 8) | bi.read();
|
||||
InputStream inflaterInputStream = EaglerZLIB.newInflaterInputStream(bi);
|
||||
fullData = new byte[i];
|
||||
inflaterInputStream.read(fullData);
|
||||
int r = IOUtils.readFully(inflaterInputStream, fullData);
|
||||
if (i != r) {
|
||||
logger.warn("Decompressed packet expected size {} differs from actual size {}!", i, r);
|
||||
}
|
||||
}
|
||||
|
||||
if(firstPacket) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.relay;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
@ -9,6 +9,9 @@ import java.util.function.Consumer;
|
||||
|
||||
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.ThreadLocalRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket;
|
||||
@ -42,8 +45,46 @@ public class RelayManager {
|
||||
|
||||
private final List<RelayServer> relays = new ArrayList();
|
||||
private long lastPingThrough = 0l;
|
||||
|
||||
public void load(NBTTagList relayConfig) {
|
||||
|
||||
public void load(byte[] relayConfig) {
|
||||
NBTTagCompound relays = null;
|
||||
if(relayConfig != null) {
|
||||
try {
|
||||
relays = CompressedStreamTools.readCompressed(new EaglerInputStream(relayConfig));
|
||||
} catch (IOException ex) {
|
||||
}
|
||||
}
|
||||
if(relays != null && relays.hasKey("relays", 9)) {
|
||||
load(relays.getTagList("relays", 10));
|
||||
if(!relays.getBoolean("f")) {
|
||||
fixBullshit();
|
||||
}
|
||||
}else {
|
||||
sort(); // loads defaults
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
// versions pre-u24 always have "relay.deev.is" as primary due to a glitch
|
||||
// this function is intended to randomize the list if that is detected
|
||||
private void fixBullshit() {
|
||||
if(!relays.isEmpty()) {
|
||||
for(int i = 0, l = relays.size(); i < l; ++i) {
|
||||
RelayServer rs = relays.get(i);
|
||||
if(rs.address.equalsIgnoreCase("wss://relay.deev.is/") && !rs.isPrimary()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for(int i = 0, l = relays.size(); i < l; ++i) {
|
||||
relays.get(i).setPrimary(false);
|
||||
}
|
||||
relays.get(ThreadLocalRandom.current().nextInt(relays.size())).setPrimary(true);
|
||||
sort();
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
private void load(NBTTagList relayConfig) {
|
||||
relays.clear();
|
||||
if(relayConfig != null && relayConfig.tagCount() > 0) {
|
||||
boolean gotAPrimary = false;
|
||||
@ -64,6 +105,16 @@ public class RelayManager {
|
||||
}
|
||||
|
||||
public void save() {
|
||||
if(relays.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
byte[] data = write();
|
||||
if(data != null) {
|
||||
EagRuntime.setStorage("r", data);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] write() {
|
||||
try {
|
||||
NBTTagList lst = new NBTTagList();
|
||||
for(int i = 0, l = relays.size(); i < l; ++i) {
|
||||
@ -77,17 +128,25 @@ public class RelayManager {
|
||||
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
nbttagcompound.setTag("relays", lst);
|
||||
nbttagcompound.setBoolean("f", true);
|
||||
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bao = new EaglerOutputStream();
|
||||
CompressedStreamTools.writeCompressed(nbttagcompound, bao);
|
||||
EagRuntime.setStorage("r", bao.toByteArray());
|
||||
return bao.toByteArray();
|
||||
} catch (Exception exception) {
|
||||
logger.error("Couldn\'t save relay list!");
|
||||
logger.error(exception);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void sort() {
|
||||
if(relays.isEmpty()) {
|
||||
List<RelayEntry> defaultRelays = EagRuntime.getConfiguration().getRelays();
|
||||
for(int i = 0, l = defaultRelays.size(); i < l; ++i) {
|
||||
relays.add(new RelayServer(defaultRelays.get(i)));
|
||||
}
|
||||
}
|
||||
if(relays.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@ -315,16 +374,17 @@ public class RelayManager {
|
||||
}
|
||||
|
||||
public void loadDefaults() {
|
||||
int setPrimary = relays.size();
|
||||
eee: for(RelayEntry etr : EagRuntime.getConfiguration().getRelays()) {
|
||||
for(RelayServer exEtr : relays) {
|
||||
if(exEtr.address.equalsIgnoreCase(etr.address)) {
|
||||
List<RelayEntry> defaultRelays = EagRuntime.getConfiguration().getRelays();
|
||||
eee: for(int i = 0, l = defaultRelays.size(); i < l; ++i) {
|
||||
RelayEntry etr = defaultRelays.get(i);
|
||||
for(int j = 0, l2 = relays.size(); j < l2; ++j) {
|
||||
if(relays.get(j).address.equalsIgnoreCase(etr.address)) {
|
||||
continue eee;
|
||||
}
|
||||
}
|
||||
relays.add(new RelayServer(etr));
|
||||
}
|
||||
setPrimary(setPrimary);
|
||||
sort();
|
||||
}
|
||||
|
||||
public String makeNewRelayName() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -9,6 +8,7 @@ import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
|
||||
@ -73,8 +73,8 @@ public class IPacket {
|
||||
Integer i = definedPacketIds.get(packet.getClass());
|
||||
if(i != null) {
|
||||
int len = packet.packetLength();
|
||||
ByteArrayOutputStream bao = len == -1 ? new ByteArrayOutputStream() :
|
||||
new ByteArrayOutputStream(len + 1);
|
||||
EaglerOutputStream bao = len == -1 ? new EaglerOutputStream() :
|
||||
new EaglerOutputStream(len + 1);
|
||||
bao.write(i);
|
||||
packet.write(new DataOutputStream(bao));
|
||||
byte[] ret = bao.toByteArray();
|
||||
|
@ -88,8 +88,8 @@ public class EaglerIntegratedServerWorker {
|
||||
|
||||
public static void tick() {
|
||||
List<IntegratedServerPlayerNetworkManager> ocs = new ArrayList<>(openChannels.values());
|
||||
for(IntegratedServerPlayerNetworkManager i : ocs) {
|
||||
i.tick();
|
||||
for(int i = 0, l = ocs.size(); i < l; ++i) {
|
||||
ocs.get(i).tick();
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,8 +147,8 @@ public class EaglerIntegratedServerWorker {
|
||||
EaglerSaveFormat.worldsList.setAllChars(pkt.worldName);
|
||||
}else {
|
||||
boolean found = false;
|
||||
for(String s : worlds) {
|
||||
if(s.equals(pkt.worldName)) {
|
||||
for(int i = 0; i < worlds.length; ++i) {
|
||||
if(worlds[i].equals(pkt.worldName)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@ -196,7 +196,8 @@ public class EaglerIntegratedServerWorker {
|
||||
String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines();
|
||||
if(worldsTxt != null) {
|
||||
List<String> newWorlds = new ArrayList();
|
||||
for(String str : worldsTxt) {
|
||||
for(int i = 0; i < worldsTxt.length; ++i) {
|
||||
String str = worldsTxt[i];
|
||||
if(!str.equalsIgnoreCase(pkt.worldName)) {
|
||||
newWorlds.add(str);
|
||||
}
|
||||
|
@ -90,7 +90,9 @@ public class EaglerSaveFormat extends SaveFormatOld {
|
||||
int totalSize = 0;
|
||||
int lastUpdate = 0;
|
||||
final VFile2 finalNewFolder = newFolder;
|
||||
for(VFile2 vf : oldFolder.listFiles(true)) {
|
||||
List<VFile2> vfl = oldFolder.listFiles(true);
|
||||
for(int i = 0, l = vfl.size(); i < l; ++i) {
|
||||
VFile2 vf = vfl.get(i);
|
||||
String fileNameRelative = vf.getPath().substring(oldPath.length() + 1);
|
||||
totalSize += VFile2.copyFile(vf, new VFile2(finalNewFolder, fileNameRelative));
|
||||
if (totalSize - lastUpdate > 10000) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.server.export;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@ -9,6 +8,7 @@ import java.util.Date;
|
||||
import java.util.zip.CRC32;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||
@ -27,13 +27,13 @@ import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
*/
|
||||
public class EPKCompiler {
|
||||
|
||||
private final ByteArrayOutputStream os;
|
||||
private final EaglerOutputStream os;
|
||||
private final CRC32 checkSum = new CRC32();
|
||||
private int lengthIntegerOffset = 0;
|
||||
private int totalFileCount = 0;
|
||||
|
||||
public EPKCompiler(String name, String owner, String type) {
|
||||
os = new ByteArrayOutputStream(0x200000);
|
||||
os = new EaglerOutputStream(0x200000);
|
||||
try {
|
||||
|
||||
os.write(new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36}); // EAGPKG$$
|
||||
|
@ -7,6 +7,7 @@ import java.util.Arrays;
|
||||
import java.util.zip.CRC32;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerZLIB;
|
||||
import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||
@ -46,7 +47,7 @@ public class EPKDecompiler {
|
||||
in2 = new ByteArrayInputStream(data);
|
||||
|
||||
byte[] header = new byte[8];
|
||||
in2.read(header);
|
||||
IOUtils.readFully(in2, header);
|
||||
|
||||
if(Arrays.equals(header, new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36})) {
|
||||
byte[] endCode = new byte[] { (byte)':', (byte)':', (byte)':', (byte)'Y',
|
||||
@ -63,10 +64,10 @@ public class EPKDecompiler {
|
||||
if(!vers.startsWith("ver2.")) {
|
||||
throw new IOException("Unknown or invalid EPK version: " + vers);
|
||||
}
|
||||
|
||||
is.skip(is.read()); // skip filename
|
||||
is.skip(loadShort(is)); // skip comment
|
||||
is.skip(8); // skip millis date
|
||||
|
||||
IOUtils.skipFully(is, is.read()); // skip filename
|
||||
IOUtils.skipFully(is, loadShort(is)); // skip comment
|
||||
IOUtils.skipFully(is, 8); // skip millis date
|
||||
|
||||
numFiles = loadInt(is);
|
||||
|
||||
@ -101,7 +102,7 @@ public class EPKDecompiler {
|
||||
}
|
||||
|
||||
byte[] typeBytes = new byte[4];
|
||||
zis.read(typeBytes);
|
||||
IOUtils.readFully(zis, typeBytes);
|
||||
String type = readASCII(typeBytes);
|
||||
|
||||
if(numFiles == 0) {
|
||||
@ -126,7 +127,7 @@ public class EPKDecompiler {
|
||||
int loadedCrc = loadInt(zis);
|
||||
|
||||
data = new byte[len - 5];
|
||||
zis.read(data);
|
||||
IOUtils.readFully(zis, data);
|
||||
|
||||
crc32.reset();
|
||||
crc32.update(data, 0, data.length);
|
||||
@ -139,7 +140,7 @@ public class EPKDecompiler {
|
||||
}
|
||||
}else {
|
||||
data = new byte[len];
|
||||
zis.read(data);
|
||||
IOUtils.readFully(zis, data);
|
||||
}
|
||||
|
||||
if(zis.read() != '>') {
|
||||
@ -152,11 +153,11 @@ public class EPKDecompiler {
|
||||
}
|
||||
}
|
||||
|
||||
private static final int loadShort(InputStream is) throws IOException {
|
||||
public static final int loadShort(InputStream is) throws IOException {
|
||||
return (is.read() << 8) | is.read();
|
||||
}
|
||||
|
||||
private static final int loadInt(InputStream is) throws IOException {
|
||||
public static final int loadInt(InputStream is) throws IOException {
|
||||
return (is.read() << 24) | (is.read() << 16) | (is.read() << 8) | is.read();
|
||||
}
|
||||
|
||||
@ -168,7 +169,7 @@ public class EPKDecompiler {
|
||||
return new String(charIn);
|
||||
}
|
||||
|
||||
private static final String readASCII(InputStream bytesIn) throws IOException {
|
||||
public static final String readASCII(InputStream bytesIn) throws IOException {
|
||||
int len = bytesIn.read();
|
||||
char[] charIn = new char[len];
|
||||
for(int i = 0; i < len; ++i) {
|
||||
|
@ -1,9 +1,10 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.server.export;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
@ -62,10 +63,10 @@ public class WorldConverterEPK {
|
||||
}
|
||||
if(f.type.equals("FILE")) {
|
||||
if(f.name.equals("level.dat") || f.name.equals("level.dat_old")) {
|
||||
NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b));
|
||||
NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b));
|
||||
worldDatNBT.getCompoundTag("Data").setString("LevelName", newName);
|
||||
worldDatNBT.getCompoundTag("Data").setLong("LastPlayed", System.currentTimeMillis());
|
||||
ByteArrayOutputStream tmp = new ByteArrayOutputStream();
|
||||
EaglerOutputStream tmp = new EaglerOutputStream();
|
||||
CompressedStreamTools.writeCompressed(worldDatNBT, tmp);
|
||||
b = tmp.toByteArray();
|
||||
}
|
||||
@ -109,7 +110,9 @@ public class WorldConverterEPK {
|
||||
final int[] lastUpdate = new int[1];
|
||||
EPKCompiler c = new EPKCompiler(realWorldName, worldOwner, "epk/world188");
|
||||
String pfx = worldDir.getPath();
|
||||
for(VFile2 vf : worldDir.listFiles(true)) {
|
||||
List<VFile2> filesList = worldDir.listFiles(true);
|
||||
for(int i = 0, l = filesList.size(); i < l; ++i) {
|
||||
VFile2 vf = filesList.get(i);
|
||||
++filesWritten[0];
|
||||
byte[] b = vf.getAllBytes();
|
||||
c.append(vf.getPath().substring(pfx.length() + 1), b);
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.server.export;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -13,6 +11,8 @@ import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
@ -50,7 +50,7 @@ public class WorldConverterMCA {
|
||||
folderName += "_";
|
||||
worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
||||
}
|
||||
ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(archiveContents));
|
||||
ZipInputStream zis = new ZipInputStream(new EaglerInputStream(archiveContents));
|
||||
ZipEntry folderNameFile = null;
|
||||
List<char[]> fileNames = new ArrayList<>();
|
||||
while((folderNameFile = zis.getNextEntry()) != null) {
|
||||
@ -63,7 +63,7 @@ public class WorldConverterMCA {
|
||||
final int[] i = new int[] { 0 };
|
||||
while(fileNames.get(0).length > i[0] && fileNames.stream().allMatch(w -> w[i[0]] == fileNames.get(0)[i[0]])) i[0]++;
|
||||
int folderPrefixOffset = i[0];
|
||||
zis = new ZipInputStream(new ByteArrayInputStream(archiveContents));
|
||||
zis = new ZipInputStream(new EaglerInputStream(archiveContents));
|
||||
ZipEntry f = null;
|
||||
int lastProgUpdate = 0;
|
||||
int prog = 0;
|
||||
@ -73,7 +73,7 @@ public class WorldConverterMCA {
|
||||
if (f.isDirectory()) continue;
|
||||
String lowerName = f.getName().toLowerCase();
|
||||
if (!(lowerName.endsWith(".dat") || lowerName.endsWith(".dat_old") || lowerName.endsWith(".mca") || lowerName.endsWith(".mcr") || lowerName.endsWith(".bmp"))) continue;
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
EaglerOutputStream baos = new EaglerOutputStream();
|
||||
int len;
|
||||
while ((len = zis.read(bb)) != -1) {
|
||||
baos.write(bb, 0, len);
|
||||
@ -82,7 +82,7 @@ public class WorldConverterMCA {
|
||||
byte[] b = baos.toByteArray();
|
||||
String fileName = f.getName().substring(folderPrefixOffset);
|
||||
if (fileName.equals("level.dat") || fileName.equals("level.dat_old")) {
|
||||
NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b));
|
||||
NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b));
|
||||
|
||||
NBTTagCompound gameRulesNBT = worldDatNBT.getCompoundTag("Data").getCompoundTag("GameRules");
|
||||
gameRulesNBT.setString("loadSpawnChunks", (gameRules & 2) != 0 ? "true" : "false");
|
||||
@ -96,7 +96,7 @@ public class WorldConverterMCA {
|
||||
|
||||
worldDatNBT.getCompoundTag("Data").setString("LevelName", newName);
|
||||
worldDatNBT.getCompoundTag("Data").setLong("LastPlayed", System.currentTimeMillis());
|
||||
ByteArrayOutputStream bo = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bo = new EaglerOutputStream();
|
||||
CompressedStreamTools.writeCompressed(worldDatNBT, bo);
|
||||
b = bo.toByteArray();
|
||||
VFile2 ff = new VFile2(worldDir, fileName);
|
||||
@ -129,7 +129,7 @@ public class WorldConverterMCA {
|
||||
logger.error("{}: Chunk already exists: {}", fileName, chunkOut.getPath());
|
||||
continue;
|
||||
}
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bao = new EaglerOutputStream();
|
||||
CompressedStreamTools.writeCompressed(chunkNBT, bao);
|
||||
b = bao.toByteArray();
|
||||
chunkOut.setAllBytes(b);
|
||||
@ -171,7 +171,7 @@ public class WorldConverterMCA {
|
||||
}
|
||||
|
||||
public static byte[] exportWorld(String folderName) throws IOException {
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bao = new EaglerOutputStream();
|
||||
ZipOutputStream zos = new ZipOutputStream(bao);
|
||||
zos.setComment("contains backup of world '" + folderName + "'");
|
||||
VFile2 worldFolder = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
||||
@ -209,12 +209,13 @@ public class WorldConverterMCA {
|
||||
String regionFolder = folderName + dstFolderNames[i];
|
||||
logger.info("Converting chunks in \"{}\" as MCA to \"{}\"...", vf.getPath(), regionFolder);
|
||||
Map<String,RegionFile> regionFiles = new HashMap();
|
||||
for(VFile2 chunkFile : fileList) {
|
||||
for(int k = 0, l = fileList.size(); k < l; ++k) {
|
||||
VFile2 chunkFile = fileList.get(k);
|
||||
NBTTagCompound chunkNBT;
|
||||
NBTTagCompound chunkLevel;
|
||||
try {
|
||||
b = chunkFile.getAllBytes();
|
||||
chunkNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b));
|
||||
chunkNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b));
|
||||
if(!chunkNBT.hasKey("Level", 10)) {
|
||||
throw new IOException("Chunk is missing level data!");
|
||||
}
|
||||
@ -258,7 +259,8 @@ public class WorldConverterMCA {
|
||||
}
|
||||
logger.info("Copying extra world data...");
|
||||
fileList = (new VFile2(worldFolder, "data")).listFiles(false);
|
||||
for(VFile2 dataFile : fileList) {
|
||||
for(int k = 0, l = fileList.size(); k < l; ++k) {
|
||||
VFile2 dataFile = fileList.get(k);
|
||||
zos.putNextEntry(new ZipEntry(folderName + "/data/" + dataFile.getName()));
|
||||
b = dataFile.getAllBytes();
|
||||
zos.write(b);
|
||||
@ -269,7 +271,8 @@ public class WorldConverterMCA {
|
||||
}
|
||||
}
|
||||
fileList = (new VFile2(worldFolder, "players")).listFiles(false);
|
||||
for(VFile2 dataFile : fileList) {
|
||||
for(int k = 0, l = fileList.size(); k < l; ++k) {
|
||||
VFile2 dataFile = fileList.get(k);
|
||||
zos.putNextEntry(new ZipEntry(folderName + "/players/" + dataFile.getName()));
|
||||
b = dataFile.getAllBytes();
|
||||
zos.write(b);
|
||||
@ -280,7 +283,8 @@ public class WorldConverterMCA {
|
||||
}
|
||||
}
|
||||
fileList = (new VFile2(worldFolder, "eagler/skulls")).listFiles(false);
|
||||
for(VFile2 dataFile : fileList) {
|
||||
for(int k = 0, l = fileList.size(); k < l; ++k) {
|
||||
VFile2 dataFile = fileList.get(k);
|
||||
zos.putNextEntry(new ZipEntry(folderName + "/eagler/skulls/" + dataFile.getName()));
|
||||
b = dataFile.getAllBytes();
|
||||
zos.write(b);
|
||||
|
@ -1,12 +1,12 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.sp.server.socket;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerZLIB;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
|
||||
@ -48,7 +48,7 @@ public class IntegratedServerPlayerNetworkManager {
|
||||
public final String playerChannel;
|
||||
private EnumConnectionState packetState = EnumConnectionState.HANDSHAKING;
|
||||
private static PacketBuffer temporaryBuffer;
|
||||
private static ByteArrayOutputStream temporaryOutputStream;
|
||||
private static EaglerOutputStream temporaryOutputStream;
|
||||
private int debugPacketCounter = 0;
|
||||
private byte[][] recievedPacketBuffer = new byte[16384][];
|
||||
private int recievedPacketBufferCounter = 0;
|
||||
@ -71,7 +71,7 @@ public class IntegratedServerPlayerNetworkManager {
|
||||
this.enableSendCompression = !SingleplayerServerController.PLAYER_CHANNEL.equals(playerChannel);
|
||||
if(this.enableSendCompression) {
|
||||
if(temporaryOutputStream == null) {
|
||||
temporaryOutputStream = new ByteArrayOutputStream(16386);
|
||||
temporaryOutputStream = new EaglerOutputStream(16386);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -115,7 +115,7 @@ public class IntegratedServerPlayerNetworkManager {
|
||||
if(enableSendCompression) {
|
||||
if(firstPacket) {
|
||||
if(data.length > 2 && data[0] == (byte)0x02 && data[1] == (byte)0x3D) {
|
||||
ByteArrayOutputStream kickPacketBAO = new ByteArrayOutputStream();
|
||||
EaglerOutputStream kickPacketBAO = new EaglerOutputStream();
|
||||
try {
|
||||
DataOutputStream kickDAO = new DataOutputStream(kickPacketBAO);
|
||||
kickDAO.write(0);
|
||||
|
@ -10,7 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
|
||||
import net.minecraft.network.EnumConnectionState;
|
||||
import net.minecraft.network.EnumPacketDirection;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
Reference in New Issue
Block a user