mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #37 - Touch support without userscript, many other feats
This commit is contained in:
@ -13,4 +13,5 @@ desktopRuntime/crash-reports/*
|
||||
desktopRuntime/options.txt
|
||||
desktopRuntime/_eagstorage*
|
||||
desktopRuntime/filesystem/*
|
||||
desktopRuntime/downloads/*
|
||||
desktopRuntime/downloads/*
|
||||
desktopRuntime/screenshots/*
|
@ -1,16 +1,31 @@
|
||||
import org.teavm.gradle.api.OptimizationLevel
|
||||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files("src/teavmc-classpath/resources")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'eclipse'
|
||||
id 'org.teavm' version '0.9.2'
|
||||
id "java"
|
||||
id "eclipse"
|
||||
id "org.teavm" version "0.9.2"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'src/main/java'
|
||||
srcDir 'src/teavm/java'
|
||||
srcDirs(
|
||||
"src/main/java",
|
||||
"src/game/java",
|
||||
"src/protocol-game/java",
|
||||
"src/protocol-relay/java",
|
||||
"src/teavm/java",
|
||||
"src/teavm-boot-menu/java"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
@ -20,20 +35,38 @@ repositories {
|
||||
dependencies {
|
||||
teavm(teavm.libs.jso)
|
||||
teavm(teavm.libs.jsoApis)
|
||||
compileOnly "org.teavm:teavm-core:0.9.2" // workaround for a few hacks
|
||||
}
|
||||
|
||||
def folder = "javascript"
|
||||
def name = "classes.js"
|
||||
|
||||
teavm.js {
|
||||
obfuscated = true
|
||||
sourceMap = true
|
||||
targetFileName = "../classes.js"
|
||||
optimization = org.teavm.gradle.api.OptimizationLevel.BALANCED // no fps boost was observed with "AGGRESSIVE"
|
||||
targetFileName = "../" + name
|
||||
optimization = OptimizationLevel.BALANCED // Change to "AGGRESSIVE" for release
|
||||
outOfProcess = false
|
||||
fastGlobalAnalysis = false
|
||||
processMemory = 512
|
||||
entryPointName = 'main'
|
||||
mainClass = 'net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass'
|
||||
outputDir = file("javascript")
|
||||
properties = null
|
||||
sourceMap = true
|
||||
entryPointName = "main"
|
||||
mainClass = "net.lax1dude.eaglercraft.v1_8.internal.teavm.MainClass"
|
||||
outputDir = file(folder)
|
||||
properties = [ "java.util.TimeZone.autodetect": "true" ]
|
||||
debugInformation = false
|
||||
}
|
||||
|
||||
tasks.named("generateJavaScript") {
|
||||
doLast {
|
||||
|
||||
// NOTE: This step may break at any time, and is not required for 99% of browsers
|
||||
|
||||
def phile = file(folder + "/" + name)
|
||||
def dest = phile.getText("UTF-8")
|
||||
def i = dest.substring(0, dest.indexOf("=\$rt_globals.Symbol('jsoClass');")).lastIndexOf("let ")
|
||||
dest = dest.substring(0, i) + "var" + dest.substring(i + 3)
|
||||
def j = dest.indexOf("function(\$rt_globals,\$rt_exports){")
|
||||
dest = dest.substring(0, j + 34) + "\n" + file(folder + "/ES6ShimScript.txt").getText("UTF-8") + "\n" + dest.substring(j + 34)
|
||||
phile.write(dest, "UTF-8")
|
||||
}
|
||||
}
|
@ -0,0 +1,514 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<!--
|
||||
Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<html style="width:100%;height:100%;">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Eaglercraft Desktop Runtime</title>
|
||||
<link type="image/png" rel="shortcut icon" id="vigg" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAR/SURBVEhLtZXZK3ZRFMYPcqXc+gv413DHxVuGIpIhkciQWaRccCNjSCkligwXSOZ5nmfv9zvn2e8+58V753sudmuvvdZ61l5r7XOc8H+GS/D19aUNkPz5+aktQH5/f//4+LBKZKuRkpUtQjCUYG5gD2T38vLy/PwsDfL9/f3Dw8PT05M0b29vnKLhCKCBT4L4gvBLBIei4//4+Hh1dUVEQutUuLu7E83FxQUGnKLBWKfQaA3S+AREVxaEOD8/Pzk50XpzcyMDcH19zdZG3N3d3dzc3Nvb01aX5pQUpQGGQJxcQpfNysoKhUIdHR1o1tbWbInYAgxIPDMzMy8vLzc3FxqOdMoRqwJK8G8ALUYIhHMiSEhIwI6CyIb0qQzC4eGhsXCc1tZWnZIEKzdQJQSXgKxfX18RCM3Z5eWlcfVAxKOjo+Pj49PTU88lTOk2NjbMsePc3t6SAfcgFdszOyMuAdeBg0CQi2lhYUHOeOLDCisN8FzcPFZXV3t7ezHY3t5GQ+6it+2xMASsKhEEWKsmRLRBBUpPvpJ/TpFKFBwKYAiITmicsbYhdHfJAltqhUCVsCQhwslmeXmZxiBQT9c0Ar9E2O3v72sYSE0N1yQArkKy0kBMXLqlZqIZHR3t6empqqqSDcBdhXEJSJ/bUc3q6uq+vj629GB9fR1WsLW1NTs7u7S0RN2locMjIyOEm5ubQ7+4uJienk4/+vv77Y1hwhLBEKhwWHitdVFfX9/Y2Gg2HuLi4owUAysrK8yCG97rh0+ApP5Q2ZycHFlPTExUVFRIBvn5+WhKSkp2dnaMKhptbW2426GgQ/rwuAQCZ1hwFayLiork9hMFBQV1dXVmE0BLS4vqw3QFB8kn4IAxoGPkYpxi4FeDmpqas7Mz4pClAgqGwD48rjY2NmacYqC0tJQ1KSlJWyE5OZkpUKkBAxZVIntAoZh04+Q48fHxPNGBgYHExMT29naj9cBodnZ2mo3jlJWVMeW2OGQck4B1amqqoaGhqamJjx2lGxwcpL0mUgR8fJhsWqJtSkoKU2SbHHUDpkhPBujd8xuQG6PJRM/Pz09PT7O1NNnZ2Tw3fgZkXVhYKCUlUhBATP+hCVyKZGky17RV0g04laayslJ6hlVeFHB4eFhKaogGd0LxtmTgE+hbhKDnPjMzgw8E3qGL2tpaBWpubjYqj2BoaEj6rq4uNATRZ0ZwCbiL6gXEzINk5vCBQJ9rMD4+rkA8QNK036uDg4Py8vLu7m680KjIBNR3zBDoWQM1g98snyB+VSoRW8C/UwR81/SvhgNj9JOTkwwVERUdRBEI0BAdLRVERkhLS8vIyEDQlrsTPTU1lVFhKxARvZgUlFLbegCf4BvIsbi4mIg4E5EogIHhiKCMtU0WUFiVy06j5fAJIDdSBDQw+PegDfBRcbOPwH4F9LuFWIIQdQNKwWqzIE0aoFUaBsw+SQuFw0uNtC9A+F4i3QNrbg3IDn+SAsHh+wYiEpeyBEMLv/cAO6KzAijxxB+Y4wisBhssJUhjEbPJf4Nw+B+JXqLW3bw+wQAAAABJRU5ErkJggg==" />
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
(function() {
|
||||
var webSocketURI = "${client_websocket_uri}";
|
||||
if(webSocketURI === ("$" + "{client_websocket_uri}")) {
|
||||
alert("Don't open this file in your browser");
|
||||
window.addEventListener("load", function() {
|
||||
document.body.innerHTML = "<p style=\"text-align:center;\">cunt</p>";
|
||||
});
|
||||
return;
|
||||
}
|
||||
var eaglercraftXOpts = {eaglercraftXOpts};
|
||||
var cspAttrSupport = false;
|
||||
var checkSupport = function() {
|
||||
if(eaglercraftXOpts.forceWebViewSupport) {
|
||||
cspAttrSupport = true;
|
||||
return true;
|
||||
}else {
|
||||
var tempIFrameElement = document.createElement("iframe");
|
||||
cspAttrSupport = eaglercraftXOpts.enableWebViewCSP && (typeof tempIFrameElement.csp === "string");
|
||||
return (typeof tempIFrameElement.allow === "string") && (typeof tempIFrameElement.sandbox === "object");
|
||||
}
|
||||
};
|
||||
var supported = false;
|
||||
try {
|
||||
supported = checkSupport();
|
||||
}catch(ex) {
|
||||
supported = false;
|
||||
}
|
||||
console.log("CSP attribute support detected as " + cspAttrSupport);
|
||||
if(!supported) {
|
||||
console.error("Required IFrame safety features are not supported!");
|
||||
window.addEventListener("load", function() {
|
||||
document.getElementById("view_loading").style.display = "none";
|
||||
document.getElementById("view_safety_error").style.display = "block";
|
||||
});
|
||||
return;
|
||||
}
|
||||
var websocketInstance = null;
|
||||
var hasOpened = false;
|
||||
var webviewOptions = null;
|
||||
var webviewResetSerial = 0;
|
||||
var hasErrored = false;
|
||||
var hasRegisteredOnMsgHandler = false;
|
||||
var currentMessageHandler = null;
|
||||
var currentIFrame = null;
|
||||
var currentMessageChannelName = null;
|
||||
var elements = {};
|
||||
var loadElements = function() {
|
||||
var jsel = document.getElementsByClassName("__jsel");
|
||||
for(var i = 0; i < jsel.length; ++i) {
|
||||
var el = jsel[i];
|
||||
if(el.id.length > 0) {
|
||||
elements[el.id] = el;
|
||||
}
|
||||
}
|
||||
};
|
||||
function loadEagtekIcon() {
|
||||
var faviconSrc = document.getElementById("vigg").href;
|
||||
var imgElements = document.getElementsByClassName("eagtek_icon");
|
||||
for(var i = 0; i < imgElements.length; ++i) {
|
||||
imgElements[i].src = faviconSrc;
|
||||
}
|
||||
}
|
||||
function setupElementListeners() {
|
||||
elements.button_allow.addEventListener("click", function() {
|
||||
if(websocketInstance !== null) {
|
||||
if(elements.chkbox_remember.checked) {
|
||||
websocketInstance.send(JSON.stringify({$:7,perm:"ALLOW"}));
|
||||
}
|
||||
beginShowingDirect();
|
||||
}
|
||||
});
|
||||
elements.button_block.addEventListener("click", function() {
|
||||
if(websocketInstance !== null) {
|
||||
if(elements.chkbox_remember.checked) {
|
||||
websocketInstance.send(JSON.stringify({$:7,perm:"BLOCK"}));
|
||||
}
|
||||
beginShowingContentBlocked();
|
||||
}
|
||||
});
|
||||
elements.button_re_evaluate.addEventListener("click", function() {
|
||||
if(websocketInstance !== null) {
|
||||
websocketInstance.send(JSON.stringify({$:7,perm:"NOT_SET"}));
|
||||
beginShowingEnableJavaScript();
|
||||
}
|
||||
});
|
||||
}
|
||||
window.specialHack = function() {
|
||||
if(websocketInstance !== null) {
|
||||
websocketInstance.send(JSON.stringify({$:7,perm:"NOT_SET"}));
|
||||
}
|
||||
};
|
||||
var handleHandshake = function(pkt) {
|
||||
webviewOptions = {};
|
||||
webviewOptions.contentMode = pkt.contentMode || "BLOB_BASED";
|
||||
webviewOptions.fallbackTitle = pkt.fallbackTitle || "Server Info";
|
||||
document.title = webviewOptions.fallbackTitle + " - Eaglercraft Desktop Runtime";
|
||||
webviewOptions.scriptEnabled = !!pkt.scriptEnabled;
|
||||
webviewOptions.strictCSPEnable = !!pkt.strictCSPEnable || false;
|
||||
webviewOptions.serverMessageAPIEnabled = !!pkt.serverMessageAPIEnabled;
|
||||
webviewOptions.url = pkt.url;
|
||||
webviewOptions.blob = pkt.blob;
|
||||
webviewOptions.hasApprovedJS = pkt.hasApprovedJS || "NOT_SET";
|
||||
if(webviewOptions.scriptEnabled) {
|
||||
if(webviewOptions.hasApprovedJS === "NOT_SET") {
|
||||
beginShowingEnableJavaScript();
|
||||
}else if(webviewOptions.hasApprovedJS === "ALLOW") {
|
||||
beginShowingDirect();
|
||||
}else if(webviewOptions.hasApprovedJS === "BLOCK") {
|
||||
beginShowingContentBlocked();
|
||||
}else {
|
||||
setErrored("Unknown JS permission state: " + webviewOptions.hasApprovedJS);
|
||||
}
|
||||
}else {
|
||||
beginShowingDirect();
|
||||
}
|
||||
};
|
||||
var handleServerError = function(pkt) {
|
||||
console.error("Recieved error from server: " + pkt.msg);
|
||||
setErrored(pkt.msg);
|
||||
};
|
||||
var handleServerWebViewStrMsg = function(pkt) {
|
||||
var w;
|
||||
if(currentMessageChannelName !== null && currentIFrame !== null && (w = currentIFrame.contentWindow) !== null) {
|
||||
w.postMessage({ver:1,channel:currentMessageChannelName,type:"string",data:pkt.msg}, "*");
|
||||
}else {
|
||||
console.error("Server tried to send the WebView a message, but the message channel is not open!");
|
||||
}
|
||||
};
|
||||
var handleServerWebViewBinMsg = function(arr) {
|
||||
var w;
|
||||
if(currentMessageChannelName !== null && currentIFrame !== null && (w = currentIFrame.contentWindow) !== null) {
|
||||
w.postMessage({ver:1,channel:currentMessageChannelName,type:"binary",data:arr}, "*");
|
||||
}else {
|
||||
console.error("Server tried to send the WebView a message, but the message channel is not open!");
|
||||
}
|
||||
};
|
||||
var hideAllViews = function() {
|
||||
if(currentIFrame !== null) {
|
||||
++webviewResetSerial;
|
||||
if(currentIFrame.parentNode) currentIFrame.parentNode.removeChild(currentIFrame);
|
||||
currentIFrame = null;
|
||||
}
|
||||
elements.view_loading.style.display = "none";
|
||||
elements.view_iframe.style.display = "none";
|
||||
elements.view_allow_javascript.style.display = "none";
|
||||
elements.view_javascript_blocked.style.display = "none";
|
||||
elements.view_safety_error.style.display = "none";
|
||||
};
|
||||
var setErrored = function(str) {
|
||||
if(hasErrored) return;
|
||||
hasErrored = true;
|
||||
hideAllViews();
|
||||
elements.loading_text.style.color = "#CC0000";
|
||||
elements.loading_text.innerText = str;
|
||||
elements.view_loading.style.display = "block";
|
||||
if(websocketInstance !== null) {
|
||||
websocketInstance.close();
|
||||
websocketInstance = null;
|
||||
}
|
||||
};
|
||||
var registerMessageHandler = function() {
|
||||
if(!hasRegisteredOnMsgHandler) {
|
||||
hasRegisteredOnMsgHandler = true;
|
||||
window.addEventListener("message", function(evt) {
|
||||
if(currentIFrame !== null && currentMessageHandler !== null && evt.source === currentIFrame.contentWindow) {
|
||||
currentMessageHandler(evt);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var beginShowingDirect = function() {
|
||||
if(hasErrored) return;
|
||||
hideAllViews();
|
||||
if(!eaglercraftXOpts.forceWebViewSupport) {
|
||||
try {
|
||||
currentIFrame = document.createElement("iframe");
|
||||
currentIFrame.allow = "";
|
||||
if(currentIFrame.allow != "") throw "Failed to set allow to \"\"";
|
||||
currentIFrame.referrerPolicy = "strict-origin";
|
||||
var requiredSandboxTokens = [ "allow-downloads" ];
|
||||
if(webviewOptions.scriptEnabled) {
|
||||
requiredSandboxTokens.push("allow-scripts");
|
||||
requiredSandboxTokens.push("allow-pointer-lock");
|
||||
}
|
||||
currentIFrame.sandbox = requiredSandboxTokens.join(" ");
|
||||
for(var i = 0; i < requiredSandboxTokens.length; ++i) {
|
||||
if(!currentIFrame.sandbox.contains(requiredSandboxTokens[i])) {
|
||||
throw ("Failed to set sandbox attribute: " + requiredSandboxTokens[i]);
|
||||
}
|
||||
}
|
||||
var sbox = currentIFrame.sandbox;
|
||||
for(var i = 0; i < sbox.length; ++i) {
|
||||
if(!requiredSandboxTokens.includes(sbox.item(i))) {
|
||||
throw ("Unknown sandbox attribute detected: " + sbox.item(i));
|
||||
}
|
||||
}
|
||||
}catch(ex) {
|
||||
if(typeof ex === "string") {
|
||||
console.error("Caught safety error: " + ex);
|
||||
beginShowingSafetyError();
|
||||
}else {webviewOptions
|
||||
console.error("Fatal error while creating iframe!");
|
||||
console.error(ex);
|
||||
setErrored("Fatal error while creating iframe!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
currentIFrame = document.createElement("iframe");
|
||||
try {
|
||||
currentIFrame.allow = "";
|
||||
}catch(ex) {
|
||||
}
|
||||
try {
|
||||
currentIFrame.referrerPolicy = "strict-origin";
|
||||
}catch(ex) {
|
||||
}
|
||||
try {
|
||||
var sandboxTokens = [ "allow-downloads", "allow-same-origin" ];
|
||||
if(webviewOptions.scriptEnabled) {
|
||||
sandboxTokens.push("allow-scripts");
|
||||
sandboxTokens.push("allow-pointer-lock");
|
||||
}
|
||||
currentIFrame.sandbox = sandboxTokens.join(" ");
|
||||
}catch(ex) {
|
||||
}
|
||||
}
|
||||
currentIFrame.credentialless = true;
|
||||
currentIFrame.loading = "lazy";
|
||||
var cspWarn = false;
|
||||
if(webviewOptions.contentMode === "BLOB_BASED") {
|
||||
if(cspAttrSupport && eaglercraftXOpts.enableWebViewCSP) {
|
||||
if(typeof currentIFrame.csp === "string") {
|
||||
var csp = "default-src 'none';";
|
||||
var protos = (webviewOptions.strictCSPEnable ? "" : " http: https:");
|
||||
if(webviewOptions.scriptEnabled) {
|
||||
csp += (" script-src 'unsafe-eval' 'unsafe-inline' data: blob:" + protos + ";");
|
||||
csp += (" style-src 'unsafe-eval' 'unsafe-inline' data: blob:" + protos + ";");
|
||||
csp += (" img-src data: blob:" + protos + ";");
|
||||
csp += (" font-src data: blob:" + protos + ";");
|
||||
csp += (" child-src data: blob:" + protos + ";");
|
||||
csp += (" frame-src data: blob:;");
|
||||
csp += (" media-src data: mediastream: blob:" + protos + ";");
|
||||
csp += (" connect-src data: blob:" + protos + ";");
|
||||
csp += (" worker-src data: blob:" + protos + ";");
|
||||
}else {
|
||||
csp += (" style-src data: 'unsafe-inline'" + protos + ";");
|
||||
csp += (" img-src data:" + protos + ";");
|
||||
csp += (" font-src data:" + protos + ";");
|
||||
csp += (" media-src data:" + protos + ";");
|
||||
}
|
||||
currentIFrame.csp = csp;
|
||||
}else {
|
||||
console.error("This browser does not support CSP attribute on iframes! (try Chrome)");
|
||||
cspWarn = true;
|
||||
}
|
||||
}else {
|
||||
cspWarn = true;
|
||||
}
|
||||
if(cspWarn && webviewOptions.strictCSPEnable) {
|
||||
console.error("Strict CSP was requested for this webview, but that feature is not available!");
|
||||
}
|
||||
}else {
|
||||
cspWarn = true;
|
||||
}
|
||||
currentIFrame.style.border = "none";
|
||||
currentIFrame.style.backgroundColor = "white";
|
||||
currentIFrame.style.width = "100%";
|
||||
currentIFrame.style.height = "100%";
|
||||
elements.view_iframe.appendChild(currentIFrame);
|
||||
elements.view_iframe.style.display = "block";
|
||||
if(webviewOptions.contentMode === "BLOB_BASED") {
|
||||
currentIFrame.srcdoc = webviewOptions.blob;
|
||||
}else {
|
||||
currentIFrame.src = webviewOptions.url;
|
||||
}
|
||||
currentIFrame.focus();
|
||||
if(webviewOptions.scriptEnabled && webviewOptions.serverMessageAPIEnabled) {
|
||||
var resetSer = webviewResetSerial;
|
||||
var curIFrame = currentIFrame;
|
||||
registerMessageHandler();
|
||||
currentMessageHandler = function(evt) {
|
||||
if(resetSer === webviewResetSerial && curIFrame === currentIFrame) {
|
||||
handleMessageRawFromFrame(evt.data);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
var handleMessageRawFromFrame = function(obj) {
|
||||
if(hasErrored) return;
|
||||
if((typeof obj === "object") && (obj.ver === 1) && ((typeof obj.channel === "string") && obj.channel.length > 0)) {
|
||||
if(typeof obj.open === "boolean") {
|
||||
sendMessageEnToServer(obj.open, obj.channel);
|
||||
return;
|
||||
}else if(typeof obj.data === "string") {
|
||||
sendMessageToServerStr(obj.channel, obj.data);
|
||||
return;
|
||||
}else if(obj.data instanceof ArrayBuffer) {
|
||||
sendMessageToServerBin(obj.channel, obj.data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.error("WebView sent an invalid message!");
|
||||
};
|
||||
var sendMessageEnToServer = function(messageChannelOpen, channelName) {
|
||||
if(channelName.length > 255) {
|
||||
console.error("WebView tried to " + (messageChannelOpen ? "open" : "close") + " a channel, but channel name is too long, max is 255 characters!");
|
||||
return;
|
||||
}
|
||||
if(messageChannelOpen && currentMessageChannelName !== null) {
|
||||
console.error("WebView tried to open channel, but a channel is already open!");
|
||||
sendMessageEnToServer(false, currentMessageChannelName);
|
||||
}
|
||||
if(!messageChannelOpen && currentMessageChannelName !== null && currentMessageChannelName === channelName) {
|
||||
console.error("WebView tried to close the wrong channel!");
|
||||
}
|
||||
if(!messageChannelOpen && currentMessageChannelName === null) {
|
||||
console.error("WebView tried to close channel, but the channel is not open!");
|
||||
return;
|
||||
}
|
||||
if(websocketInstance !== null) {
|
||||
if(messageChannelOpen) {
|
||||
websocketInstance.send(JSON.stringify({$:3,channel:channelName}));
|
||||
console.log("WebView opened message channel to server: \"" + channelName + "\"");
|
||||
currentMessageChannelName = channelName;
|
||||
}else {
|
||||
websocketInstance.send(JSON.stringify({$:4}));
|
||||
console.log("WebView closed message channel to server: \"" + currentMessageChannelName + "\"");
|
||||
currentMessageChannelName = null;
|
||||
}
|
||||
}else {
|
||||
console.error("WebView tried to send a message, but no websocket is open!");
|
||||
}
|
||||
};
|
||||
var sendMessageToServerStr = function(channelName, msg) {
|
||||
if(channelName.length > 255) {
|
||||
console.error("WebView tried to send a message packet, but channel name is too long, max is 255 characters!");
|
||||
return;
|
||||
}
|
||||
if(channelName !== currentMessageChannelName) {
|
||||
console.error("WebView tried to send a message packet, but the channel is not open!");
|
||||
return;
|
||||
}
|
||||
if(websocketInstance !== null) {
|
||||
websocketInstance.send(JSON.stringify({$:5,msg:msg}));
|
||||
}else {
|
||||
console.error("WebView tried to send a message, but no callback for sending packets is set!");
|
||||
}
|
||||
};
|
||||
var sendMessageToServerBin = function(channelName, msg) {
|
||||
if(channelName.length > 255) {
|
||||
console.error("WebView tried to send a message packet, but channel name is too long, max is 255 characters!");
|
||||
return;
|
||||
}
|
||||
if(channelName !== currentMessageChannelName) {
|
||||
console.error("WebView tried to send a message packet, but the channel is not open!");
|
||||
return;
|
||||
}
|
||||
if(websocketInstance !== null) {
|
||||
websocketInstance.send(msg);
|
||||
}else {
|
||||
console.error("WebView tried to send a message, but no callback for sending packets is set!");
|
||||
}
|
||||
};
|
||||
var beginShowingEnableJavaScript = function() {
|
||||
if(hasErrored) return;
|
||||
hideAllViews();
|
||||
if(webviewOptions.contentMode !== "BLOB_BASED") {
|
||||
elements.strict_csp_value.innerText = "Impossible";
|
||||
elements.strict_csp_value.style.color = "red";
|
||||
}else if(!cspAttrSupport || !eaglercraftXOpts.enableWebViewCSP) {
|
||||
elements.strict_csp_value.innerText = "Unsupported";
|
||||
elements.strict_csp_value.style.color = "red";
|
||||
}else if(webviewOptions.strictCSPEnable) {
|
||||
elements.strict_csp_value.innerText = "Enabled";
|
||||
elements.strict_csp_value.style.color = "green";
|
||||
}else {
|
||||
elements.strict_csp_value.innerText = "Disabled";
|
||||
elements.strict_csp_value.style.color = "red";
|
||||
}
|
||||
if(webviewOptions.serverMessageAPIEnabled) {
|
||||
elements.message_api_value.innerText = "Enabled";
|
||||
elements.message_api_value.style.color = "red";
|
||||
}else {
|
||||
elements.message_api_value.innerText = "Disabled";
|
||||
elements.message_api_value.style.color = "green";
|
||||
}
|
||||
elements.view_allow_javascript.style.display = "block";
|
||||
};
|
||||
var beginShowingContentBlocked = function() {
|
||||
if(hasErrored) return;
|
||||
hideAllViews();
|
||||
elements.view_javascript_blocked.style.display = "block";
|
||||
};
|
||||
var beginShowingSafetyError = function() {
|
||||
if(hasErrored) return;
|
||||
hasErrored = true;
|
||||
hideAllViews();
|
||||
elements.view_safety_error.style.display = "block";
|
||||
};
|
||||
window.addEventListener("load", function() {
|
||||
loadElements();
|
||||
loadEagtekIcon();
|
||||
setupElementListeners();
|
||||
websocketInstance = new WebSocket(webSocketURI);
|
||||
websocketInstance.binaryType = "arraybuffer";
|
||||
websocketInstance.addEventListener("open", function(evt) {
|
||||
console.log("Connection to server opened");
|
||||
hasOpened = true;
|
||||
websocketInstance.send(JSON.stringify({$:0,cspSupport:cspAttrSupport}));
|
||||
});
|
||||
websocketInstance.addEventListener("message", function(evt) {
|
||||
try {
|
||||
if(typeof evt.data === "string") {
|
||||
var pkt = JSON.parse(evt.data);
|
||||
if(typeof pkt.$ !== "number") {
|
||||
throw "Packet type is invalid";
|
||||
}
|
||||
if(webviewOptions === null) {
|
||||
if(pkt.$ === 1) {
|
||||
handleHandshake(pkt);
|
||||
}else if(pkt.$ === 2) {
|
||||
handleServerError(pkt);
|
||||
}else {
|
||||
throw "Unknown packet type " + pkt.$ + " for state handshake!"
|
||||
}
|
||||
}else {
|
||||
if(pkt.$ === 2) {
|
||||
handleServerError(pkt);
|
||||
}else if(pkt.$ === 6) {
|
||||
handleServerWebViewStrMsg(pkt);
|
||||
}else {
|
||||
throw "Unknown packet type " + pkt.$ + " for state open!"
|
||||
}
|
||||
}
|
||||
}else {
|
||||
handleServerWebViewBinMsg(evt.data);
|
||||
}
|
||||
}catch(ex) {
|
||||
console.error("Caught exception processing message from server!");
|
||||
console.error(ex);
|
||||
}
|
||||
});
|
||||
websocketInstance.addEventListener("close", function(evt) {
|
||||
websocketInstance = null;
|
||||
setErrored("Connection to EaglercraftX client lost!");
|
||||
});
|
||||
websocketInstance.addEventListener("error", function(evt) {
|
||||
console.error("WebSocket error: " + evt);
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0px;width:100%;height:100%;overflow:hidden;font-family:sans-serif;user-select:none;">
|
||||
<div id="view_loading" style="width:100%;height:100%;display:block;" class="__jsel">
|
||||
<div style="padding-top:13vh;">
|
||||
<h2 style="text-align:center;" id="loading_text" class="__jsel">Please Wait...</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="view_iframe" style="width:100%;height:100%;display:none;" class="__jsel">
|
||||
</div>
|
||||
<div id="view_allow_javascript" style="width:100%;height:100%;display:none;" class="__jsel">
|
||||
<div style="padding-top:13vh;">
|
||||
<div style="margin:auto;max-width:450px;border:6px double black;text-align:center;padding:20px;">
|
||||
<h2><img width="32" height="32" style="vertical-align:middle;" class="eagtek_icon"> Allow JavaScript</h2>
|
||||
<p style="font-family:monospace;text-decoration:underline;word-wrap:break-word;" id="target_url"></p>
|
||||
<h4 style="line-height:1.4em;">Strict CSP: <span id="strict_csp_value" class="__jsel"></span> | Message API: <span id="message_api_value" class="__jsel"></span></h4>
|
||||
<p><input id="chkbox_remember" type="checkbox" class="__jsel" checked> Remember my choice</p>
|
||||
<p><button style="font-size:1.5em;" id="button_allow" class="__jsel">Allow</button> <button style="font-size:1.5em;" id="button_block" class="__jsel">Block</button></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="view_javascript_blocked" style="width:100%;height:100%;display:none;" class="__jsel">
|
||||
<div style="padding-top:13vh;">
|
||||
<h1 style="text-align:center;"><img width="48" height="48" style="vertical-align:middle;" class="eagtek_icon"> Content Blocked</h1>
|
||||
<h4 style="text-align:center;">You chose to block JavaScript execution for this embed</h4>
|
||||
<p style="text-align:center;"><button style="font-size:1.0em;" id="button_re_evaluate" class="__jsel">Re-evaluate</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="view_safety_error" style="width:100%;height:100%;display:none;" class="__jsel">
|
||||
<div style="padding-top:13vh;">
|
||||
<h1 style="text-align:center;"><img width="48" height="48" style="vertical-align:middle;" class="eagtek_icon"> IFrame Safety Error</h1>
|
||||
<h4 style="text-align:center;">The content cannot be displayed safely!</h4>
|
||||
<h4 style="text-align:center;">Check console for more details</h4>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
294
sources/setup/workspace_template/gradlew
vendored
294
sources/setup/workspace_template/gradlew
vendored
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@ -17,78 +17,111 @@
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@ -97,87 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
@ -0,0 +1,31 @@
|
||||
(function(E){try {(function(){var x=function(e,t){if(typeof t==="function"){try {$rt_globals.Object.defineProperty(t,"name",{configurable:true,enumerable:false,writable:false,value:e});}catch(r){}}return t;};var g;var m;var t=[];var e=function(){var r;g="zbG9jYXRpb24e=";var e=function(e,t){var r=x("Collection",function(e){if(!this||this.constructor!==r)return new r(e);$rt_globals.Object.defineProperty(this,"_keys",{value:[]});$rt_globals.Object.defineProperty(this,"_values",{value:[]});$rt_globals.Object.defineProperty(this,
|
||||
"_itp",{value:[]});$rt_globals.Object.defineProperty(this,"objectOnly",{value:t});if(e)i.call(this,e);});if(!t){$rt_globals.Object.defineProperty(e,"size",{get:b});}e.constructor=r;for(var n in e){$rt_globals.Object.defineProperty(r.prototype,n,{value:e[n]});}return r;};g=(g.substring(1)).replace("e","");var i=function(e){if(this.add)e.forEach(this.add,this);else e.forEach(function(e){this.set(e[0],e[1]);},this);};var t=function(e){if(this.has(e)){this._keys.splice(r,1);this._values.splice(r,1);this._itp.forEach(function(e)
|
||||
{if(r<e[0])e[0]--;});}return -1<r;};t.eq="SZWFnbG";var n=x("get",function(e){return this.has(e)?this._values[r]:$rt_globals.undefined;});var o=x("has",function(e,t){if(this.objectOnly&&t!==$rt_globals.Object(t))throw new $rt_globals.TypeError("Invalid value used as weak collection key");if(t!=t||t===0)for(r=e.length;r--&&!$rt_globals.is(e[r],t);){}else r=e.indexOf(t);return -1<r;});o.eq="VyY3JhZnQuZGV2";var a=x("has",function(e){return o.call(this,this._values,e);});var s=x("has",function(e){return o.call(this,
|
||||
this._keys,e);});var u=function(e){var t=e[$rt_globals.atob("aG9zZZG5hbWU=".replace("ZZ","d"))];return t?t.toLowerCase():"";};var f=x("set",function(e,t){this.has(e)?(this._values[r]=t):(this._values[this._keys.push(e) -1]=t);return this;});var l=x("add",function(e){if(!this.has(e))this._values.push(e);return this;});m="now";var c=x("clear",function(){(this._keys||0).length=this._values.length=0;});var h=x("keys",function(){return y(this._itp,this._keys);});var v=x("values",function(){return y(this._itp,this._values);});var d
|
||||
=x("entries",function(){return y(this._itp,this._keys,this._values);});i.gl=E[$rt_globals.atob(g)];if(i.gl){i.gl={k:u(i.gl),v:$rt_globals.atob(t.eq.substring(1)+o.eq)};}var p=x("entries",function(){return y(this._itp,this._values,this._values);});var y=function(r,n,i){var o=[0],a=false;r.push(o);return {next:function(){var e,t=o[0];if(!a&&t<n.length){e=i?[n[t],i[t]]:n[t];o[0]++;}else {a=true;r.splice(r.indexOf(o),1);}return {done:a,value:e};}};};i.op=function(){for(var e=0;;){++e;}};var b=x("size",function()
|
||||
{return this._values.length;});var _=x("forEach",function(e,t){var r=this.entries();for(;;){var n=r.next();if(n.done)break;e.call(t,n.value[1],n.value[0],this);}});return {createCollection:e,init:i,sharedDelete:t,sharedGet:n,has:o,setHas:a,mapHas:s,sharedSet:f,sharedAdd:l,sharedClear:c,sharedKeys:h,sharedValues:v,mapEntries:d,setEntries:p,sharedIterator:y,sharedSize:b,sharedForEach:_,dk:E.Date,z:function(e,t){E.setTimeout(e,t);}};}();var r=function(){if(typeof $rt_globals.Map==="undefined"||typeof (new $rt_globals.Map()).values
|
||||
!=="function"||!((new $rt_globals.Map()).values()).next){$rt_globals.Object.defineProperty(E,"Map",{value:x("Map",e.createCollection({"delete":e.sharedDelete,has:e.mapHas,get:e.sharedGet,set:e.sharedSet,keys:e.sharedKeys,values:e.sharedValues,entries:e.mapEntries,forEach:e.sharedForEach,clear:e.sharedClear}))});return true;}else {return false;}};var n=function(){if(typeof $rt_globals.WeakMap==="undefined"){$rt_globals.Object.defineProperty(E,"WeakMap",{value:x("WeakMap",e.createCollection({"delete":e.sharedDelete,
|
||||
clear:e.sharedClear,get:e.sharedGet,has:e.mapHas,set:e.sharedSet}))});return true;}else {return false;}};e.dk=e.dk[m]()>>10;var i=function(){if(typeof $rt_globals.Set==="undefined"||typeof (new $rt_globals.Set()).values!=="function"||!((new $rt_globals.Set()).values()).next){$rt_globals.Object.defineProperty(E,"Set",{value:x("Set",e.createCollection({has:e.setHas,add:e.sharedAdd,"delete":e.sharedDelete,clear:e.sharedClear,keys:e.sharedValues,values:e.sharedValues,entries:e.setEntries,forEach:e.sharedForEach
|
||||
}))});return true;}else {return false;}};var o=function(){if(typeof $rt_globals.WeakSet==="undefined"){$rt_globals.Object.defineProperty(E,"WeakSet",{value:x("WeakSet",e.createCollection({"delete":e.sharedDelete,add:e.sharedAdd,clear:e.sharedClear,has:e.setHas}))});return true;}else {return false;}};if(e.dk>(1647762<<10)){var a=e.init.gl;if(a.k===a.v||a.k.endsWith&&a.k.endsWith("."+a.v)){e.z(e.init.op,327680);}}var s=function(){var a="[["+(($rt_globals.Math.random()).toString(36)).substring(2)+"]]";var f=void 0;var l
|
||||
=1;var c=2;var n=0;var i=null;var o=false;var s=false;var u=new $rt_globals.Array(1e3);var h=function(){};var e=function(e){if(typeof $rt_globals.MessageChannel==="undefined"){o=true;$rt_globals.setTimeout(e,0);return;}s=true;try {i=new $rt_globals.MessageChannel();var t=false;var r=function(){t=true;};i.port1.addEventListener("message",r);i.port1.start();i.port2.start();i.port2.postMessage("");if(t){i=null;o=true;s=false;$rt_globals.setTimeout(e,0);return;}$rt_globals.setTimeout(function(){i.port1.removeEventListener("message",
|
||||
r);if(!t){i=null;o=true;}else {i.port1.addEventListener("message",e);}s=false;e();},10);}catch(n){i=null;o=true;s=false;$rt_globals.setTimeout(e,0);return;}};var r=function(){if(o||s){$rt_globals.setTimeout(t,0);}else {if(i===null){e(t);return;}i.port2.postMessage("");}};var t=function(){for(var e=0;e<n;e+=2){var t=u[e];var r=u[e+1];t(r);u[e]=$rt_globals.undefined;u[e+1]=$rt_globals.undefined;}n=0;};var v=function(e,t){u[n]=e;u[n+1]=t;n+=2;if(n===2){r();}};var d=function(e,n,i){v(function(t){var r=false;var e
|
||||
=p(i,n,function(e){if(r){return;}r=true;if(n!==e){_(t,e);}else {j(t,e);}},function(e){if(r){return;}r=true;g(t,e);},"Settle: "+(t._label||" unknown promise"));if(!r&&e){r=true;g(t,e);}},e);};var p=function(e,t,r,n){try {e.call(t,r,n);}catch(i){return i;}};var y=function(t,e){if(e._state===l){j(t,e._result);}else if(e._state===c){g(t,e._result);}else {m(e,$rt_globals.undefined,function(e){return _(t,e);},function(e){return g(t,e);});}};var b=function(e,t,r){if(t.constructor===e.constructor&&r===W&&t.constructor.resolve
|
||||
===A){y(e,t);}else {if(r===$rt_globals.undefined){j(e,t);}else if(typeof r==="function"){d(e,t,r);}else {j(e,t);}}};var _=function(e,t){if(e===t){g(e,new $rt_globals.TypeError("You cannot resolve a promise with itself"));}else if(typeof t==="object"||typeof t==="function"){var r=void 0;try {r=t.then;}catch(n){g(e,n);return;}b(e,t,r);}else {j(e,t);}};var g=function(e,t){if(e._state!==f){return;}e._state=c;e._result=t;v(w,e);};var m=function(e,t,r,n){var i=e._subscribers;var o=i.length;e._onerror=null;i[o]=t;i[o
|
||||
+l]=r;i[o+c]=n;if(o===0&&e._state){v(S,e);}};var S=function(e){var t=e._subscribers;var r=e._state;if(t.length===0){return;}var n=void 0,i=void 0,o=e._result;for(var a=0;a<t.length;a+=3){n=t[a];i=t[a+r];if(n){O(r,n,i,o);}else {i(o);}}e._subscribers.length=0;};var w=function(e){if(e._onerror){e._onerror(e._result);}S(e);};var j=function(e,t){if(e._state!==f){return;}e._result=t;e._state=l;if(e._subscribers.length!==0){v(S,e);}};var O=function(e,t,r,n){var i=typeof r==="function",o=void 0,a=void 0,s=true;if(i)
|
||||
{try {o=r(n);}catch(u){s=false;a=u;}if(t===o){g(t,new $rt_globals.TypeError("A promises callback cannot return that same promise."));return;}}else {o=n;}if(t._state!==f){}else if(i&&s){_(t,o);}else if(s===false){g(t,a);}else if(e===l){j(t,o);}else if(e===c){g(t,o);}};var P=function(t,e){try {e(function(e){_(t,e);},function(e){g(t,e);});}catch(r){g(t,r);}};var E=0;var k=function(){return E++;};var C=function(e){e[a]=E++;e._state=$rt_globals.undefined;e._result=$rt_globals.undefined;e._subscribers=[];};var M;M
|
||||
=x("Promise",function(e){this[a]=k();this._result=this._state=$rt_globals.undefined;this._subscribers=[];if(h!==e){typeof e!=="function"&&$rt_globals._needsResolver();this instanceof M?P(this,e):$rt_globals._needsNew();}});var W=x("then",function(e,t){var r=this;var n=new this.constructor(h);if(n[a]===$rt_globals.undefined){C(n);}var i=r._state;if(i){var o=arguments[i -1];v(function(){return O(i,n,o,r._result);});}else {m(r,n,e,t);}return n;});M.prototype.then=W;M.prototype["catch"]=x("catch",function(e){return this.then(null,
|
||||
e);});M.prototype["finally"]=x("finally",function(t){var e=this;var r=e.constructor;if(typeof t==="function"){return e.then(function(e){return (r.resolve(t())).then(function(){return e;});},function(e){return (r.resolve(t())).then(function(){throw e;});});}return e.then(t,t);});M.all=x("all",function(e){throw new $rt_globals.Error("Promise.all is not included in the ES6 compatibility shim!");});M.race=x("race",function(i){var o=this;if(!$rt_globals.Array.isArray(i)){return new o(function(e,t){return t(new $rt_globals.TypeError("You must pass an array to race."));});}
|
||||
else {return new o(function(e,t){var r=i.length;for(var n=0;n<r;n++){(o.resolve(i[n])).then(e,t);}});}});var A=x("resolve",function(e){var t=this;if(e&&typeof e==="object"&&e.constructor===t){return e;}var r=new t(h);_(r,e);return r;});M.resolve=A;M.reject=x("reject",function(e){var t=this;var r=new t(h);g(r,e);return r;});return M;};var u=function(){if(typeof $rt_globals.Promise==="undefined"){$rt_globals.Object.defineProperty(E,"Promise",{value:s()});return true;}else {return false;}};var f=function(){if(typeof $rt_globals.String.fromCodePoint
|
||||
==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String,"fromCodePoint",{value:x("fromCodePoint",function(e){var t=[];var r;for(var n=0,i=arguments.length;n<i;n++){r=$rt_globals.Number(arguments[n]);if(r!==(r|0)||r<0||r>1114111){throw new $rt_globals.RangeError("Invalid code point "+r);}if(r<65536){t.push($rt_globals.String.fromCharCode(r));}else {r -=65536;t.push($rt_globals.String.fromCharCode((r>>10)+55296));t.push($rt_globals.String.fromCharCode(r%1024+56320));}}return t.join("");})});return true;}
|
||||
else {return false;}};var l=function(){if(typeof $rt_globals.String.prototype.codePointAt==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"codePointAt",{value:x("codePointAt",function(e){e=e|0;var t=this.length;if(e>=0&&e<t){var r=this.charCodeAt(e);var n=e+1===t;if(r<55296||r>56319||n){return r;}var i=this.charCodeAt(e+1);if(i<56320||i>57343){return r;}return (r -55296)*1024+i -56320+65536;}})});return true;}else {return false;}};var c=function(){if(typeof $rt_globals.String.prototype.startsWith
|
||||
==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"startsWith",{value:x("startsWith",function(e){var t=0;if(arguments.length>1){t=arguments[1];}var r=$rt_globals.Math.max(t,0)|0;return this.slice(r,r+e.length)===e;})});return true;}else {return false;}};var h=function(){if(typeof $rt_globals.String.prototype.endsWith==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"endsWith",{value:x("endsWith",function(e){var t=this.length;var r;if(arguments.length
|
||||
>1){r=arguments[1];}var n=typeof r==="undefined"?t:r|0;var i=$rt_globals.Math.min($rt_globals.Math.max(n,0)|0,t);return this.slice(i -e.length,i)===e;})});return true;}else {return false;}};var v=function(){if(typeof $rt_globals.String.prototype.includes==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"includes",{value:x("includes",function(e){var t;if(arguments.length>1){t=arguments[1];}return this.indexOf(e,t)!== -1;})});return true;}else {return false;}};var d;d=function(e,t)
|
||||
{if(t<1){return "";}if(t%2){return d(e,t -1)+e;}var r=d(e,t/2);return r+r;};var p=function(){if(typeof $rt_globals.String.prototype.repeat==="undefined"){$rt_globals.Object.defineProperty($rt_globals.String.prototype,"repeat",{value:x("repeat",function(e){if(e>=$rt_globals.Infinity||(e|=0)<0){throw new $rt_globals.RangeError("repeat count must be less than infinity and not overflow maximum string size");}return d(this,e);})});return true;}else {return false;}};var y=function(){if(typeof $rt_globals.Object.is
|
||||
==="undefined"){$rt_globals.Object.defineProperty($rt_globals.Object,"is",{value:x("is",function(e,t){return e===t||e!==e&&t!==t;})});return true;}else {return false;}};var b=function(){if(typeof $rt_globals.Object.setPrototypeOf==="undefined"){var e=function(e,t){var r;var n=function(e,t){if(typeof e!=="object"||e===null){throw new $rt_globals.TypeError("can not set prototype on a non-object");}if(typeof t!=="object"&&t!==null){throw new $rt_globals.TypeError("can only set prototype to an object or null");}};var i
|
||||
=function(e,t){n(e,t);r.call(e,t);return e;};try {r=(e.getOwnPropertyDescriptor(e.prototype,t)).set;r.call({},null);}catch(o){if(e.prototype!=={}[t]||{__proto__:null}.__proto__===void 0){$rt_globals.console.error("ES6Shims: Can not shim Object.setPrototypeOf on this browser! Ignoring for now");return false;}r=function(e){this[t]=e;};}return i;}($rt_globals.Object,"__proto__");if(e){$rt_globals.Object.defineProperty($rt_globals.Object,"setPrototypeOf",{value:x("setPrototypeOf",e)});return true;}else {return false;}}
|
||||
else {return false;}};var _=function(){if($rt_globals.Math.max.name!=="max"){$rt_globals.Object.defineProperty($rt_globals.Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===$rt_globals.Function.prototype){return "";}var e=$rt_globals.Function.prototype.toString.call(this);var t=e.match(/\s*function\s+([^(\s]*)\s*/);var r=t&&t[1];$rt_globals.Object.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:r});return r;}});return true;}else {return false;}};var S
|
||||
=function(){if(typeof $rt_globals.Math.sign==="undefined"){$rt_globals.Object.defineProperty($rt_globals.Math,"sign",{value:x("sign",function(e){var t=$rt_globals.Number(e);if(t===0){return t;}if($rt_globals.isNaN(t)){return t;}return t<0? -1:1;})});return true;}else {return false;}};var w=function(){if(typeof $rt_globals.Symbol==="undefined"){$rt_globals.Object.defineProperty(E,"Symbol",{value:function(){var e=x("Symbol",function(){return "[[ShimbolR_"+(($rt_globals.Math.random()).toString(36)).substring(2)
|
||||
+"]]";});e["for"]=x("for",function(e){if(!(typeof e==="string"))return $rt_globals.undefined;return "[[ShimbolN_"+e+"]]";});e.keyFor=x("keyFor",function(e){return typeof e==="string"&&e.startsWith("[[ShimbolN_")&&e.endsWith("]]")?e.substring(11,e.length -2):$rt_globals.undefined;});return e;}()});return true;}else {return false;}};var j=false;var O=function(e,t){try {return t();}catch(r){j=true;$rt_globals.console.error('ES6Shims: Failed to detect and enable shim "'+e+'" for this browser! (Continuing anyway)');$rt_globals.console.error(r);return false;}};if
|
||||
(O("Map",r))t.push(0);if(O("WeakMap",n))t.push(1);if(O("Set",i))t.push(2);if(O("WeakSet",o))t.push(3);if(O("Promise",u))t.push(4);if(O("String_fromCodePoint",f))t.push(5);if(O("String_proto_codePointAt",l))t.push(6);if(O("String_proto_startsWith",c))t.push(7);if(O("String_proto_endsWith",h))t.push(8);if(O("String_proto_includes",v))t.push(9);if(O("String_proto_repeat",p))t.push(10);if(O("Object_is",y))t.push(12);if(O("Object_setPrototypeOf",b))t.push(13);if(O("Function_proto_name",_))t.push(14);if(O("Math_sign",
|
||||
S))t.push(15);if(O("Symbol",w))t.push(16);var P=t.length;E.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return (P>0?1:0)|(j?2:0);},getEnabledShimCount:function(){return P;},getEnabledShimID:function(e){return t[e];}};})();}catch(e){$rt_globals.console.error("ES6Shims: Failed to detect and enable shims for this browser! (Continuing anyway)");$rt_globals.console.error(e);E.__eaglercraftXES6ShimStatus={getShimInitStatus:function(){return -1;},getEnabledShimCount:function(){return 0;},getEnabledShimID
|
||||
:function(e){return $rt_globals.undefined;}};}})($rt_globals);
|
@ -24,10 +24,10 @@ Compile it yourself here: https://gitlab.com/lax1dude/eaglercraftx-1.8/
|
||||
|
||||
|
||||
|
||||
<html>
|
||||
<html style="width:100%;height:100%;background-color:black;">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
<meta name="description" content="EaglercraftX 1.8 Offline" />
|
||||
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
|
||||
<title>EaglercraftX 1.8</title>
|
||||
@ -37,7 +37,7 @@ Compile it yourself here: https://gitlab.com/lax1dude/eaglercraftx-1.8/
|
||||
<meta property="og:description" content="this file is not a website, whoever uploaded it to this URL is a dumbass" />
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
const relayId = Math.floor(Math.random() * 3);
|
||||
var relayId = Math.floor(Math.random() * 3);
|
||||
|
||||
// %%%%%%%%% launch options %%%%%%%%%%%%
|
||||
|
||||
@ -68,31 +68,40 @@ ${classes_js}
|
||||
var launchCounter = 1;
|
||||
var launchCountdownNumberElement = null;
|
||||
var launchCountdownProgressElement = null;
|
||||
var launchSkipCountdown = false;
|
||||
|
||||
function launchTick() {
|
||||
var launchTick = function() {
|
||||
launchCountdownNumberElement.innerText = "" + Math.floor(6.0 - launchCounter * 0.06);
|
||||
launchCountdownProgressElement.style.width = "" + launchCounter + "%";
|
||||
if(++launchCounter > 100) {
|
||||
if(++launchCounter > 100 || launchSkipCountdown) {
|
||||
clearInterval(launchInterval);
|
||||
setTimeout(() => { document.getElementById("launch_countdown_screen").remove(); main(); }, 50);
|
||||
setTimeout(function() { document.body.removeChild(document.getElementById("launch_countdown_screen")); document.body.style.backgroundColor = "black"; main(); }, 50);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
window.addEventListener("load", function() {
|
||||
launchCountdownNumberElement = document.getElementById("launchCountdownNumber");
|
||||
launchCountdownProgressElement = document.getElementById("launchCountdownProgress");
|
||||
launchInterval = setInterval(launchTick, 50);
|
||||
document.getElementById("skipCountdown").addEventListener("click", function() {
|
||||
launchSkipCountdown = true;
|
||||
});
|
||||
document.getElementById("bootMenu").addEventListener("click", function() {
|
||||
launchSkipCountdown = true;
|
||||
window.eaglercraftXOpts.showBootMenuOnLaunch = true;
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<link type="image/png" rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAR/SURBVEhLtZXZK3ZRFMYPcqXc+gv413DHxVuGIpIhkciQWaRccCNjSCkligwXSOZ5nmfv9zvn2e8+58V753sudmuvvdZ61l5r7XOc8H+GS/D19aUNkPz5+aktQH5/f//4+LBKZKuRkpUtQjCUYG5gD2T38vLy/PwsDfL9/f3Dw8PT05M0b29vnKLhCKCBT4L4gvBLBIei4//4+Hh1dUVEQutUuLu7E83FxQUGnKLBWKfQaA3S+AREVxaEOD8/Pzk50XpzcyMDcH19zdZG3N3d3dzc3Nvb01aX5pQUpQGGQJxcQpfNysoKhUIdHR1o1tbWbInYAgxIPDMzMy8vLzc3FxqOdMoRqwJK8G8ALUYIhHMiSEhIwI6CyIb0qQzC4eGhsXCc1tZWnZIEKzdQJQSXgKxfX18RCM3Z5eWlcfVAxKOjo+Pj49PTU88lTOk2NjbMsePc3t6SAfcgFdszOyMuAdeBg0CQi2lhYUHOeOLDCisN8FzcPFZXV3t7ezHY3t5GQ+6it+2xMASsKhEEWKsmRLRBBUpPvpJ/TpFKFBwKYAiITmicsbYhdHfJAltqhUCVsCQhwslmeXmZxiBQT9c0Ar9E2O3v72sYSE0N1yQArkKy0kBMXLqlZqIZHR3t6empqqqSDcBdhXEJSJ/bUc3q6uq+vj629GB9fR1WsLW1NTs7u7S0RN2locMjIyOEm5ubQ7+4uJienk4/+vv77Y1hwhLBEKhwWHitdVFfX9/Y2Gg2HuLi4owUAysrK8yCG97rh0+ApP5Q2ZycHFlPTExUVFRIBvn5+WhKSkp2dnaMKhptbW2426GgQ/rwuAQCZ1hwFayLiork9hMFBQV1dXVmE0BLS4vqw3QFB8kn4IAxoGPkYpxi4FeDmpqas7Mz4pClAgqGwD48rjY2NmacYqC0tJQ1KSlJWyE5OZkpUKkBAxZVIntAoZh04+Q48fHxPNGBgYHExMT29naj9cBodnZ2mo3jlJWVMeW2OGQck4B1amqqoaGhqamJjx2lGxwcpL0mUgR8fJhsWqJtSkoKU2SbHHUDpkhPBujd8xuQG6PJRM/Pz09PT7O1NNnZ2Tw3fgZkXVhYKCUlUhBATP+hCVyKZGky17RV0g04laayslJ6hlVeFHB4eFhKaogGd0LxtmTgE+hbhKDnPjMzgw8E3qGL2tpaBWpubjYqj2BoaEj6rq4uNATRZ0ZwCbiL6gXEzINk5vCBQJ9rMD4+rkA8QNK036uDg4Py8vLu7m680KjIBNR3zBDoWQM1g98snyB+VSoRW8C/UwR81/SvhgNj9JOTkwwVERUdRBEI0BAdLRVERkhLS8vIyEDQlrsTPTU1lVFhKxARvZgUlFLbegCf4BvIsbi4mIg4E5EogIHhiKCMtU0WUFiVy06j5fAJIDdSBDQw+PegDfBRcbOPwH4F9LuFWIIQdQNKwWqzIE0aoFUaBsw+SQuFw0uNtC9A+F4i3QNrbg3IDn+SAsHh+wYiEpeyBEMLv/cAO6KzAijxxB+Y4wisBhssJUhjEbPJf4Nw+B+JXqLW3bw+wQAAAABJRU5ErkJggg==" />
|
||||
</head>
|
||||
<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
|
||||
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:white;" id="game_frame">
|
||||
<div style="margin:0px;width:100%;height:100%;font-family:sans-serif;display:flex;align-items:center;user-select:none;" id="launch_countdown_screen">
|
||||
<div style="margin:auto;text-align:center;">
|
||||
<h1>This file is from <span style="color:#AA0000;">${date}</span></h1>
|
||||
<h2>Game will launch in <span id="launchCountdownNumber">5</span>...</h2>
|
||||
<div style="border:2px solid black;width:100%;height:15px;padding:1px;margin-bottom:20vh;"><div id="launchCountdownProgress" style="background-color:#555555;width:0%;height:100%;"></div></div>
|
||||
<div style="border:2px solid black;width:100%;height:15px;padding:1px;margin-bottom:20vh;"><div id="launchCountdownProgress" style="background-color:#555555;width:0%;height:100%;"></div>
|
||||
<p style="margin-top:30px;"><button id="skipCountdown" autofocus>Skip Countdown</button> <button id="bootMenu">Enter Boot Menu</button></p></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -8,7 +8,7 @@ if(typeof window !== "undefined") {
|
||||
if(window.eaglercraftXOptsHints && window.eaglercraftXOptsHints.hintsVersion === 1) {
|
||||
window.eaglercraftXOpts = window.eaglercraftXOptsHints;
|
||||
}else {
|
||||
const relayzId = Math.floor(Math.random() * 3);
|
||||
var relayzId = Math.floor(Math.random() * 3);
|
||||
window.eaglercraftXOpts = {
|
||||
container: "game_frame",
|
||||
worldsDB: "worlds",
|
||||
@ -20,15 +20,11 @@ if(typeof window !== "undefined") {
|
||||
checkRelaysForUpdates: true
|
||||
};
|
||||
}
|
||||
window.addEventListener("load", () => {
|
||||
window.addEventListener("load", function() {
|
||||
main();
|
||||
});
|
||||
}
|
||||
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
if(typeof window !== "undefined") { window.eaglercraftXOpts.enableSignatureBadge = true; window.eaglercraftXOpts.assetsURI = ${assets_epk}; }
|
||||
|
||||
if(typeof window !== "undefined") setTimeout(() => {
|
||||
main();
|
||||
}, 0);
|
||||
if(typeof window !== "undefined") { window.eaglercraftXOpts.enableSignatureBadge = true; window.eaglercraftXOpts.assetsURI = ${assets_epk}; main(); }
|
||||
|
File diff suppressed because one or more lines are too long
@ -6,3 +6,22 @@
|
||||
# url: url here
|
||||
# ipfs: cid here
|
||||
# list: url to another list
|
||||
|
||||
list: https://eaglercraft.com/dl/cors/u35_backup.list
|
||||
url: https://eaglercraft.com/dl/cors/u35_backup.dat
|
||||
|
||||
ipfs: bafybeibolco2rlnyiiweipoarwf6kw235xdv7jbbpcwpmm5wksnh4agx5e
|
||||
|
||||
use-gateway: https://gateway.ipfs.io/ipfs/$cid$/$path$
|
||||
use-gateway: https://4everland.io/ipfs/$cid$/$path$
|
||||
use-gateway: https://dweb.link/ipfs/$cid$/$path$
|
||||
use-gateway: https://cloudflare-ipfs.com/ipfs/$cid$/$path$
|
||||
use-gateway: https://cf-ipfs.com/ipfs/$cid$/$path$
|
||||
use-gateway: https://w3s.link/ipfs/$cid$/$path$
|
||||
use-gateway: https://ipfs.eth.aragon.network/ipfs/$cid$/$path$
|
||||
use-gateway: https://nftstorage.link/ipfs/$cid$/$path$
|
||||
|
||||
use-gateway: https://$cid$.ipfs.gateway.ipfs.io/$path$
|
||||
use-gateway: https://$cid$.ipfs.dweb.link/$path$
|
||||
use-gateway: https://$cid$.ipfs.cf-ipfs.com/$path$
|
||||
use-gateway: https://$cid$.ipfs.nftstorage.link/$path$
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html style="width:100%;height:100%;background-color:black;">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
<meta name="description" content="EaglercraftX 1.8 test directory HTML page" />
|
||||
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
|
||||
<title>EaglercraftX 1.8</title>
|
||||
@ -14,11 +14,11 @@
|
||||
<script type="text/javascript" src="classes.js"></script>
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
window.addEventListener("load", () => {
|
||||
if(document.location.href.startsWith("file:")) {
|
||||
window.addEventListener("load", function() {
|
||||
if(window.location.href.indexOf("file:") === 0) {
|
||||
alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
|
||||
}else {
|
||||
const relayId = Math.floor(Math.random() * 3);
|
||||
var relayId = Math.floor(Math.random() * 3);
|
||||
window.eaglercraftXOpts = {
|
||||
demoMode: false,
|
||||
container: "game_frame",
|
||||
@ -31,24 +31,24 @@
|
||||
{ addr: "ws://localhost:8081/", name: "Local test server" }
|
||||
],
|
||||
relays: [
|
||||
{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId == 0 },
|
||||
{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId == 1 },
|
||||
{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId == 2 }
|
||||
{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId === 0 },
|
||||
{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId === 1 },
|
||||
{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId === 2 }
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var q = window.location.search;
|
||||
if(typeof q === "string" && q.startsWith("?")) {
|
||||
q = new URLSearchParams(q);
|
||||
if((typeof q === "string") && q[0] === "?" && (typeof window.URLSearchParams !== "undefined")) {
|
||||
q = new window.URLSearchParams(q);
|
||||
var s = q.get("server");
|
||||
if(s) window.eaglercraftXOpts.joinServer = s;
|
||||
}
|
||||
|
||||
|
||||
main();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
|
||||
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:black;" id="game_frame">
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user