mirror of
https://git.zelz.net/catfoolyou/Project164.git
synced 2025-12-14 08:47:40 +00:00
Singleplayer, integrated server doesn't start
This commit is contained in:
@@ -50,6 +50,7 @@ public class IntegratedServer {
|
||||
public static void begin(String[] locale, String[] stats) {
|
||||
logException = true;
|
||||
if(!isWorkerAlive()) {
|
||||
System.out.println("beginning?");
|
||||
openConnections.clear();
|
||||
exceptions.clear();
|
||||
statusState = IntegratedState.WORLD_WORKER_BOOTING;
|
||||
@@ -59,6 +60,9 @@ public class IntegratedServer {
|
||||
clearTPS();
|
||||
EaglerAdapter.beginLoadingIntegratedServer();
|
||||
}
|
||||
else {
|
||||
System.out.println("FUCK");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isReady() {
|
||||
|
||||
@@ -534,7 +534,8 @@ public class IntegratedServer {
|
||||
@JSBody(params = { "wb" }, script = "onmessage = function(o) { wb(o.data.ch, o.data.dat); };")
|
||||
private static native void registerPacketHandler(WorkerBinaryPacketHandler wb);
|
||||
|
||||
public static void startServer() {
|
||||
public static void startIntegratedServer() {
|
||||
System.out.println("Starting integrated server (kinda)");
|
||||
registerPacketHandler(new WorkerBinaryPacketHandlerImpl());
|
||||
isRunning = true;
|
||||
sendIPCPacket(new IPCPacketFFProcessKeepAlive(0xFF));
|
||||
|
||||
@@ -142,10 +142,6 @@ public abstract class MinecraftServer implements ICommandSender, Runnable {
|
||||
*/
|
||||
protected abstract boolean startServer() throws IOException;
|
||||
|
||||
protected void convertMapIfNeeded(String par1Str) {
|
||||
// no
|
||||
}
|
||||
|
||||
/**
|
||||
* Typically "menu.convertingLevel", "menu.loadingLevel" or others.
|
||||
*/
|
||||
|
||||
@@ -8,9 +8,6 @@ import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import net.lax1dude.eaglercraft.EaglerImage;
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
import net.lax1dude.eaglercraft.glemu.EffectPipeline;
|
||||
import net.lax1dude.eaglercraft.glemu.EffectPipelineFXAA;
|
||||
import net.lax1dude.eaglercraft.glemu.GameOverlayFramebuffer;
|
||||
import net.lax1dude.eaglercraft.glemu.vector.Matrix4f;
|
||||
|
||||
public class EntityRenderer
|
||||
|
||||
@@ -136,13 +136,11 @@ public class GuiMainMenu extends GuiScreen {
|
||||
*/
|
||||
public void initGui() {
|
||||
if(viewportTexture == -1) viewportTexture = this.mc.renderEngine.makeViewportTexture(256, 256);
|
||||
Calendar var1 = Calendar.getInstance();
|
||||
var1.setTime(new Date());
|
||||
|
||||
StringTranslate var2 = StringTranslate.getInstance();
|
||||
int var4 = this.height / 4 + 48;
|
||||
|
||||
if(EnumBrowser.getBrowser() != EnumBrowser.DESKTOP) { // EaglerAdapter.isIntegratedServerAvailable()
|
||||
if(EaglerAdapter.isIntegratedServerAvailable()) { // EaglerAdapter.isIntegratedServerAvailable()
|
||||
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(3, this.width / 2 - 100, var4 + 24 * 2, var2.translateKey("menu.forkme")));
|
||||
@@ -156,7 +154,6 @@ public class GuiMainMenu extends GuiScreen {
|
||||
this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var4 + 72 + 12, 98, 20, var2.translateKey("menu.editprofile")));
|
||||
|
||||
this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var4 + 72 + 12));
|
||||
Object var5 = this.field_104025_t;
|
||||
|
||||
synchronized (this.field_104025_t) {
|
||||
this.field_92023_s = this.fontRenderer.getStringWidth(this.field_92025_p);
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.lax1dude.eaglercraft;
|
||||
|
||||
import static org.teavm.jso.webgl.WebGLRenderingContext.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.sp.IntegratedServer;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.teavm.jso.JSBody;
|
||||
@@ -68,14 +69,14 @@ public class Client {
|
||||
conf.put("assetsURI", assetsURI.substring(0, 256) + " ... ");
|
||||
crashScreenOptsDump = "window.eaglercraftOpts = " + conf.toString();
|
||||
}
|
||||
String serverWorkerURI = conf.optString("serverWorkerURI", null);
|
||||
//EaglerAdapterImpl2.setWorldDatabaseName(conf.optString("worldsFolder", "MAIN"));
|
||||
String serverWorkerURI = conf.optString("serverWorkerURI", "worker_bootstrap.js");
|
||||
EaglerAdapterImpl2.setWorldDatabaseName(conf.optString("worldsFolder", "MAIN"));
|
||||
|
||||
registerErrorHandler();
|
||||
|
||||
try {
|
||||
|
||||
EaglerAdapterImpl2.initializeContext(rootElement, assetsURI, null);
|
||||
EaglerAdapterImpl2.initializeContext(rootElement, assetsURI, serverWorkerURI);
|
||||
|
||||
ServerList.loadDefaultServers(conf);
|
||||
AssetRepository.loadOverrides(conf);
|
||||
@@ -105,7 +106,7 @@ public class Client {
|
||||
|
||||
try {
|
||||
|
||||
EaglerAdapterImpl2.initializeContext(rootElement = Window.current().getDocument().getElementById(e[0]), e[1], null);
|
||||
EaglerAdapterImpl2.initializeContext(rootElement = Window.current().getDocument().getElementById(e[0]), e[1], "worker_bootstrap.js");
|
||||
|
||||
LocalStorageManager.loadStorage();
|
||||
if(e.length > 2 && e[2].length() > 0) {
|
||||
@@ -141,6 +142,7 @@ public class Client {
|
||||
|
||||
private static void run1() {
|
||||
instance.run();
|
||||
//IntegratedServer.startIntegratedServer();
|
||||
}
|
||||
|
||||
@JSBody(params = { }, script = "return window.minecraftOpts;")
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.lax1dude.eaglercraft.sp.WorkerNetworkManager;
|
||||
import org.json.JSONObject;
|
||||
import org.teavm.interop.Async;
|
||||
import org.teavm.interop.AsyncCallback;
|
||||
@@ -2869,6 +2870,7 @@ public class EaglerAdapterImpl2 {
|
||||
server.terminate();
|
||||
}
|
||||
workerMessageQueue.put("IPC", new LinkedList<PKT>());
|
||||
System.out.println("doing server worker shit");
|
||||
server = new Worker(integratedServerScript);
|
||||
server.onError(new EventListener<ErrorEvent>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user