I don't even know anymore

This commit is contained in:
Catfoolyou 2025-03-28 19:12:31 -04:00
parent 417e33d21d
commit 1b974a6b47
19 changed files with 99277 additions and 119997 deletions

0
.idea/jarRepositories.xml Normal file → Executable file
View File

0
.idea/vcs.xml Normal file → Executable file
View File

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -535,7 +535,6 @@ public class IntegratedServer {
private static native void registerPacketHandler(WorkerBinaryPacketHandler wb); private static native void registerPacketHandler(WorkerBinaryPacketHandler wb);
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("Starting integrated server (kinda)");
registerPacketHandler(new WorkerBinaryPacketHandlerImpl()); registerPacketHandler(new WorkerBinaryPacketHandlerImpl());
isRunning = true; isRunning = true;
sendIPCPacket(new IPCPacketFFProcessKeepAlive(0xFF)); sendIPCPacket(new IPCPacketFFProcessKeepAlive(0xFF));

View File

@ -125,6 +125,10 @@ public class VFSSaveHandler implements ISaveHandler, IPlayerFileData {
} }
VFile playerData = new VFile(worldDirectory, "player", var1.username.toLowerCase() + ".dat"); VFile playerData = new VFile(worldDirectory, "player", var1.username.toLowerCase() + ".dat");
if(!playerData.canRead() || !playerData.exists()){
System.out.println("player data fouled up");
}
if(!playerData.setAllBytes(bin)) { if(!playerData.setAllBytes(bin)) {
System.err.println("Could not write player data for \"" + var1.username + "\" to file \"" + playerData.toString() + "\""); System.err.println("Could not write player data for \"" + var1.username + "\" to file \"" + playerData.toString() + "\"");
@ -147,8 +151,9 @@ public class VFSSaveHandler implements ISaveHandler, IPlayerFileData {
e.printStackTrace(); e.printStackTrace();
} }
} }
if(ret == null){ if(ret == null){
System.out.println("fuck"); System.out.println("playerdata is null!");
} }
return ret; return ret;

View File

@ -89,12 +89,9 @@ public class WorkerNetworkManager implements INetworkManager {
//System.out.println("[Server][" + ipcChannel + "]: packet '" + pkt.getClass().getSimpleName() + "' recieved"); //System.out.println("[Server][" + ipcChannel + "]: packet '" + pkt.getClass().getSimpleName() + "' recieved");
try { try {
if(pkt instanceof Packet205ClientCommand){
System.out.println("processing packet with nethandler " + theNetHandler.getClass().getSimpleName());
}
pkt.processPacket(theNetHandler); // This is a problem pkt.processPacket(theNetHandler); // This is a problem
}catch(Throwable t) { }catch(Throwable t) {
System.out.println(theNetHandler.getClass().getSimpleName() + " fucked up"); System.out.println("[SP-SERVER]");
System.err.println("Could not process minecraft packet 0x" + Integer.toHexString(pkt.getPacketId()) + " class '" + pkt.getClass().getSimpleName() + "' on channel 'NET|" + ipcChannel + "'"); System.err.println("Could not process minecraft packet 0x" + Integer.toHexString(pkt.getPacketId()) + " class '" + pkt.getClass().getSimpleName() + "' on channel 'NET|" + ipcChannel + "'");
t.printStackTrace(); t.printStackTrace();
} }

View File

@ -142,6 +142,10 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
*/ */
protected abstract boolean startServer() throws IOException; protected abstract boolean startServer() throws IOException;
protected void convertMapIfNeeded(String par1Str) {
// no
}
/** /**
* Typically "menu.convertingLevel", "menu.loadingLevel" or others. * Typically "menu.convertingLevel", "menu.loadingLevel" or others.
*/ */
@ -150,7 +154,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
this.logInfo(par1Str); this.logInfo(par1Str);
this.userMessage = par1Str; this.userMessage = par1Str;
} }
protected void setUserMessage(String par1Str, float prog) { protected void setUserMessage(String par1Str, float prog) {
IntegratedServer.sendIPCPacket(new IPCPacket0DProgressUpdate(par1Str, prog)); IntegratedServer.sendIPCPacket(new IPCPacket0DProgressUpdate(par1Str, prog));
this.logInfo(par1Str + ": " + (prog > 1.0f ? "" + (int)prog : "" + (int)(prog * 100.0f) + "%")); this.logInfo(par1Str + ": " + (prog > 1.0f ? "" + (int)prog : "" + (int)(prog * 100.0f) + "%"));
@ -207,14 +211,14 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
//this.setUserMessage("menu.generatingTerrain"); //this.setUserMessage("menu.generatingTerrain");
byte var6 = 0; byte var6 = 0;
this.setUserMessage("Preparing start region for level " + var6); this.setUserMessage("Preparing start region for level " + var6);
// Removed 'spawn chunks' for performance, they are unnecessary // Removed 'spawn chunks' for performance, they are unnecessary
/* /*
WorldServer var7 = this.worldServers[var6]; WorldServer var7 = this.worldServers[var6];
ChunkCoordinates var8 = var7.getSpawnPoint(); ChunkCoordinates var8 = var7.getSpawnPoint();
long var9 = System.currentTimeMillis(); long var9 = System.currentTimeMillis();
int prepareRadius = 64; int prepareRadius = 64;
for (int var11 = -prepareRadius; var11 <= prepareRadius && this.isServerRunning(); var11 += 16) { for (int var11 = -prepareRadius; var11 <= prepareRadius && this.isServerRunning(); var11 += 16) {
@ -231,7 +235,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
} }
} }
*/ */
this.clearCurrentTask(); this.clearCurrentTask();
} }
@ -432,11 +436,11 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
this.receivedPacketSizeArray[this.tickCounter % 100] = Packet.receivedSize - this.lastReceivedSize; this.receivedPacketSizeArray[this.tickCounter % 100] = Packet.receivedSize - this.lastReceivedSize;
this.lastReceivedSize = Packet.receivedSize; this.lastReceivedSize = Packet.receivedSize;
} }
public List<String> getTPSAndChunkBuffer(int tpsCounter) { public List<String> getTPSAndChunkBuffer(int tpsCounter) {
ArrayList<String> strs = new ArrayList(); ArrayList<String> strs = new ArrayList();
strs.add("Ticks/Second: " + tpsCounter + "/20"); strs.add("Ticks/Second: " + tpsCounter + "/20");
int c = 0; int c = 0;
int oc = 0; int oc = 0;
int e = 0; int e = 0;
@ -511,7 +515,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
public void func_82010_a(IUpdatePlayerListBox par1IUpdatePlayerListBox) { public void func_82010_a(IUpdatePlayerListBox par1IUpdatePlayerListBox) {
this.playersOnline.add(par1IUpdatePlayerListBox); this.playersOnline.add(par1IUpdatePlayerListBox);
} }
/** /**
* Returns a File object from the specified string. * Returns a File object from the specified string.
*/ */
@ -805,7 +809,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
var2.flush(); var2.flush();
} }
} }
String dir = this.worldServers[0].getSaveHandler().getWorldDirectoryName(); String dir = this.worldServers[0].getSaveHandler().getWorldDirectoryName();
SYS.VFS.deleteFiles(dir); SYS.VFS.deleteFiles(dir);
String[] worldsTxt = SYS.VFS.getFile("worlds.txt").getAllLines(); String[] worldsTxt = SYS.VFS.getFile("worlds.txt").getAllLines();
@ -818,7 +822,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
} }
SYS.VFS.getFile("worlds.txt").setAllChars(String.join("\n", newWorlds)); SYS.VFS.getFile("worlds.txt").setAllChars(String.join("\n", newWorlds));
} }
this.initiateShutdown(); this.initiateShutdown();
} }
@ -972,4 +976,4 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
public static ServerConfigurationManager getServerConfigurationManager(MinecraftServer par0MinecraftServer) { public static ServerConfigurationManager getServerConfigurationManager(MinecraftServer par0MinecraftServer) {
return par0MinecraftServer.serverConfigManager; return par0MinecraftServer.serverConfigManager;
} }
} }

View File

@ -17,7 +17,6 @@ public abstract class NetHandler
} }
public void unexpectedPacket(Packet par1Packet) { public void unexpectedPacket(Packet par1Packet) {
System.out.println("fuck");
System.out.println("unexpected packet " + par1Packet.getClass().getSimpleName()); System.out.println("unexpected packet " + par1Packet.getClass().getSimpleName());
} }

View File

@ -126,6 +126,7 @@ public class NetLoginHandler extends NetHandler {
} }
public void handleLogin(Packet1Login par1Packet1Login) { public void handleLogin(Packet1Login par1Packet1Login) {
System.out.println("login????");
} }
/** /**

View File

@ -768,6 +768,9 @@ public class NetServerHandler extends NetHandler
this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false);
} }
} }
else {
System.out.println("this should be processed by netloginhandler!");
}
} }
/** /**

View File

@ -2,14 +2,7 @@ package net.lax1dude.eaglercraft;
import java.io.IOException; import java.io.IOException;
import net.minecraft.src.Minecraft; import net.minecraft.src.*;
import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiDisconnected;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.NetClientHandler;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.Packet2ClientProtocol;
import net.minecraft.src.WorldClient;
public class GuiScreenSingleplayerConnecting extends GuiScreen { public class GuiScreenSingleplayerConnecting extends GuiScreen {

View File

@ -50,7 +50,6 @@ public class IntegratedServer {
public static void begin(String[] locale, String[] stats) { public static void begin(String[] locale, String[] stats) {
logException = true; logException = true;
if(!isWorkerAlive()) { if(!isWorkerAlive()) {
System.out.println("beginning?");
openConnections.clear(); openConnections.clear();
exceptions.clear(); exceptions.clear();
statusState = IntegratedState.WORLD_WORKER_BOOTING; statusState = IntegratedState.WORLD_WORKER_BOOTING;

View File

@ -5,9 +5,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import net.minecraft.src.INetworkManager; import net.minecraft.src.*;
import net.minecraft.src.NetHandler;
import net.minecraft.src.Packet;
public class WorkerNetworkManager implements INetworkManager { public class WorkerNetworkManager implements INetworkManager {
@ -60,6 +58,10 @@ public class WorkerNetworkManager implements INetworkManager {
} }
Packet pkt = Packet.getNewPacket(pktId); Packet pkt = Packet.getNewPacket(pktId);
if(pkt instanceof Packet252SharedKey || pkt instanceof Packet205ClientCommand || pkt instanceof Packet2ClientProtocol){
System.out.println("Client processing packet " + pkt.getClass().getSimpleName());
}
if(pkt == null) { if(pkt == null) {
System.err.println("Recieved invalid '" + pktId + "' packet"); System.err.println("Recieved invalid '" + pktId + "' packet");
@ -73,6 +75,7 @@ public class WorkerNetworkManager implements INetworkManager {
try { try {
pkt.processPacket(theNetHandler); pkt.processPacket(theNetHandler);
}catch(Throwable t) { }catch(Throwable t) {
System.out.println("[CLIENT]");
System.err.println("Could not process minecraft packet 0x" + Integer.toHexString(pkt.getPacketId()) + " class '" + pkt.getClass().getSimpleName() + "' on channel 'NET|" + ipcChannel + "'"); System.err.println("Could not process minecraft packet 0x" + Integer.toHexString(pkt.getPacketId()) + " class '" + pkt.getClass().getSimpleName() + "' on channel 'NET|" + ipcChannel + "'");
t.printStackTrace(); t.printStackTrace();
} }

View File

@ -140,7 +140,7 @@ public class GuiMainMenu extends GuiScreen {
StringTranslate var2 = StringTranslate.getInstance(); StringTranslate var2 = StringTranslate.getInstance();
int var4 = this.height / 4 + 48; int var4 = this.height / 4 + 48;
if(EaglerAdapter.isIntegratedServerAvailable()) { // EaglerAdapter.isIntegratedServerAvailable() if(false) { // EaglerAdapter.isIntegratedServerAvailable()
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var4, var2.translateKey("menu.singleplayer"))); this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var4, var2.translateKey("menu.singleplayer")));
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4 + 24 * 1, var2.translateKey("menu.multiplayer"))); this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4 + 24 * 1, var2.translateKey("menu.multiplayer")));
this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24 * 2, var2.translateKey("menu.forkme"))); this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24 * 2, var2.translateKey("menu.forkme")));

View File

@ -2867,7 +2867,6 @@ public class EaglerAdapterImpl2 {
server.terminate(); server.terminate();
} }
workerMessageQueue.put("IPC", new LinkedList<PKT>()); workerMessageQueue.put("IPC", new LinkedList<PKT>());
System.out.println("doing server worker shit");
server = new Worker(integratedServerScript); server = new Worker(integratedServerScript);
server.onError(new EventListener<ErrorEvent>() { server.onError(new EventListener<ErrorEvent>() {
@Override @Override