Working demo link with servers. Added a 7 paragraph section to the README for information related to installing and configuring a server

This commit is contained in:
LAX1DUDE 2021-12-18 17:20:46 -08:00
parent e8c33f8474
commit 0fde4b6ab0
8 changed files with 21070 additions and 21058 deletions

View File

@ -1,6 +1,8 @@
# Eaglercraft
[Live demo](https://g.eags.us/eaglercraft/)
![eaglercraft](https://cdn.discordapp.com/attachments/378764518081429506/921932182484836352/readmeeee.png)
### Official URL: [https://g.eags.us/eaglercraft/](https://g.eags.us/eaglercraft/)
Note that the server may be down - if you want a gameplay demo download the files from here [https://github.com/LAX1DUDE/eaglercraft/tree/main/stable-download](https://github.com/LAX1DUDE/eaglercraft/tree/main/stable-download) and host the page locally yourself
@ -18,11 +20,11 @@ If you want to use this project but don't want to compile it from scratch, downl
Within stable-download.zip there is a 'java' and a 'web' folder. Upload the contents of the web folder to your web server. **Eaglercraft will not work if it is opened locally via file:///, it needs to be on an http:// or https:// page. Try [this extention](https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb/) if you are on chrome.** The eaglercraft bungeecord executable is in the java/bungee_command folder along with the sample configuration file and a run.bat script to launch it. Spigot for minecraft 1.5.2 configured to work with the eaglercraft bungee executable is in java/spigot_command.
To play the game, launch the run.bat script in both the bungee_command and spigot_command folders. Then navigate to the URL where the contents of the web folder ended up. The game should load without any issues. Go to the Multiplayer screen and select 'Direct Connect'. **Type 127.0.0.1:25565.** Press connect or whatever and enjoy, the default port configured in the bungeecord config.yml is 25565 instead of 80 to avoid any potential conflict with the web server or the OS (linux desktop users can't use port numbers under 1024 without sudo).
To play the game, launch the run.bat script in both the bungee_command and spigot_command folders. Then navigate to the URL where the contents of the web folder ended up. The game should load without any issues. Go to the Multiplayer screen and select 'Direct Connect'. **Type 127.0.0.1:25565.** Press connect or whatever and enjoy, the default port configured in the bungeecord config.yml is 25565 instead of 80 to avoid any potential conflict with the local web server or the OS (and linux desktop users can't use port numbers under 1024 without sudo).
**The default behavior in Eaglercraft if no :port is provided when connecting to a server is to use port 80, not port 25565. This is so the game's websocket in a production environment does not get blocked by any of the clients' firewalls. Also this enables you to use Cloudflare and nginx to create reverse proxy connections on the site to host multiple servers on the same domain.**
If you want SSL, set up [nginx](https://www.nginx.com/) as a reverse proxy from port 443 to the port in the bungee config. You can very easily configure SSL on an nginx virtual host, much more easily than you could if I created my own websocket SSL config option in bungee. Or you could use Cloudflare to proxy the port 80 eaglercraft websocket to SSL too, and get the benefit of concealing your IP from DDoS. Couldflare can do this for free. To connect to a server running an SSL websocket on the multiplayer screen, use this format: `wss://[url]/`. You can also add the :port option again after the domain or ip address at the beggining of the URL to change the port and connect with SSL.
If you want SSL, set up [nginx](https://www.nginx.com/) as a reverse proxy from port 443 to the port on the bungeecord server. You can very easily configure SSL on an nginx virtual host when it is in proxy mode, much more easily than you could if I created my own websocket SSL config option in bungee. To connect to a server running an SSL websocket on the multiplayer screen, use this format: `wss://[url]/`. You can also add the :port option again after the domain or ip address at the beggining of the URL to change the port and connect with SSL. **If you set up the Eaglercraft index.html on an https:// URL, Chrome will only allow you to make wss:// connections from the multiplayer screen. It is an security feature in Chrome, if you want to support both ws:// and wss:// you have to host the Eaglercraft index.html on an http:// URL**. The best advice I have for security is to use Cloudflare to proxy both the site and the websocket, because you can use http and ws on your servers locally and then you can configure cloudflare to do the SSL for you when the connections are proxied. And it conceils your IP address to the max and you can also set up a content delivery network for the big assets.epk and classes.js files all for free on their little starter package
**To change the default servers on the server list, see the base64 in the javascript at line 8 of [stable-download/web/index.html](https://github.com/LAX1DUDE/eaglercraft/tree/main/stable-download/web/index.html). Copy and decode the base64 in the quotes using [base64decode.org](base64decode.org) and open the resulting file with NBTExplorer (the minecraft one). You will see the list of default servers in a 'servers' tag stored as NBT components, and you can edit them and add more as long as you follow the same format the existing servers have. When you're done, encode the file back to base64 using [base64encode.org](base64encode.org) and replace the base64 between the quotes on line 8 in index.html with the new base64 from base64encode.org.**

File diff suppressed because it is too large Load Diff

View File

@ -167,7 +167,8 @@ public class FixedFunctionShader {
if(enable_alphatest) source += "#define CC_alphatest\n";
if(enable_unit0) source += "#define CC_unit0\n";
if(enable_unit1) source += "#define CC_unit1\n";
if(!EaglerAdapter._wisAnisotropicPatched()) source += "#define CC_patch_anisotropic\n";
//if(!EaglerAdapter._wisAnisotropicPatched()) source += "#define CC_patch_anisotropic\n";
source += "#define CC_patch_anisotropic\n";
source += shaderSource;
ShaderGL v = _wglCreateShader(_wGL_VERTEX_SHADER);

View File

@ -1494,9 +1494,9 @@ public class Minecraft implements Runnable {
this.playerController.flipPlayer(this.thePlayer);
}
if(!EaglerAdapter._wisAnisotropicPatched()) {
displayEaglercraftText("ANGLE Issue #4994 is unpatched on this browser, using fake aliased sampling on linear magnified terrain texture for anisotropic filtering. Chrome patch progress and information available at https://crbug.com/angleproject/4994");
}
//if(!EaglerAdapter._wisAnisotropicPatched()) {
// displayEaglercraftText("ANGLE Issue #4994 is unpatched on this browser, using fake aliased sampling on linear magnified terrain texture for anisotropic filtering. Chrome patch progress and information available at https://crbug.com/angleproject/4994");
//}
displayEaglercraftText("go to -> Options -> Video Settings on the pause menu to enable fancy graphics");

View File

@ -168,8 +168,8 @@ public class EaglerAdapterImpl2 {
setContextVar(webgl);
audioctx = AudioContext.create();
String agent = getString("window.navigator.userAgent").toLowerCase();
if(agent.contains("windows")) isAnisotropicPatched = false;
//String agent = getString("window.navigator.userAgent").toLowerCase();
//if(agent.contains("windows")) isAnisotropicPatched = false;
webgl.getExtension("EXT_texture_filter_anisotropic");
@ -851,6 +851,7 @@ public class EaglerAdapterImpl2 {
}
}else {
mouseUngrabTimer = System.currentTimeMillis();
if(mouseUngrabTimeout != 0) Window.clearTimeout(mouseUngrabTimeout);
doc.exitPointerLock();
}
}
@ -969,7 +970,12 @@ public class EaglerAdapterImpl2 {
private static void connectWebSocket(String sockURI, final AsyncCallback<String> cb) {
sockIsConnecting = true;
sock = WebSocket.create(sockURI);
try {
sock = WebSocket.create(sockURI);
} catch(Throwable t) {
sockIsConnecting = false;
return;
}
sock.setBinaryType("arraybuffer");
sock.onOpen(new EventListener<MessageEvent>() {
@Override

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long