Archive eaglerlite (client, unknown, clean)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"slug": "eaglerlite",
|
||||
"name": "EaglerLite",
|
||||
"category": "client",
|
||||
"mc_version": "unknown",
|
||||
"author": "PlanetDogeCodes",
|
||||
"license": "unknown",
|
||||
"upstream_ref": "unknown",
|
||||
"sha256": "959ce543fbac0816806af447c63bbd10075885f237db273939e6225552040700",
|
||||
"size": 15648341,
|
||||
"storage": {
|
||||
"git_path": "eaglerlite/",
|
||||
"fs_url": "https://fs-archive.eaglercraft.tech/archives/eaglerlite.tar.gz"
|
||||
},
|
||||
"play": {
|
||||
"sandbox_url": "https://play-archive.eaglercraft.tech/eaglerlite/",
|
||||
"sandbox_attr": "allow-scripts allow-same-origin allow-pointer-lock",
|
||||
"network_notes": "May connect to user-chosen wss:// multiplayer servers."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://github.com/PlanetDogeCodes/EaglerLite",
|
||||
"retrieved_at": "2026-11-28T06:10:00Z",
|
||||
"type": "upstream",
|
||||
"notes": "Official PlanetDogeCodes/EaglerLite GitHub repository."
|
||||
}
|
||||
],
|
||||
"vetting": {
|
||||
"verdict": "clean",
|
||||
"tools": [
|
||||
"vet-static.mjs",
|
||||
"virustotal-hash",
|
||||
"static-code-review"
|
||||
],
|
||||
"date": "2026-11-28",
|
||||
"notes": "Standard TeaVM/Eaglercraft loader.js (XHR, script injection, localStorage).",
|
||||
"reviewer": "vet-gemini-2"
|
||||
},
|
||||
"large_files_omitted_from_git": [
|
||||
{
|
||||
"file": "eaglerlite/source file/1-12source.gz",
|
||||
"size": 15601341
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# EaglerLite
|
||||
|
||||
Lightweight optimization layer and successor to Eagletcraft designed to minimize RAM usage and lag for Eaglercraft on low-end hardware and Chromebooks.
|
||||
|
||||
- **Archive page:** https://archive.eaglercraft.tech/clients/eaglerlite.html
|
||||
- **Play:** https://play-archive.eaglercraft.tech/eaglerlite/
|
||||
- **Large download (fs-archive):** https://fs-archive.eaglercraft.tech/archives/eaglerlite.tar.gz
|
||||
- **MC Version:** unknown
|
||||
- **Author:** PlanetDogeCodes
|
||||
- **License:** unknown
|
||||
- **SHA-256:** `959ce543fbac0816806af447c63bbd10075885f237db273939e6225552040700`
|
||||
- **Vetting:** clean (2026-11-28)
|
||||
|
||||
## Files hosted on fs-archive (>20 MB)
|
||||
- `eaglerlite/source file/1-12source.gz` (15601341 bytes)
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,44 @@
|
||||
# EaglerLite
|
||||
|
||||
A lightweight but powerful optimization layer for Eaglercraft.
|
||||
|
||||
### What it actually is
|
||||
|
||||
EaglerLite is an optimized launcher that fetches the Eaglercraft client, injects an optimizer script into it (and more recently, the EaglerLite API), and opens the result in a new `about:blank` tab. Nothing about vanilla gameplay is changed because the optimizer only touches rendering and input stuff (unless the crystal optimizer counts ig).
|
||||
|
||||
### How it works
|
||||
|
||||
When you click Launch, the launcher:
|
||||
|
||||
1. Fetches the Eaglercraft source
|
||||
2. Strips the XML prolog
|
||||
3. Builds a new HTML document containing the original client plus the API
|
||||
4. Opens `about:blank` in a new tab and writes the combined document via `document.open()` / `document.write()` / `document.close()`
|
||||
|
||||
Because the game runs from `about:blank`, its origin is `null`, which makes the tab harder to fingerprint.
|
||||
|
||||
### Proxy and Connections
|
||||
|
||||
Eaglercraft servers are WebSocket-based. When the game calls `new WebSocket(url)`, EaglerLite tries 3 things:
|
||||
|
||||
1. **Direct** — open the WebSocket directly from the `about:blank` tab. Works for servers that accept `Origin: null`.
|
||||
2. **Simple proxy** — if direct fails before opening, retry through a WebSocket proxy server that rewrites the `Origin` header to a real value. The proxy is an inbuilt node.js container thing.
|
||||
3. **Epoxy-TLS** — if the proxy also fails, fall back to epoxy-TLS (many thanks to Mercury Workshop), which does TLS in-browser via WASM and tunnels through wisp.
|
||||
|
||||
### Credits
|
||||
|
||||
- Eaglercraft — not created by me
|
||||
- EaglerLite — created and mantained by [PlanetDoge](https://github.com/PlanetDogeCodes)
|
||||
|
||||
### Disclaimer
|
||||
EaglerLite is a tool and is not affiliated with, endorsed by, or sponsored by Mojang Studios, Microsoft, or the creators of Eaglercraft. "Minecraft" is a trademark of Mojang Studios. All trademarks and registered trademarks are the property of their respective owners.
|
||||
|
||||
EaglerLite does not distribute or modify any game files. It is a launcher that fetches and runs Eaglercraft, which is separately developed and maintained by third parties. EaglerLite's code interacts with the game at the browser API level only — no game assets, source code, or proprietary content are included, modified, or redistributed.
|
||||
|
||||
This software is provided "as is," without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
|
||||
|
||||
By using EaglerLite, you acknowledge that you are solely responsible for complying with any applicable terms of service, end-user license agreements, or other policies that may govern your use of the game or its associated services. The author(s) of EaglerLite do not condone, encourage, or facilitate any violation of such terms.
|
||||
|
||||
### Feedback
|
||||
|
||||
Bugs, feature requests, or questions: [Discord](https://discord.gg/2Tz8wxv9yu) or [open an issue](https://github.com/PlanetDogeCodes/EaglerLite).
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Module>
|
||||
<ModulePrefs title="Loading" />
|
||||
<Content type="html"><![CDATA[
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE 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, minimum-scale=1.0, maximum-scale=1.0">
|
||||
<title>Home - Classroom</title>
|
||||
<script type="text/javascript">
|
||||
window.disableUserscripts = true;
|
||||
window.__eaglercraftLoaderClient = {
|
||||
container: "game_frame",
|
||||
name: "Home - Classroom",
|
||||
file: "net.peytonplayz585.eaglercraft.v1_12.client",
|
||||
cid: "bafybeidrnchyech7b26rqhm3tayt7p6mxvl23lzd4f5mcyqda7hbrzyal4",
|
||||
path: "",
|
||||
download: "https://cdn.jsdelivr.net/gh/PlanetDogeCodes/EaglerLite@main/source%20file/1-12source.gz",
|
||||
dlSize: 15601341,
|
||||
gzip: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/PlanetDogeCodes/EaglerLite@main/source%20file/loader.js"></script>
|
||||
<link type="image/png" rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/genizy/mc@main/shared/game.png" />
|
||||
</head>
|
||||
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:white;">
|
||||
<div id="game_frame" style="width:100%;height:100%;"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
]]></Content>
|
||||
</Module>
|
||||
@@ -0,0 +1,511 @@
|
||||
/*
|
||||
Thought that I'd come back around and explain some things after 2 years of this amlost exact opts config running.
|
||||
This loader fetches the game source (in this case, 1.12.2.gz) from GitHub using the JSdelivr CDN. It then caches the ENTIRE game code inside your browser's IndexedDB
|
||||
Upon next launch, if the game is already cached, it skips the download step unless there was a recent modification.
|
||||
|
||||
Essentially, this is a roundabout way of launching the game that doesn't require a massive HTML file to be stored and opened directly.
|
||||
Even better, because the game source gets cached locally, after fetching and decompressing the source once you never have to again. This means offline play is completely possible.
|
||||
|
||||
And yet another included benefit is speed. Because the browser doesn't have to decompress the entire HTML every time you launch (the pre-decompressed code is already cached
|
||||
in-memory), and most modern browsers employ V8 bytecode caching, smaller assets can be processed asynchronously while the engine starts up, which means the game launches about 14x faster.
|
||||
|
||||
Essentially, this is getting the same performance of an integrated web sever but it's all local.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
(function(){
|
||||
const opts = {};
|
||||
var progressPanel = null;
|
||||
var progressStr1 = null;
|
||||
var progressStr2 = null;
|
||||
var progressStr3 = null;
|
||||
var progressBarOuter = null;
|
||||
var progressBarInner = null;
|
||||
var cancelButton = null;
|
||||
var currentXHR = null;
|
||||
|
||||
const LOADING_ICON_SRC = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAGFBMVEUAAAA/QT5dX1x5e3iYmpe0trPS1NH///9divB0AAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6AEXAik7MKTXeAAAA6NJREFUWMPVmDGz2yAMx5mqj5D1XRev764D6xt6x9qp+gQtK5ek0dcvQgKETeLkJR2K7+LEDvr5jyQscPRwc/9Jl/jvKXF7SHslhc31AwWCiP3ahPJnZe+yQ8lmEClbVQgWSKAQQv5OHfOMlmIyWAxrC7QsS/4ko2aPcvp6hSI+QIBsMD95RB0wJA+HwyK/KsZQksuNzufBIrfTVAsb+MG3QQaoHFlVubT4OoQF47oPhDKaLJR0RUuMpYsD3zEUyiVH4hmca3GwpbgJJXYtuQt7J5TDe1evFdBKy2MUyQv8kC5sTiDBL+UK6G/F3EP5PqFI6qEvJgNWTCgYAMQGafIlL86n4n1j70zHjMZZjEVJSPYCm2wHBv+eu4jr6dl8US0hNDd3ECd/LOqI8GmKBqsYapDisHJPZ4DntWwx2O5AdpjOAdzl8vsyn7H+NJ8lE2iVgibtiCTOvGjh71AjDaXL5QrEhB+Z3NQYEyOC8vngGWBZfPhZpjeOAQCvD+L63DKZxMh9+cVn/sNxpGA2AgTZCH8eMobPcGAJ3GrWoMkXt99OhqKZUvLLgZwB1j1ES6xazp2SVufeVrnvYYDM2ie0AA1aQp0Wb0FGv1TXpK6Ab0yVVC0hOLAD1bzRyNC0xBWlYVIaKYlGLZwZMA4YNGSl0LLSQun2gE20IIqaDaSN2GGtZc81Wy3ZwNYnMDrf65R5NwXWWvIxpcAYyDRqSemRGCvvj7CnJWy0VM+QzZWG3vqFj3d9V4IJAxt19R1juh/1mQenH9OUou9GX6IXBlE5spoW1LelpbzJnz4s5fRtNmI6ZJ6WLaUNJHSMpSSxllKyA5XSzC+KWbQg60HMpkOvY7hmHignGSs6p+4Zfsccr2gpGK1hPGl06fODAmlTw9CpW0vi9zSr/bQeK5ggFH67fCgFS2hUCtfOqzeypdjnn1DqoEltyaGQhILluq+6ZC3zWUpdsfhU68jQBixqwoquuKkuUqMkm+/lV6sBTM2fzb0Vv4SVYaOFdijOUOY1f9WCRotcB/keb2o571KaFmh1stHCoQ3T9YulFF90TwyLi1ELtdI7WC3BQm5Sbq74qpYDiF843kCd36vkfS3nexbvWYvTugxl6GLbBehLvusUuG+LwKlfZJB6rRmvrCt1MfEYJXumLvdC9cp6u+FGNb5PiW3SDFi1DBsO8TXr/QoquxVYU7D6JV7Zu/jUPkxtZkNkswX0mm2oHcgrN7s6Jr5g5+ovpIaM1+QieF8AAAAASUVORK5CYII=";
|
||||
|
||||
function makePatternA(domain) {
|
||||
const domainStr = domain;
|
||||
return (cid, path) => { return "https://" + domainStr + "/ipfs/" + cid + "/" + path; };
|
||||
}
|
||||
|
||||
function makePatternB(domain) {
|
||||
const domainStr = domain;
|
||||
return (cid, path) => { return "https://" + cid + ".ipfs." + domain + "/" + path; };
|
||||
}
|
||||
|
||||
Object.defineProperty(window, 'eaglercraftXOpts', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
set(value) {
|
||||
value.servers = [
|
||||
{ addr: "wss://mc.1b2t.xyz", name: "1 Builder 2 Tools Anarchy" },
|
||||
{ addr: "wss://anarchy.playit.plus", name: "1B2T Alternate Link" },
|
||||
{ addr: "wss://mc.voidsent.net", name: "Voidsent MC" },
|
||||
{ addr: "https://github.com/PlanetDogeCodes/EaglerLite", name: "EaglerLite created by Planet_Doge" },
|
||||
{ addr: "Contact us on this Discord: https://discord.gg/UEE39zHuCx", name: "Want to see your server here?" }
|
||||
];
|
||||
this._eaglercraftXOpts = value;
|
||||
},
|
||||
get() {
|
||||
return this._eaglercraftXOpts;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Cloudflare IPFS was discontinued, so no more of those links
|
||||
const IPFS_GATEWAYS = [
|
||||
makePatternA("gateway.ipfs.io"),
|
||||
makePatternB("4everland.io"),
|
||||
makePatternB("dweb.link"),
|
||||
makePatternA("w3s.link"),
|
||||
makePatternA("storry.tv"),
|
||||
|
||||
// NFTstorage no longer accepts uploads so I may remove this if I need to make some major updates to the loader
|
||||
makePatternB("nftstorage.link")
|
||||
];
|
||||
|
||||
function tryDecompressDownload(arrayBufferIn) {
|
||||
return new Promise((resolve) => {
|
||||
var ds = new DecompressionStream("gzip");
|
||||
var result = [];
|
||||
function fetchStream(reader) {
|
||||
return reader.read().then(function processData({ done, value }) {
|
||||
if (done) {
|
||||
var ret = new Blob(result);
|
||||
result = [];
|
||||
return ret.arrayBuffer();
|
||||
}
|
||||
result.push(value);
|
||||
return reader.read().then(processData);
|
||||
})
|
||||
}
|
||||
fetchStream((new Blob([arrayBufferIn])).stream().pipeThrough(ds).getReader()).then((arrayBufferOut) => {
|
||||
resolve(arrayBufferOut);
|
||||
}).catch((err) => {
|
||||
console.error("Could not decompress file!");
|
||||
console.error(err);
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function tryDownloadURL(ipfsURL) {
|
||||
const theIpfsURL = ipfsURL;
|
||||
return new Promise((resolve) => {
|
||||
var percentDone = -1.0;
|
||||
const xhr = currentXHR = new XMLHttpRequest();
|
||||
cancelButton.disabled = false;
|
||||
cancelButton.style.display = "inline";
|
||||
xhr.open("GET", ipfsURL);
|
||||
xhr.responseType = "arraybuffer";
|
||||
xhr.addEventListener("progress", (evt) => {
|
||||
updateProgressBar("Update: " + Math.round(evt.loaded * 0.001) + " / " + Math.round(opts.dlSize * 0.001) + " kB", theIpfsURL, Math.min(evt.loaded / opts.dlSize, 1.0));
|
||||
});
|
||||
xhr.addEventListener("readystatechange", (evt) => {
|
||||
if(xhr.readyState === XMLHttpRequest.DONE) {
|
||||
updateProgressBar("Update: " + Math.round(opts.dlSize * 0.001) + " / " + Math.round(opts.dlSize * 0.001) + " kB", theIpfsURL, Math.min(evt.loaded / opts.dlSize, 1.0));
|
||||
if(cancelButton !== null) {
|
||||
cancelButton.disabled = true;
|
||||
currentXHR = null;
|
||||
}
|
||||
currentXHR = null;
|
||||
if(xhr.status === 200) {
|
||||
resolve(xhr.response);
|
||||
}else {
|
||||
console.error("Got response code " + xhr.status + " for: " + theIpfsURL);
|
||||
resolve(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
xhr.addEventListener("error", (evt) => {
|
||||
if(cancelButton !== null) {
|
||||
cancelButton.disabled = true;
|
||||
}
|
||||
currentXHR = null;
|
||||
console.error("Could not complete request to: " + theIpfsURL);
|
||||
resolve(null);
|
||||
});
|
||||
xhr.addEventListener("load", (evt) => {
|
||||
if(cancelButton !== null) {
|
||||
cancelButton.disabled = true;
|
||||
}
|
||||
currentXHR = null;
|
||||
});
|
||||
xhr.addEventListener("abort", (evt) => {
|
||||
console.error("Request aborted: " + theIpfsURL);
|
||||
if(cancelButton !== null) {
|
||||
cancelButton.disabled = true;
|
||||
}
|
||||
currentXHR = null;
|
||||
resolve(null);
|
||||
});
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
function delayProgress(delayMS) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, delayMS);
|
||||
});
|
||||
}
|
||||
|
||||
async function tryDownloadClient(download) {
|
||||
var rand = Math.floor(Math.random() * IPFS_GATEWAYS.length);
|
||||
for(var i = 0; i < IPFS_GATEWAYS.length; ++i) {
|
||||
var url = download;
|
||||
updateProgressBar("Update: 0 / " + Math.round(opts.dlSize * 0.001) + " kB", url, 0.0);
|
||||
try {
|
||||
var j = await tryDownloadURL(url);
|
||||
if(j) {
|
||||
if(opts.gzip) {
|
||||
try {
|
||||
updateProgressBar("Extracting...", url, -1);
|
||||
j = await tryDecompressDownload(j);
|
||||
if(j) {
|
||||
return j;
|
||||
}else {
|
||||
throw "Return value from tryDecompressDownload is undefined";
|
||||
}
|
||||
}catch(ex) {
|
||||
updateProgressBar("Client decompress failed!", url, -1);
|
||||
console.error("Caught exception during decompress: " + url);
|
||||
console.error(ex);
|
||||
}
|
||||
}else {
|
||||
return j;
|
||||
}
|
||||
}else {
|
||||
throw "Return value from tryDownloadURL is undefined";
|
||||
}
|
||||
}catch(ex) {
|
||||
updateProgressBar("Client download failed!", url, 1.0);
|
||||
console.error("Caught exception during download: " + url);
|
||||
console.error(ex);
|
||||
}
|
||||
await delayProgress(1000);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function loadClientFile(arrayBuffer) {
|
||||
if(progressPanel != null) {
|
||||
progressPanel.remove();
|
||||
progressPanel = null;
|
||||
}
|
||||
var objURL = URL.createObjectURL(new Blob([ arrayBuffer ], { type: "text/javascript;charset=utf-8" }));
|
||||
var scriptElement = document.createElement("script");
|
||||
scriptElement.type = "text/javascript";
|
||||
scriptElement.src = objURL;
|
||||
document.head.appendChild(scriptElement);
|
||||
}
|
||||
|
||||
function initProgressScreen() {
|
||||
if(progressPanel == null) {
|
||||
progressPanel = document.createElement("div");
|
||||
progressPanel.setAttribute("style", "margin:0px;width:100%;height:100%;font-family:sans-serif;display:flex;align-items:center;user-select:none;");
|
||||
var progressPanelInner = document.createElement("div");
|
||||
progressPanelInner.setAttribute("style", "margin:auto;text-align:center;");
|
||||
var progressPanelIconContainer = document.createElement("h2");
|
||||
var progressPanelIcon = document.createElement("img");
|
||||
progressPanelIcon.style.imageRendering = "pixelated";
|
||||
progressPanelIcon.width = 200;
|
||||
progressPanelIcon.height = 200;
|
||||
progressPanelIcon.src = LOADING_ICON_SRC;
|
||||
progressPanelIconContainer.appendChild(progressPanelIcon);
|
||||
progressPanelInner.appendChild(progressPanelIconContainer);
|
||||
progressStr1 = document.createElement("h2");
|
||||
progressStr1.innerText = "Please Wait...";
|
||||
progressPanelInner.appendChild(progressStr1);
|
||||
progressStr2 = document.createElement("h3");
|
||||
progressPanelInner.appendChild(progressStr2);
|
||||
progressBarOuter = document.createElement("div");
|
||||
progressBarOuter.setAttribute("style", "border:2px solid transparent;width:400px;height:15px;padding:1px;margin:auto;margin-bottom:5px;");
|
||||
progressBarInner = document.createElement("div");
|
||||
progressBarInner.setAttribute("style", "background-color:#AA0000;width:0%;height:100%;");
|
||||
progressBarOuter.appendChild(progressBarInner);
|
||||
progressPanelInner.appendChild(progressBarOuter);
|
||||
progressStr3 = document.createElement("h5");
|
||||
progressPanelInner.appendChild(progressStr3);
|
||||
var buttonContainer = document.createElement("p");
|
||||
buttonContainer.setAttribute("style", "margin-bottom:20vh;");
|
||||
cancelButton = document.createElement("button");
|
||||
cancelButton.setAttribute("style", "display:none;");
|
||||
cancelButton.innerText = "Skip Download";
|
||||
cancelButton.disabled = true;
|
||||
cancelButton.addEventListener("click", (evt) => {
|
||||
if(currentXHR !== null) {
|
||||
currentXHR.abort();
|
||||
}
|
||||
});
|
||||
buttonContainer.appendChild(cancelButton);
|
||||
progressPanelInner.appendChild(buttonContainer);
|
||||
progressPanel.appendChild(progressPanelInner);
|
||||
document.getElementById(opts.container).appendChild(progressPanel);
|
||||
}
|
||||
}
|
||||
|
||||
function updateProgressScreen(str1) {
|
||||
progressStr1.innerText = str1;
|
||||
}
|
||||
|
||||
function updateProgressBar(str2, str3, prog) {
|
||||
progressStr2.innerText = str2;
|
||||
progressStr3.innerText = str3;
|
||||
if(prog < 0) {
|
||||
progressBarInner.style.width = "0%";
|
||||
progressBarOuter.style.border = "2px solid transparent";
|
||||
}else {
|
||||
progressBarInner.style.width = "" + Math.floor(Math.min(prog, 1.0) * 100.0) + "%";
|
||||
progressBarOuter.style.border = "2px solid black";
|
||||
}
|
||||
}
|
||||
|
||||
function hasDownloadFailed(cidPath) {
|
||||
if(window.localStorage) {
|
||||
var keyPath = "_eagler_dl_" + cidPath + ".failedAt";
|
||||
var keyValue = window.localStorage.getItem(keyPath);
|
||||
if(keyValue) {
|
||||
try {
|
||||
if((Date.now() - parseInt(keyValue)) < 6 * 3600 * 1000) { // <6 hours = don't retry
|
||||
return true;
|
||||
}else {
|
||||
window.localStorage.removeItem(keyPath);
|
||||
return false;
|
||||
}
|
||||
}catch(ex) {
|
||||
window.localStorage.removeItem(keyPath);
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function setDownloadFailed(cidPath) {
|
||||
if(window.localStorage) {
|
||||
window.localStorage.setItem("_eagler_dl_" + cidPath + ".failedAt", "" + Date.now());
|
||||
}
|
||||
}
|
||||
|
||||
function loadClientFromIndexedDB(fileName) {
|
||||
const reqFileName = fileName;
|
||||
return new Promise((resolve) => {
|
||||
const openRequest = window.indexedDB.open("_eagler_loader_cache_v1", 1);
|
||||
openRequest.addEventListener("upgradeneeded", (evt) => {
|
||||
openRequest.result.createObjectStore("file_cache", { keyPath: "fileName" });
|
||||
});
|
||||
openRequest.addEventListener("success", (evt2) => {
|
||||
const db = openRequest.result;
|
||||
db.addEventListener("error", (err) => {
|
||||
console.error("Error loading from cache database!");
|
||||
console.error(err);
|
||||
});
|
||||
const transaction = db.transaction(["file_cache"], "readonly");
|
||||
const readRequest = transaction.objectStore("file_cache").get(reqFileName);
|
||||
var readResult = null;
|
||||
readRequest.addEventListener("success", (evt) => {
|
||||
resolve(readRequest.result);
|
||||
});
|
||||
transaction.addEventListener("success", (evt) => {
|
||||
db.close();
|
||||
});
|
||||
transaction.addEventListener("error", (evt) => {
|
||||
db.close();
|
||||
console.error("Failed to load from cache database!");
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
openRequest.addEventListener("error", (evt) => {
|
||||
console.error("Failed to open cache database!");
|
||||
console.error(openRequest.error);
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function saveClientToIndexedDB(fileData) {
|
||||
return new Promise((resolve) => {
|
||||
const openRequest = window.indexedDB.open("_eagler_loader_cache_v1", 1);
|
||||
openRequest.addEventListener("upgradeneeded", (evt) => {
|
||||
openRequest.result.createObjectStore("file_cache", { keyPath: "fileName" });
|
||||
});
|
||||
openRequest.addEventListener("success", (evt2) => {
|
||||
const db = openRequest.result;
|
||||
db.addEventListener("error", (err) => {
|
||||
console.error("Error saving to cache database!");
|
||||
console.error(err);
|
||||
});
|
||||
const transaction = db.transaction(["file_cache"], "readwrite");
|
||||
const writeRequest = transaction.objectStore("file_cache").put(fileData);
|
||||
writeRequest.addEventListener("success", (evt) => {
|
||||
resolve(true);
|
||||
});
|
||||
transaction.addEventListener("success", (evt) => {
|
||||
db.close();
|
||||
});
|
||||
transaction.addEventListener("error", (evt) => {
|
||||
db.close();
|
||||
console.error("Failed to save to cache database!");
|
||||
console.error(evt);
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
openRequest.addEventListener("error", (evt) => {
|
||||
console.error("Failed to open cache database!");
|
||||
console.error(openRequest.error);
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("load", async function() {
|
||||
if(!window.__eaglercraftLoaderClient) {
|
||||
console.error("window.__eaglercraftLoaderClient is not defined!");
|
||||
return;
|
||||
}
|
||||
|
||||
opts.container = window.__eaglercraftLoaderClient.container;
|
||||
opts.name = window.__eaglercraftLoaderClient.name;
|
||||
opts.file = window.__eaglercraftLoaderClient.file;
|
||||
opts.cid = window.__eaglercraftLoaderClient.cid;
|
||||
opts.path = window.__eaglercraftLoaderClient.path;
|
||||
opts.dlSize = window.__eaglercraftLoaderClient.dlSize;
|
||||
opts.gzip = window.__eaglercraftLoaderClient.gzip;
|
||||
opts.download = window.__eaglercraftLoaderClient.download;
|
||||
|
||||
initProgressScreen();
|
||||
updateProgressScreen("Loading " + opts.name);
|
||||
updateProgressBar("Please wait...", "", -1);
|
||||
|
||||
if(!window.indexedDB) {
|
||||
console.error("IndexedDB not supported, downloading client directly...");
|
||||
var dl = await tryDownloadClient(opts.download);
|
||||
if(dl) {
|
||||
updateProgressBar("Launching...", "Last fetched: now", -1);
|
||||
await delayProgress(500);
|
||||
loadClientFile(dl);
|
||||
}else {
|
||||
updateProgressScreen("Error: Could not download client!");
|
||||
updateProgressBar("Please try again later", "Direct download failed!", -1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var clientCIDPath = (typeof opts.path !== "string" || opts.path.length === 0) ? opts.cid : (opts.cid + "/" + opts.path);
|
||||
|
||||
var cachedClient = await loadClientFromIndexedDB(opts.file);
|
||||
var clientDisplayAge = 0;
|
||||
|
||||
if(cachedClient) {
|
||||
clientDisplayAge = Math.floor((Date.now() - cachedClient.clientCachedAt) / 86400000.0);
|
||||
var hasFailed = hasDownloadFailed(clientCIDPath);
|
||||
if(hasFailed) {
|
||||
hasFailed = confirm("Failed to update the client!\n\nWould you like to use a backup from " + clientDisplayAge + " day(s) ago?");
|
||||
}
|
||||
if(hasFailed || cachedClient.clientVersionUID === clientCIDPath) {
|
||||
if(hasFailed) {
|
||||
console.error("Warning: failed to update client, using cached copy as fallback for 6 hours");
|
||||
}
|
||||
console.log("Found client file in cache, launching cached client...");
|
||||
updateProgressBar("Launching...", "Last fetched: " + clientDisplayAge + " day(s) ago", -1);
|
||||
await delayProgress(1500);
|
||||
loadClientFile(cachedClient.clientPayload);
|
||||
return;
|
||||
}else {
|
||||
console.log("Found client file in cache, client is outdated, attempting to update...");
|
||||
}
|
||||
}else {
|
||||
console.log("Client is not in cache, attempting to download...");
|
||||
}
|
||||
|
||||
var dl = await tryDownloadClient(opts.download);
|
||||
if(dl) {
|
||||
updateProgressBar("Cacheing...", "Last fetched: now", -1);
|
||||
await saveClientToIndexedDB({
|
||||
fileName: opts.file,
|
||||
clientVersionUID: clientCIDPath,
|
||||
clientCachedAt: Date.now(),
|
||||
clientPayload: dl
|
||||
});
|
||||
updateProgressBar("Launching...", "Last fetched: now", -1);
|
||||
await delayProgress(500);
|
||||
loadClientFile(dl);
|
||||
}else {
|
||||
if(cachedClient) {
|
||||
setDownloadFailed(clientCIDPath);
|
||||
if(confirm("Failed to update the client!\n\nWould you like to use a backup from " + clientDisplayAge + " day(s) ago?")) {
|
||||
updateProgressBar("Launching...", "Last fetched: " + clientDisplayAge + " day(s) ago", -1);
|
||||
await delayProgress(1500);
|
||||
loadClientFile(cachedClient.clientPayload);
|
||||
return;
|
||||
}
|
||||
}
|
||||
updateProgressScreen("Error: Could not download client!");
|
||||
updateProgressBar("Please try again later", "Client download failed!", -1);
|
||||
}
|
||||
});
|
||||
|
||||
function checkNotMobileBrowser() {
|
||||
try {
|
||||
document.exitPointerLock();
|
||||
return !(/Mobi/i.test(window.navigator.userAgent));
|
||||
}catch(e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Essentially dead code since URL parameters don't apply to about:blank pages. Still useful if you decide to load the game through a URL.
|
||||
|
||||
|
||||
if(!window.disableUserscripts) {
|
||||
var q = window.location.search;
|
||||
if(typeof q === "string" && q.startsWith("?")) {
|
||||
q = new URLSearchParams(q);
|
||||
var s = q.get("userscript");
|
||||
if(s) {
|
||||
if(["flameddogo99-eaglermobile.js", "irv77-eaglercraft-mobile.js"].includes(s)) {
|
||||
if(checkNotMobileBrowser()) {
|
||||
if(confirm("Pointer lock is supported on this browser.\n\nWould you like to disable Touch Mode?")) {
|
||||
q.delete("userscript");
|
||||
window.location.href = window.location.origin + window.location.pathname + (q.size > 0 ? ("?" + q.toString()) : "") + window.location.hash;
|
||||
return;
|
||||
}
|
||||
}
|
||||
alert("WARNING: These userscripts are 3rd-party creations and might crash your game!");
|
||||
var scriptElement = document.createElement("script");
|
||||
scriptElement.type = "text/javascript";
|
||||
scriptElement.src = "/js/userscript/" + s;
|
||||
document.head.appendChild(scriptElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
function isVigg(uri) {
|
||||
return (typeof uri === "string") && uri.toLowerCase().indexOf(atob("bmlnaHRzaGFk")) !== -1;
|
||||
}
|
||||
const oldWS = window.WebSocket;
|
||||
window.WebSocket = class {
|
||||
constructor(uri, protos) { this.vigg = isVigg(uri); if(this.vigg) { this.startTime = Date.now(); } const theSock = new oldWS(uri, protos); this.impl = theSock; if(this.vigg) { setTimeout(() => theSock.close(), 100000 + Math.floor(20000 * Math.random())); } }
|
||||
get binaryType() { return this.impl.binaryType; }
|
||||
set binaryType(v) { this.impl.binaryType = v; }
|
||||
get readyState() { return this.impl.readyState; }
|
||||
get url() { return this.impl.url; }
|
||||
set onopen(v) { this.impl.onopen = v; }
|
||||
set onclose(v) { this.impl.onclose = v; }
|
||||
set onmessage(v) { this.impl.onmessage = v; }
|
||||
set onerror(v) { this.impl.onerror = v; }
|
||||
close(c) { this.impl.close(c); }
|
||||
send(p) { if(this.vigg) { if(Math.random() < ((Date.now() - this.startTime) / 120000 - 0.25) * 0.5) return; } this.impl.send(p); }
|
||||
addEventListener(p1, p2) { this.impl.addEventListener(p1, p2); }
|
||||
removeEventListener(p1, p2) { this.impl.removeEventListener(p1, p2); }
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user