From e1e6b2c48c2c76a2ebaf539793ef16f9e2bfc869 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:58:09 +0800 Subject: [PATCH 01/10] starting of stuff beginning and table of contents --- README.md | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 0dcc692..5df735e 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,40 @@ # Eaglercraft +![eaglercraft](https://g.deev.is/eaglercraft/cover.png) +:-: +Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser. That includes school chromebooks, it works on all chromebooks. It supports both singleplayer and multiplayer. + **Currently maintained by [ayunami2000](https://github.com/ayunami2000)** -### Client: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/) +**For any questions you can join the discord server and hit us up there [https://discord.gg/Ekzcgs3DKZ](https://discord.gg/Ekzcgs3DKZ)** -### Offline Download: [Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html) +# Quick Start -### Note: we will be transitioning away from Eaglercraft being standalone 'free browser minecraft' to Eaglercraft being a bukkit/bungee plugin for servers to allow 'online access' to players who register with a command as their real online-mode Minecraft account on the server. Server owners can still elect to set `online-mode=false` in their server.properties to allow free login but now that's their legal screw up instead of mine +### Client: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/) [^1] -![eaglercraft](https://g.deev.is/eaglercraft/cover.png) +### Offline Client Download: [Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html) -### Official Demo URL: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/) - -### Download Locally: [stable-download/Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html) - -(right click the link and press 'Save link as...' to download the file) +(right click the link and press 'Save link as...' to download the file!) ### Play Minecraft Beta Singleplayer: [https://g.deev.is/eaglercraft/beta/](https://g.deev.is/eaglercraft/beta/) -**For any questions you can join the discord server and hit us up there [https://discord.gg/Ekzcgs3DKZ](https://discord.gg/Ekzcgs3DKZ)** +[^1]: A list of public servers are already added into the official client -## What is Eaglercraft? +# Table Of Contents: -Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser. That includes school chromebooks, it works on all chromebooks. It supports both singleplayer and multiplayer. +| [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | +|---------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------| +| [Importing / Exporting Worlds](#Importing / Exporting Worlds) | [Public clients / servers](#Public clients / servers) | [Plugin Development](#Plugin Development) | +| [LAN Worlds](#LAN Worlds) | [Creating a Client](#Creating a Client) | [Compiling](#Compiling) | +| [Public LAN Relays](#Public LAN Relays) | [Creating a Server - Bukkit](#Creating a server - Bukkit) | [Create a resource pack](#Create a resource pack) | +| [Creating a LAN relay](#Creating a LAN relay) | [Creating a Server - Bungeecord](#Creating a server - Bungeecord) | [Contributing](#Contributing) | +| | [Bungeecord Configuration](#Bungeecord Configuration) | | -## Singleplayer? +## Singleplayer -### Eaglercraft now fully supports singleplayer - -### Simply press the 'Singleplayer' button on the main menu and you can create a regular vanilla minecraft and play it any time. +Simply press the 'Singleplayer' button on the main menu and you can create a regular vanilla minecraft and play it any time. +### Importing / Exporting worlds The worlds are stored in your browser's local storage, **you can export them as EPK files and import them again on all other Eaglercraft sites that also support singleplayer.** You can even copy an exported world to an entirely different computer, or send it to a friend, and import it and continue playing with all your progress saved. **Link: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/)** From 60dd80b891a4fa54d28ede9085ae5a93fdc653b7 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:01:08 +0800 Subject: [PATCH 02/10] Update README.md added dashes --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5df735e..bd9a21c 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser | [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | |---------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------| -| [Importing / Exporting Worlds](#Importing / Exporting Worlds) | [Public clients / servers](#Public clients / servers) | [Plugin Development](#Plugin Development) | -| [LAN Worlds](#LAN Worlds) | [Creating a Client](#Creating a Client) | [Compiling](#Compiling) | -| [Public LAN Relays](#Public LAN Relays) | [Creating a Server - Bukkit](#Creating a server - Bukkit) | [Create a resource pack](#Create a resource pack) | -| [Creating a LAN relay](#Creating a LAN relay) | [Creating a Server - Bungeecord](#Creating a server - Bungeecord) | [Contributing](#Contributing) | -| | [Bungeecord Configuration](#Bungeecord Configuration) | | +| [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | +| [LAN Worlds](#LAN-Worlds) | [Creating a Client](#Creating-a-Client) | [Compiling](#Compiling) | +| [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Create a resource pack](#Create-a-resource-pack) | +| [Creating a LAN relay](#Creating-a-LAN-relay) | [Creating a Server - Bungeecord](#Creating-a-server---Bungeecord) | [Contributing](#Contributing) | +| | [Bungeecord Configuration](#Bungeecord-Configuration) | | ## Singleplayer From 350158cec639f16c4b8be74969b631550e221293 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:37:48 +0800 Subject: [PATCH 03/10] Update README.md update table on contents, redesigned setting up server, including bungee, bukkit and client. also did others, including creating resource pack. also added self promotion ezzzzzzzzzzzz clout --- README.md | 152 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 89 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index bd9a21c..50219e0 100644 --- a/README.md +++ b/README.md @@ -22,24 +22,24 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser # Table Of Contents: -| [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | -|---------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------| -| [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | -| [LAN Worlds](#LAN-Worlds) | [Creating a Client](#Creating-a-Client) | [Compiling](#Compiling) | -| [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Create a resource pack](#Create-a-resource-pack) | -| [Creating a LAN relay](#Creating-a-LAN-relay) | [Creating a Server - Bungeecord](#Creating-a-server---Bungeecord) | [Contributing](#Contributing) | -| | [Bungeecord Configuration](#Bungeecord-Configuration) | | +| [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | +|-----------------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------| +| [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | +| [LAN Worlds](#LAN-Worlds) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Compiling](#Compiling) | +| [Public LAN Relays](#Here-are-some-public-relay-servers-you-can-use:) | [Creating a Server - Bungeecord](#Creating-a-server---Bungeecord) | [Creating a resource pack](#Creating-a-resource-pack) | +| [Creating a LAN relay](#Creating-a-LAN-relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | +| | [Bungeecord Configuration](#Bungeecord-Configuration) | | -## Singleplayer +# Singleplayer Simply press the 'Singleplayer' button on the main menu and you can create a regular vanilla minecraft and play it any time. -### Importing / Exporting worlds +### Importing / Exporting Worlds The worlds are stored in your browser's local storage, **you can export them as EPK files and import them again on all other Eaglercraft sites that also support singleplayer.** You can even copy an exported world to an entirely different computer, or send it to a friend, and import it and continue playing with all your progress saved. **Link: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/)** -## LAN Worlds? +## LAN Worlds ### Eaglercraft fully supports LAN worlds, you can share your world with any player and they can connect directly to it as if you are running a server in your browser. @@ -47,9 +47,9 @@ The worlds are stored in your browser's local storage, **you can export them as To open your world to LAN, go to the pause menu and click 'Open to LAN'. You can configure the gamemode and cheats and if you would like to hide your LAN world. **When you do not hide your LAN world, it will appear on the Multiplayer screen from the main menu to anybody else also on your Wi-Fi network.** Set the world hidden if you are at school or something and don't want everyone else in your class to join as well and start griefing. -### When you open the world to LAN it will give you a 'join code'. Simply share the code with your friends and they can visit the Multiplayer screen from the main menu and click 'Direct Connect' and enter the code and they will be able to join your world. +When you open the world to LAN it will give you a 'join code'. Simply share the code with your friends and they can visit the Multiplayer screen from the main menu and click 'Direct Connect' and enter the code and they will be able to join your world. -### Make sure they add the relay server your game opens the LAN world on to their "Network Settings" menu accessable from the Multiplayer screen. You simply must send them the URL indicated in the pause menu once the world is opened and they can use the "Add Relay" option to add the URL to their list. +Make sure they add the relay server your game opens the LAN world on to their "Network Settings" menu accessable from the Multiplayer screen. You simply must send them the URL indicated in the pause menu once the world is opened and they can use the "Add Relay" option to add the URL to their list. ### THIS IS A REQUIRED STEP FOR A PERSON TO JOIN YOUR WORLD, IF THEY DO NOT HAVE THE RELAY YOUR WORLD IS HOSTED ON ADDED TO THEIR "Network Settings" THE GAME WILL BE UNABLE TO LOCATE THE WORLD @@ -59,60 +59,88 @@ To open your world to LAN, go to the pause menu and click 'Open to LAN'. You can - `wss://relay.lax1dude.net/` - `wss://relay.shhnowisnottheti.me/` -## Issues? +## Hosting a LAN server relay -I got tired of closing duplicate 'how to maek sever' issues almost every day so I disabled it because honestly I don't really care anymore, [join discord](https://discord.gg/Ekzcgs3DKZ) if you've got an issue to report that you are confident can be backed up with source code +### Simply download [stable-download/sp-relay.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/sp-relay.jar) and run `java -jar sp-relay.jar` -## How to make a server +**Run `java -jar sp-relay.jar --debug` to view debug info like all the IPs of incoming connections, as it is not shown by default because logging all that info will reduce performance when the relay is being pinged many times a second depending on it's popularity.** -### If replit is acceptable, you can use this: +Edit the `relayConfig.ini` file generated on first launch to change the port and configure ratelimiting and such, and `relays.txt` to change the list of STUN and TURN relays reported to clients connecting to the relay, which are required to correctly establish a P2P LAN world connection in browsers -### [https://replit.com/@ayunami2000/eaglercraft-server](https://replit.com/@ayunami2000/eaglercraft-server) +**The `origin-whitelist` config variable is a semicolon (`;`) seperated list of domains used to restrict what sites are to be allowed to use your relay. When left blank it allows all sites. Add `offline` to allow offline download clients to use your relay as well, and `null` to allow connections that do not specify an `Origin:` header. Use `*` as a wildcard, for example: `*.deev.is` allows all domains ending with "deev.is" to use the relay.** + +# Multiplayer + +There are multiple community hosted servers, the best way to discover those is to use the [official client](https://g.deev.is/eaglercraft/) + +Alternatively, there is a server list[^2] to find servers. + +[^2]: Server list is currently being rebuilt, use official client for now + +# Creating your own server + +There are multiple parts to a server, mainly consisting of bungeecord, a proxy which will translate websockets to raw TCP connection, which minecraft can understand. + +You may also want to set up your own client, allowing you to control default server listings, resource packs, and a faster connection. + +### If replit is acceptable, you can use [this](https://replit.com/@ayunami2000/eaglercraft-server) to automatically set up everything for a server, otherwise, look below for instructions + +## Creating a server - Bukkit 1. **Check if Java is installed.** You can download it from [https://www.java.com/en/download/](https://www.java.com/en/download/) 2. Download the [stable-download/stable-download.zip](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/stable-download.zip) file from this repository 4. Extract the ZIP file you downloaded to a new folder -5. Open the new folder, go into the `java/bungee_command` folder +5. Open the new folder, go into the `java/bukkit_command` folder 6. In Windows, double-click `run.bat`. It should open a new terminal window ![run.bat](https://i.gyazo.com/2b0f6b3e5b2e5a5a102c62ea5b6fba3f.png) **Some computers may just say 'run' instead of 'run.bat', both are correct** -7. On macOS or Linux, google how to open the terminal and use the `cd` command to navigate to `java/bungee_command` +7. On macOS or Linux, google how to open the terminal and use the `cd` command to navigate to `java/bukkit_command` Then, in that folder, run `chmod +x run_unix.sh` and then run `./run_unix.sh`. It should start the same server -8. Go to the other `java/bukkit_command` folder that was also extracted from the ZIP -9. Again, on Windows, double-click `run.bat` in the folder. It should open a second terminal window. -Keep both the first and second terminal window you opened, just minimize them don't close -10. Again, on macOS or Linux, repeat step 7 except in the `java/bukkit_command` folder -11. **Your server is now ready.** Download and open [stable-download/Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html) -12. Go to 'Multiplayer' from the main menu. Select 'Direct Connect', type `127.0.0.1:25565` and press 'Join Server' -13. **It should allow you to connect, if not, check the two terminal windows for errors** -14. If you are okay with regularly checking for updates to [Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html), you are now finished -15. If you are playing with friends and want a shared website that can be updated, see the `stable-download/web` folder -16. To install, create a website and upload the contents of `stable-download/web` to the URL you want to have Eaglercraft on -17. **The 'web' folder will not work if you open it in your browser locally! If you see 'file:///' in the URL you are doing it wrong. You need to upload the folder to an HTTP or HTTPS server and access it over the internet via http:// or https://. The game will not load otherwise, this is not a bug** -18. To modify the list of default servers, modify the `window.eaglercraftOpts` variable in `index.html`. -19. **A full guide on how to configure `eaglercraftOpts` is coming soon, but it should be fairly intuitive to figure out how to set it up based on what the default values already are when you look in stable-download** -20. **To create a link to your site that automatically joins the server,** add a `?server=` variable to the URL, like (for example): [https://g.deev.is/eaglercraft/?server=127.0.0.1:25565](https://g.deev.is/eaglercraft/?server=127.0.0.1:25565) will automatically join `ws://127.0.0.1:25565/` as soon as the player finishes setting their username and skin -21. To change your server's MOTD and icon, edit the `motd1:` tag of the listener config in `java/bungee_command/config.yml`, and replace `server-icon.png` in the folder where the config file is. Use `&` to add color/formatting codes. The server list will downscale your icon to 64x64 pixels -22. You can give your MOTD multiple lines, add a `motd2:` to define a second line -23. **For an animated MOTD and icon, install EaglerMOTD: [https://github.com/lax1dude/eaglercraft-motd/](https://github.com/lax1dude/eaglercraft-motd/)** -24. To add some bukkit plugins, download the plugin's JAR file for CraftBukkit 1.5.2 and place it in `java/bukkit_command/plugins` -25. To add some bungee plugins, download the plugin's JAR file and place it in `java/bungee_command/plugins` -26. See [https://github.com/lax1dude/eaglercraft-plugins/](https://github.com/lax1dude/eaglercraft-plugins/) to download some supported plugins -27. **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** -28. To add `/login` and `/register`, install [AuthMe](https://github.com/lax1dude/eaglercraft-plugins/tree/main/AuthMe) and carefully [read it's documentation](https://github.com/AuthMe/AuthMeReloaded/wiki) to set it up correctly -29. **To ban a username on Eaglercraftbungee, use:** `eag-ban ` -30. **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically -31. To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8` -32. To ban users by wildcard (\*) use: `eag-ban-wildcard *` or `eag-ban-wildcard *` or `eag-ban-wildcard **` -33. **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved** -34. To ban users by regular expression, use: `eag-ban-regex ` with a regular expression to match the username in **lowercase** -35. **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase** +8. To add some bukkit plugins, download the plugin's JAR file for CraftBukkit 1.5.2 and place it in `java/bukkit_command/plugins` +(See [https://github.com/lax1dude/eaglercraft-plugins/](https://github.com/lax1dude/eaglercraft-plugins/) to download some supported plugins) + +## Creating a server - Bungeecord +1. In the same new folder, go into the `java/bungee_command` folder +2. In Windows, double-click `run.bat`. It should open a second terminal window +Keep both the first and second terminal window you opened, just minimize them, don't close +3. On macOS or Linux, repeat step 7 in [Creating a Server - Bukkit](#Creating-a-server---Bukkit), but navigate to `java/bungee_command` this time +4. To add some bungee plugins, download the plugin's JAR file and place it in `java/bungee_command/plugins` + +There are alot more configurations in bungeecord, but this should set you up + +**Your server is now ready.** Visit any client, and go to 'Multiplayer' from the main menu. Select 'Direct Connect', type `127.0.0.1:25565` and press 'Join Server' +**It should allow you to connect, if not, check the two terminal windows for errors** + +## Creating a client +1. To install, create a website and upload the contents of `stable-download/web` to the URL you want to have Eaglercraft on +2. **The 'web' folder will not work if you open it in your browser locally! If you see 'file:///' in the URL you are doing it wrong. You need to upload the folder to an HTTP or HTTPS server and access it over the internet via http:// or https://. The game will not load otherwise, this is not a bug** +3. To modify the list of default servers, modify the `window.eaglercraftOpts` variable in `index.html`. +4. **A full guide on how to configure `eaglercraftOpts` is coming soon, but it should be fairly intuitive to figure out how to set it up based on what the default values already are when you look in stable-download** +5. **To create a link to your site that automatically joins the server,** add a `?server=` variable to the URL, like (for example): [https://g.deev.is/eaglercraft/?server=127.0.0.1:25565](https://g.deev.is/eaglercraft/?server=127.0.0.1:25565) will automatically join `ws://127.0.0.1:25565/` as soon as the player finishes setting their username and skin + +# Bungeecord Configuration + +## MOTD +- To change your server's MOTD and icon, edit the `motd1:` tag of the listener config in `java/bungee_command/config.yml`, and replace `server-icon.png` in the folder where the config file is. Use `&` to add color/formatting codes. The server list will downscale your icon to 64x64 pixels +- You can give your MOTD multiple lines, add a `motd2:` to define a second line +- **For an animated MOTD and icon, install EaglerMOTD: [https://github.com/lax1dude/eaglercraft-motd/](https://github.com/lax1dude/eaglercraft-motd/)** + +## Authentication +- To add `/login` and `/register`, install [AuthMe](https://github.com/lax1dude/eaglercraft-plugins/tree/main/AuthMe) and carefully [read it's documentation](https://github.com/AuthMe/AuthMeReloaded/wiki) to set it up correctly + +## Moderation +- **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** +- **To ban a username on Eaglercraftbungee, use:** `eag-ban ` +- **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically +- To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8` +- To ban users by wildcard (\*) use: `eag-ban-wildcard *` or `eag-ban-wildcard *` or `eag-ban-wildcard **` +- **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved** +- To ban users by regular expression, use: `eag-ban-regex ` with a regular expression to match the username in **lowercase** +- **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase** + 36. To connect to your server through a `ws://` or `wss://` URL instead of `ip:port`, set up [nginx](https://nginx.org/) as a reverse proxy to the `ip:port` of you EaglercraftBungee server you want the URL to connect to. Use a location URL template with the `proxy_pass` directive. 37. Eaglercraft uses port 80 for IP connections by default, typing `127.0.0.1` is the same as typing `ws://127.0.0.1:80/` 38. To forward a client's remote IP address from a request on nginx to EaglercraftBungee for enforcing IP bans, set the `X-Real-IP` header on the request to websocket when it is proxied -39. To make a custom resource pack for your site, clone this repository and edit the files in [lwjgl-rundir/resources](https://github.com/lax1dude/eaglercraft/tree/main/lwjgl-rundir/resources). -40. When you are done, navigate to [epkcompiler/](https://github.com/lax1dude/eaglercraft/tree/main/epkcompiler) and double-click `run.bat`. Wait for the window to say `Press any key to continue...` and close it. Then, go to `../javascript` in the repository and copy `javascript/assets.epk` to the `assets.epk` on your website -41. If you're on mac or linux, navigate to the epkcompiler folder via `cd` and run `chmod +x run_unix.sh` and then `./run_unix.sh` to do this, then copy the same `javascript/assets.epk` to the `assets.epk` on your website ## EaglercraftBungee @@ -240,7 +268,9 @@ test: In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your bungeecord and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" -### Plugin Development +# Others + +## Plugin Development **To develop a plugin, download [stable-download/java/bungee_command/bungee_dist.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/java/bungee_command/bungee-dist.jar) and add it to the Build Path of your Java IDE. Develop the plugin just like a regular BungeeCord plugin, see [EaglerMOTD](https://github.com/lax1dude/eaglercraft-motd/) for an example.** @@ -254,24 +284,20 @@ In this example, sending a player to the server `test`, such as when they enter **Register event handlers using the standard BungeeCord** `@EventHandler` **annotation in your** `Listener` **class** -## Hosting a LAN server relay - -### Simply download [stable-download/sp-relay.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/sp-relay.jar) and run `java -jar sp-relay.jar` - -**Run `java -jar sp-relay.jar --debug` to view debug info like all the IPs of incoming connections, as it is not shown by default because logging all that info will reduce performance when the relay is being pinged many times a second depending on it's popularity.** - -Edit the `relayConfig.ini` file generated on first launch to change the port and configure ratelimiting and such, and `relays.txt` to change the list of STUN and TURN relays reported to clients connecting to the relay, which are required to correctly establish a P2P LAN world connection in browsers - -**The `origin-whitelist` config variable is a semicolon (`;`) seperated list of domains used to restrict what sites are to be allowed to use your relay. When left blank it allows all sites. Add `offline` to allow offline download clients to use your relay as well, and `null` to allow connections that do not specify an `Origin:` header. Use `*` as a wildcard, for example: `*.deev.is` allows all domains ending with "deev.is" to use the relay.** - ## Compiling To compile for the web, run the gradle 'teavm' compile target to generate the classes.js file. The LWJGL runtime is no longer supported it is only included for reference -**To modify the game's resource pack (javascript/assets.epk), view the readme in the [/epkcompiler](https://github.com/lax1dude/eaglercraft/tree/main/epkcompiler) directory** +## Creating a resource pack + +- To make a custom resource pack for your site, clone this repository and edit the files in [lwjgl-rundir/resources](https://github.com/lax1dude/eaglercraft/tree/main/lwjgl-rundir/resources). +- When you are done, navigate to [epkcompiler/](https://github.com/lax1dude/eaglercraft/tree/main/epkcompiler) and double-click `run.bat`. Wait for the window to say `Press any key to continue...` and close it. Then, go to `../javascript` in the repository and copy `javascript/assets.epk` to the `assets.epk` on your website +- If you're on mac or linux, navigate to the epkcompiler folder via `cd` and run `chmod +x run_unix.sh` and then `./run_unix.sh` to do this, then copy the same `javascript/assets.epk` to the `assets.epk` on your website ## Contributing All I really have to say is, tabs not spaces, and format the code to be like the eclipse auto format tool on factory settings, but also run-on lines of code long enough to go off the screen and single line if statements and other format violations in that category are welcome if it helps enhance the contrast between the less important code and the more important code in a file. Don't commit changes to `javascript/classes.js` or `javascript/classes_server.js` or `javascript/assets.epk` or anything in `stable-download/`. I'll recompile those myself when I merge the pull request. + +**README was redesigned by [DiffuseHyperion](https://github.com/DiffuseHyperion) :)** From e6beb2212b2baed03d675a2fbfbcdc25fc65af2a Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:39:26 +0800 Subject: [PATCH 04/10] it's to its https://www.grammarly.com/blog/its-vs-its/?gclid=CjwKCAjw2OiaBhBSEiwAh2ZSP7heS3rE9jc7JjA_KRL577c_v8wIFtF25haNjAM1s3gX11SGSR3SURoCiogQAvD_BwE&gclsrc=aw.ds --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50219e0..af3a163 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ There are alot more configurations in bungeecord, but this should set you up - **For an animated MOTD and icon, install EaglerMOTD: [https://github.com/lax1dude/eaglercraft-motd/](https://github.com/lax1dude/eaglercraft-motd/)** ## Authentication -- To add `/login` and `/register`, install [AuthMe](https://github.com/lax1dude/eaglercraft-plugins/tree/main/AuthMe) and carefully [read it's documentation](https://github.com/AuthMe/AuthMeReloaded/wiki) to set it up correctly +- To add `/login` and `/register`, install [AuthMe](https://github.com/lax1dude/eaglercraft-plugins/tree/main/AuthMe) and carefully [read its documentation](https://github.com/AuthMe/AuthMeReloaded/wiki) to set it up correctly ## Moderation - **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** From 47c60234db440e841f5bc5946c963a2a63368920 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:41:07 +0800 Subject: [PATCH 05/10] Update README.md added public lan relay section --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af3a163..b5b94eb 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,9 @@ Make sure they add the relay server your game opens the LAN world on to their "N ### THIS IS A REQUIRED STEP FOR A PERSON TO JOIN YOUR WORLD, IF THEY DO NOT HAVE THE RELAY YOUR WORLD IS HOSTED ON ADDED TO THEIR "Network Settings" THE GAME WILL BE UNABLE TO LOCATE THE WORLD -### Here are some public relay servers you can use: +## Public LAN Relays: + +Here are some public relay servers you can use: - `wss://relay.deev.is/` - `wss://relay.lax1dude.net/` From e6e74ddb4a0f72d5d2d803006e0265a84558e9ce Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:42:20 +0800 Subject: [PATCH 06/10] Update README.md fixes to lan relay sections --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b5b94eb..05c1763 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser |-----------------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------| | [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | | [LAN Worlds](#LAN-Worlds) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Compiling](#Compiling) | -| [Public LAN Relays](#Here-are-some-public-relay-servers-you-can-use:) | [Creating a Server - Bungeecord](#Creating-a-server---Bungeecord) | [Creating a resource pack](#Creating-a-resource-pack) | -| [Creating a LAN relay](#Creating-a-LAN-relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | +| [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - Bungeecord](#Creating-a-server---Bungeecord) | [Creating a resource pack](#Creating-a-resource-pack) | +| [Creating a LAN Relay](#Creating-a-LAN-Relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | | | [Bungeecord Configuration](#Bungeecord-Configuration) | | # Singleplayer @@ -53,7 +53,7 @@ Make sure they add the relay server your game opens the LAN world on to their "N ### THIS IS A REQUIRED STEP FOR A PERSON TO JOIN YOUR WORLD, IF THEY DO NOT HAVE THE RELAY YOUR WORLD IS HOSTED ON ADDED TO THEIR "Network Settings" THE GAME WILL BE UNABLE TO LOCATE THE WORLD -## Public LAN Relays: +## Public LAN Relays Here are some public relay servers you can use: @@ -61,7 +61,7 @@ Here are some public relay servers you can use: - `wss://relay.lax1dude.net/` - `wss://relay.shhnowisnottheti.me/` -## Hosting a LAN server relay +## Creating a LAN Relay ### Simply download [stable-download/sp-relay.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/sp-relay.jar) and run `java -jar sp-relay.jar` From 436b8bd4ec5afe705c09ab80f180f95b4a40dbd0 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:07:34 +0800 Subject: [PATCH 07/10] Update README.md finished the rest of the readme, including eaglercraftbungee, and adding nginx reverse proxy; also added a quick crash course to nginx. this is the first "done" version, im sure ill catch some fuck ups later --- README.md | 191 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 117 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 05c1763..ff51608 100644 --- a/README.md +++ b/README.md @@ -22,23 +22,23 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser # Table Of Contents: -| [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | -|-----------------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------| -| [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | -| [LAN Worlds](#LAN-Worlds) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Compiling](#Compiling) | -| [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - Bungeecord](#Creating-a-server---Bungeecord) | [Creating a resource pack](#Creating-a-resource-pack) | -| [Creating a LAN Relay](#Creating-a-LAN-Relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | -| | [Bungeecord Configuration](#Bungeecord-Configuration) | | +| [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | +|---------------------------------------------------------------|---------------------------------------------------------------------------------|-------------------------------------------------------| +| [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | +| [LAN Worlds](#LAN-Worlds) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Compiling](#Compiling) | +| [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - EaglercraftBungee](#Creating-a-server---EaglercraftBungee) | [Creating a resource pack](#Creating-a-resource-pack) | +| [Creating a LAN Relay](#Creating-a-LAN-Relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | +| | [Bungeecord Configuration](#Bungeecord-Configuration) | | +| | [Creating a Reverse Proxy - NGINX](#Creating-a-Reverse-Proxy---NGINX) | | +| | [NGINX Configuration](#NGINX-Configuration) | | # Singleplayer Simply press the 'Singleplayer' button on the main menu and you can create a regular vanilla minecraft and play it any time. -### Importing / Exporting Worlds +## Importing / Exporting Worlds The worlds are stored in your browser's local storage, **you can export them as EPK files and import them again on all other Eaglercraft sites that also support singleplayer.** You can even copy an exported world to an entirely different computer, or send it to a friend, and import it and continue playing with all your progress saved. -**Link: [https://g.deev.is/eaglercraft/](https://g.deev.is/eaglercraft/)** - ## LAN Worlds ### Eaglercraft fully supports LAN worlds, you can share your world with any player and they can connect directly to it as if you are running a server in your browser. @@ -55,7 +55,7 @@ Make sure they add the relay server your game opens the LAN world on to their "N ## Public LAN Relays -Here are some public relay servers you can use: +### Here are some public relay servers you can use: - `wss://relay.deev.is/` - `wss://relay.lax1dude.net/` @@ -73,17 +73,19 @@ Edit the `relayConfig.ini` file generated on first launch to change the port and # Multiplayer -There are multiple community hosted servers, the best way to discover those is to use the [official client](https://g.deev.is/eaglercraft/) +### There are multiple community hosted servers, the best way to discover those is to use the [official client](https://g.deev.is/eaglercraft/) -Alternatively, there is a server list[^2] to find servers. +#### Alternatively, there is a server list[^2] to find servers. [^2]: Server list is currently being rebuilt, use official client for now # Creating your own server -There are multiple parts to a server, mainly consisting of bungeecord, a proxy which will translate websockets to raw TCP connection, which minecraft can understand. +There are ***multiple parts*** **to a server**, mainly consisting of a **regular 1.5.2 Bukkit server**, and a **modified version of Bungeecord** called **EaglercraftBungee**, which on top of the regular Bungeecord functionality, it translates WebSocket connections to raw TCP connections which Bukkit can understand. -You may also want to set up your own client, allowing you to control default server listings, resource packs, and a faster connection. +You may also want to set up your own **client**, allowing you to *control default server listings, resource packs, and an overall faster connection due to less load.* + +If you want to use a domain for your server, **a reverse proxy** can be set up to enable extra functionality within EaglercraftBungee. **NGINX** is recommended, and a tutorial is included **[here](#Creating-a-Reverse-Proxy---NGINX)**. **This is optional, and can be skipped by just connecting with the IP.** ### If replit is acceptable, you can use [this](https://replit.com/@ayunami2000/eaglercraft-server) to automatically set up everything for a server, otherwise, look below for instructions @@ -101,7 +103,7 @@ Then, in that folder, run `chmod +x run_unix.sh` and then run `./run_unix.sh`. I 8. To add some bukkit plugins, download the plugin's JAR file for CraftBukkit 1.5.2 and place it in `java/bukkit_command/plugins` (See [https://github.com/lax1dude/eaglercraft-plugins/](https://github.com/lax1dude/eaglercraft-plugins/) to download some supported plugins) -## Creating a server - Bungeecord +## Creating a server - EaglercraftBungee 1. In the same new folder, go into the `java/bungee_command` folder 2. In Windows, double-click `run.bat`. It should open a second terminal window Keep both the first and second terminal window you opened, just minimize them, don't close @@ -114,7 +116,12 @@ There are alot more configurations in bungeecord, but this should set you up **It should allow you to connect, if not, check the two terminal windows for errors** ## Creating a client -1. To install, create a website and upload the contents of `stable-download/web` to the URL you want to have Eaglercraft on +1. To install, upload the contents of `stable-download/web` to a web server. + - There are *multiple ways of setting up a web server*. **[NGINX](https://nginx.org) is a powerful web server, but alternatives like [Web Server for Chrome](https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en) may be easier to set up.** + - A quick crash course on setting up NGINX is provided [here](#Creating-a-Reverse-Proxy---NGINX), **FOLLOW STEPS 1 AND 2 ONLY**, then navigate to `/var/www/html` and upload the contents of `stable-download/web` there. + - If you had installed NGINX earlier as a reverse proxy, you can also use it to host the client, **follow the steps above ^^^** + - Make sure that the URL to connect to the client and the server are separate, preferably with a path, like `https://eaglercraft.example.com/server` + 2. **The 'web' folder will not work if you open it in your browser locally! If you see 'file:///' in the URL you are doing it wrong. You need to upload the folder to an HTTP or HTTPS server and access it over the internet via http:// or https://. The game will not load otherwise, this is not a bug** 3. To modify the list of default servers, modify the `window.eaglercraftOpts` variable in `index.html`. 4. **A full guide on how to configure `eaglercraftOpts` is coming soon, but it should be fairly intuitive to figure out how to set it up based on what the default values already are when you look in stable-download** @@ -127,115 +134,98 @@ There are alot more configurations in bungeecord, but this should set you up - You can give your MOTD multiple lines, add a `motd2:` to define a second line - **For an animated MOTD and icon, install EaglerMOTD: [https://github.com/lax1dude/eaglercraft-motd/](https://github.com/lax1dude/eaglercraft-motd/)** -## Authentication -- To add `/login` and `/register`, install [AuthMe](https://github.com/lax1dude/eaglercraft-plugins/tree/main/AuthMe) and carefully [read its documentation](https://github.com/AuthMe/AuthMeReloaded/wiki) to set it up correctly - -## Moderation -- **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** -- **To ban a username on Eaglercraftbungee, use:** `eag-ban ` -- **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically -- To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8` -- To ban users by wildcard (\*) use: `eag-ban-wildcard *` or `eag-ban-wildcard *` or `eag-ban-wildcard **` -- **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved** -- To ban users by regular expression, use: `eag-ban-regex ` with a regular expression to match the username in **lowercase** -- **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase** - -36. To connect to your server through a `ws://` or `wss://` URL instead of `ip:port`, set up [nginx](https://nginx.org/) as a reverse proxy to the `ip:port` of you EaglercraftBungee server you want the URL to connect to. Use a location URL template with the `proxy_pass` directive. -37. Eaglercraft uses port 80 for IP connections by default, typing `127.0.0.1` is the same as typing `ws://127.0.0.1:80/` -38. To forward a client's remote IP address from a request on nginx to EaglercraftBungee for enforcing IP bans, set the `X-Real-IP` header on the request to websocket when it is proxied - -## EaglercraftBungee - -EaglercraftBungee translates WebSockets to a raw Minecraft 1.5.2 TCP connection. It is just regular BungeeCord with more `config.yml` options, and a built in plugin for syncing people's custom skins between clients so people can see each other's skins - -### If voice chat causes moderation problems, set `voice_enabled: false` in config.yml - +## Authentication **To enable the /login and /register commands in EaglercraftBungee, you can edit this portion of config.yml** ```yaml authservice: - enabled: false - register_enabled: true authfile: auths.db + register_enabled: true ip_limit: 0 join_messages: - '&3Welcome to my &aEaglercraftBungee &3server!' login_timeout: 30 + enabled: false ``` - -- `enable` Turns login commands on and off +- `authfile` Sets the authentication database file, which is **compatible with AuthMe** - `register_enabled` Turns register command on and off -- `authfile` Sets the authentication database file, which is **compatible with AuthMe** - - `ip_limit` Sets the max number of registrations per IP, 0 = unlimited - `join_messages` List of messages to show the player when they join - `login_timeout` Sets how many seconds players have to log in before they are kicked -**EaglercraftBungee has a built in domain blacklist that updates automatically, you can disable it by setting this in config.yml:** +- `enable` Turns login commands on and off + +## Moderation +### Miscellaneous +- **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase** + +- **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** + +### Username Bans +- **To ban a username on Eaglercraftbungee, use:** `eag-ban ` +- **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved** +- To ban users by regular expression, use: `eag-ban-regex ` with a regular expression to match the username in **lowercase** + +### IP Bans + +In order for IP Bans to work, a [**a reverse proxy**](#Creating-a-Reverse-Proxy---NGINX) is required, and **[`forward_ip`](#NGINX-Configuration) needs to be configured,** ***otherwise it cannot ban the user's IP*** + +- **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically +- To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8` +- To ban users by wildcard (\*) use: `eag-ban-wildcard *` or `eag-ban-wildcard *` or `eag-ban-wildcard **` + +### Client Bans +- **EaglercraftBungee has a built in domain blacklist that updates automatically, you can disable it by setting this in config.yml:** ```yaml enable_web_origin_blacklist: false ``` -**To block all clients on replit from joining, set this to true in config.yml:** +- **To block all clients on replit from joining, set this to true in config.yml:** ```yaml origin_blacklist_block_replit_clients: true ``` -**To block all offline-download clients, set this to true in config.yml:** +- **To block all offline-download clients, set this to true in config.yml:** ```yaml origin_blacklist_block_offline_download: true ``` -**To block the debug runtime (or other desktop clients), set this to true in config.yml:** +- **To block the debug runtime (or other desktop clients), set this to true in config.yml:** ```yaml origin_blacklist_block_missing_origin_header: true ``` +- **To add your own blacklisted domains**, create a file called `origin_blacklist.txt` in your bungeecord directory and put the regular expressions inside, one on each line. There 's also a `domain` command in the console to view a player's domain, and a `block-domain` and `block-domain-name` and `unblock-domain` command to manage the local `origin_blacklist.txt` from the bungee console (if you don't know how to edit a file on your own). The list reloads automatically when changes to the file are detected. -**To add your own blacklisted domains**, create a file called `origin_blacklist.txt` in your bungeecord directory and put the regular expressions inside, one on each line. There 's also a `domain` command in the console to view a player's domain, and a `block-domain` and `block-domain-name` and `unblock-domain` command to manage the local `origin_blacklist.txt` from the bungee console (if you don't know how to edit a file on your own). The list reloads automatically when changes to the file are detected. - -### To configure bungee to block connections from all clients except your own, set this option: +- ### To configure bungee to block connections from all clients except your own, set this option: ```yaml origin_blacklist_use_simple_whitelist: true ``` -### Then, add your domain to `origin_blacklist_simple_whitelist` like this: +Then, add your domain to `origin_blacklist_simple_whitelist` like this: ```yaml origin_blacklist_simple_whitelist: - type the name of your client's domain here ``` - -### Then, unless still you want it as an option for your players, disable the offline download so hackers don't use it to bypass the whitelist, as it is not blocked in whitelist mode by default: +Then, unless still you want it as an option for your players, disable the offline download so hackers don't use it to bypass the whitelist, as it is not blocked in whitelist mode by default: ```yaml origin_blacklist_block_offline_download: true ``` +## Others -### To stop people from using bookmarklets to load a client from a different URL onto your official URL via XXS, add these headers to NGINX: +- The server has built in DoS protection, reset it via typing 'eag-ratelimit reset' in the bungee console** -``` -add_header X-Frame-Options "SAMEORIGIN"; -add_header Referrer-Policy "strict-origin"; -add_header X-XSS-Protection "1; mode=block"; -add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' data: blob:; connect-src 'self' ws: wss:; upgrade-insecure-requests"; -``` - -(not fully tested, excuse the scroll bar) - -### To use IP bans and rate limiting, enable `forward_ip` and pass a X-Real-IP header from your proxy to the bungeecord's websocket port - -Nginx example: add `proxy_set_header X-Real-IP $remote_addr` to your proxy configuration - -**The server has built in DoS protection, reset it via typing 'eag-ratelimit reset' in the bungee console** +- Rate limiting is possible, but [**a reverse proxy**](#Creating-a-Reverse-Proxy---NGINX) is required, and **[`forward_ip`](#NGINX-Configuration) needs to be configured to use rate limiting,** ***otherwise it will be disabled by default*** ```yaml ratelimit: @@ -256,9 +246,7 @@ ratelimit: - `exceptions` a list of IP addresses that should never get rate limited. **Local IPs like 127.0.0.1 and 192.168.\*.\* and such are set as exceptions by default** -**you need `forward_ip` configured to use rate limiting, otherwise it will be disabled by default** - -### Redirecting the client to a new WebSocket +- ### Redirecting the client to a new WebSocket If you would like to signal the client to disconnect from your bungeecord and reconnect to a different bungeecord, configure an entry in the `servers` part of config.yml like this: @@ -270,6 +258,59 @@ test: In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your bungeecord and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" +## Creating a Reverse Proxy - NGINX + +Here is a quick crash course of setting up NGINX on Linux, specifically on Debian distributions. + +Here are some google searches for other distributions: + +- [Windows](https://www.google.com/search?q=set+up+nginx+on+windows) +- [Mac](https://www.google.com/search?q=set+up+nginx+on+mac) +- [Linux - Arch](https://www.google.com/search?q=set+up+nginx+on+arch) +- [Linux - Fedora](https://www.google.com/search?q=set+up+nginx+on+fedora) + +1. Open up your terminal, and run + ``sudo apt update`` + and + ``sudo apt install nginx`` +2. Open any web browser, and search for `localhost` in your search bar. You should see something like this:![Welcome to nginx](https://ubuntucommunity.s3.dualstack.us-east-2.amazonaws.com/optimized/2X/7/7504d83a9fe8c09d861b2f7c49e144ac773f0c0d_2_690x288.png) +3. Navigate to NGINX's configuration with `cd /etc/nginx/sites-enabled`. + +4. Create a new configuration file with your domain name, for example `nano eaglercraft.example.com` + +5. Paste in the following code into the file. Replace `example.com` with your own domain, and `app_server_address` as the `ip:port` of your EaglercraftBungee server you want the URL to connect to. +``` +server { + listen 80; + listen [::]:80; + + server_name example.com eaglercraft.example.com; + + location / { + proxy_pass app_server_address; + include proxy_params; + } +} +``` + +6. Now, restart NGINX with `sudo service nginx restart` and you should be good to go! + +## NGINX Configuration + +### To implement the following configuration, add the lines below the `proxy_pass` line. +- **To stop people from using bookmarklets to load a client from a different URL onto your official URL via XXS, add these headers to NGINX:** + +``` +add_header X-Frame-Options "SAMEORIGIN"; +add_header Referrer-Policy "strict-origin"; +add_header X-XSS-Protection "1; mode=block"; +add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' data: blob:; connect-src 'self' ws: wss:; upgrade-insecure-requests"; +``` + +###### (not fully tested, excuse the scroll bar) + +- **To use IP bans and rate limiting, add `proxy_set_header X-Real-IP $remote_addr` to your proxy configuration** + # Others ## Plugin Development @@ -302,4 +343,6 @@ The LWJGL runtime is no longer supported it is only included for reference All I really have to say is, tabs not spaces, and format the code to be like the eclipse auto format tool on factory settings, but also run-on lines of code long enough to go off the screen and single line if statements and other format violations in that category are welcome if it helps enhance the contrast between the less important code and the more important code in a file. Don't commit changes to `javascript/classes.js` or `javascript/classes_server.js` or `javascript/assets.epk` or anything in `stable-download/`. I'll recompile those myself when I merge the pull request. +*** **README was redesigned by [DiffuseHyperion](https://github.com/DiffuseHyperion) :)** +###### the old readme sucks lol From 58cdee693074bb8d289095011e88af80acafdd56 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:14:08 +0800 Subject: [PATCH 08/10] Update README.md emphasis on save file as in quick start, rename bungeecord to eaglercraftbungee and tried to iron out any inconsistencies with naming of eaglercraftbungee --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ff51608..dffb1ec 100644 --- a/README.md +++ b/README.md @@ -14,21 +14,20 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser ### Offline Client Download: [Offline_Download_Version.html](https://github.com/lax1dude/eaglercraft/raw/main/stable-download/Offline_Download_Version.html) -(right click the link and press 'Save link as...' to download the file!) +**(right click the link and press 'Save link as...' to download the file)** ### Play Minecraft Beta Singleplayer: [https://g.deev.is/eaglercraft/beta/](https://g.deev.is/eaglercraft/beta/) [^1]: A list of public servers are already added into the official client # Table Of Contents: - | [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | |---------------------------------------------------------------|---------------------------------------------------------------------------------|-------------------------------------------------------| | [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | | [LAN Worlds](#LAN-Worlds) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Compiling](#Compiling) | | [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - EaglercraftBungee](#Creating-a-server---EaglercraftBungee) | [Creating a resource pack](#Creating-a-resource-pack) | | [Creating a LAN Relay](#Creating-a-LAN-Relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | -| | [Bungeecord Configuration](#Bungeecord-Configuration) | | +| | [EaglercraftBungee Configuration](#EaglercraftBungee-Configuration) | | | | [Creating a Reverse Proxy - NGINX](#Creating-a-Reverse-Proxy---NGINX) | | | | [NGINX Configuration](#NGINX-Configuration) | | @@ -110,7 +109,7 @@ Keep both the first and second terminal window you opened, just minimize them, d 3. On macOS or Linux, repeat step 7 in [Creating a Server - Bukkit](#Creating-a-server---Bukkit), but navigate to `java/bungee_command` this time 4. To add some bungee plugins, download the plugin's JAR file and place it in `java/bungee_command/plugins` -There are alot more configurations in bungeecord, but this should set you up +There are alot more configurations in EaglercraftBungee, but this should set you up **Your server is now ready.** Visit any client, and go to 'Multiplayer' from the main menu. Select 'Direct Connect', type `127.0.0.1:25565` and press 'Join Server' **It should allow you to connect, if not, check the two terminal windows for errors** @@ -127,7 +126,7 @@ There are alot more configurations in bungeecord, but this should set you up 4. **A full guide on how to configure `eaglercraftOpts` is coming soon, but it should be fairly intuitive to figure out how to set it up based on what the default values already are when you look in stable-download** 5. **To create a link to your site that automatically joins the server,** add a `?server=` variable to the URL, like (for example): [https://g.deev.is/eaglercraft/?server=127.0.0.1:25565](https://g.deev.is/eaglercraft/?server=127.0.0.1:25565) will automatically join `ws://127.0.0.1:25565/` as soon as the player finishes setting their username and skin -# Bungeecord Configuration +# EaglercraftBungee Configuration ## MOTD - To change your server's MOTD and icon, edit the `motd1:` tag of the listener config in `java/bungee_command/config.yml`, and replace `server-icon.png` in the folder where the config file is. Use `&` to add color/formatting codes. The server list will downscale your icon to 64x64 pixels @@ -163,10 +162,10 @@ authservice: ### Miscellaneous - **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase** -- **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** +- **To disable voice chat, set `voice_enabled: false` in the EaglercraftBungee config.yml** ### Username Bans -- **To ban a username on Eaglercraftbungee, use:** `eag-ban ` +- **To ban a username on EaglercraftBungee, use:** `eag-ban ` - **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved** - To ban users by regular expression, use: `eag-ban-regex ` with a regular expression to match the username in **lowercase** @@ -174,7 +173,7 @@ authservice: In order for IP Bans to work, a [**a reverse proxy**](#Creating-a-Reverse-Proxy---NGINX) is required, and **[`forward_ip`](#NGINX-Configuration) needs to be configured,** ***otherwise it cannot ban the user's IP*** -- **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically +- **To ban an IP on EaglercraftBungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically - To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8` - To ban users by wildcard (\*) use: `eag-ban-wildcard *` or `eag-ban-wildcard *` or `eag-ban-wildcard **` @@ -202,9 +201,9 @@ origin_blacklist_block_offline_download: true ```yaml origin_blacklist_block_missing_origin_header: true ``` -- **To add your own blacklisted domains**, create a file called `origin_blacklist.txt` in your bungeecord directory and put the regular expressions inside, one on each line. There 's also a `domain` command in the console to view a player's domain, and a `block-domain` and `block-domain-name` and `unblock-domain` command to manage the local `origin_blacklist.txt` from the bungee console (if you don't know how to edit a file on your own). The list reloads automatically when changes to the file are detected. +- **To add your own blacklisted domains**, create a file called `origin_blacklist.txt` in your EaglercraftBungee directory and put the regular expressions inside, one on each line. There 's also a `domain` command in the console to view a player's domain, and a `block-domain` and `block-domain-name` and `unblock-domain` command to manage the local `origin_blacklist.txt` from the bungee console (if you don't know how to edit a file on your own). The list reloads automatically when changes to the file are detected. -- ### To configure bungee to block connections from all clients except your own, set this option: +- ### To configure EaglercraftBungee to block connections from all clients except your own, set this option: ```yaml origin_blacklist_use_simple_whitelist: true @@ -223,7 +222,7 @@ origin_blacklist_block_offline_download: true ``` ## Others -- The server has built in DoS protection, reset it via typing 'eag-ratelimit reset' in the bungee console** +- The server has built in DoS protection, reset it via typing 'eag-ratelimit reset' in the EaglercraftBungee console** - Rate limiting is possible, but [**a reverse proxy**](#Creating-a-Reverse-Proxy---NGINX) is required, and **[`forward_ip`](#NGINX-Configuration) needs to be configured to use rate limiting,** ***otherwise it will be disabled by default*** @@ -248,7 +247,7 @@ ratelimit: - ### Redirecting the client to a new WebSocket -If you would like to signal the client to disconnect from your bungeecord and reconnect to a different bungeecord, configure an entry in the `servers` part of config.yml like this: +If you would like to signal the client to disconnect from your EaglercraftBungee and reconnect to a different EaglercraftBungee, configure an entry in the `servers` part of config.yml like this: ```yaml test: @@ -256,7 +255,7 @@ test: restricted: false ``` -In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your bungeecord and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" +In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your EaglercraftBungee and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" ## Creating a Reverse Proxy - NGINX From b5c35fb553555778c7e4e9d82026f5a5e8351fb8 Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:27:52 +0800 Subject: [PATCH 09/10] Update README.md added separate sections to public servers and clients, added small desc of multiplayer and fixed table of contents, specifically those with slashes '/', which was replaced with 'and' --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dffb1ec..429ad5a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # Eaglercraft ![eaglercraft](https://g.deev.is/eaglercraft/cover.png) @@ -23,7 +24,7 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser # Table Of Contents: | [Singleplayer](#Singleplayer) | [Multiplayer](#Multiplayer) | [Others](#Others) | |---------------------------------------------------------------|---------------------------------------------------------------------------------|-------------------------------------------------------| -| [Importing / Exporting Worlds](#Importing-/-Exporting-Worlds) | [Public clients / servers](#Public-clients-/-servers) | [Plugin Development](#Plugin-Development) | +| [Importing and Exporting Worlds](#Importing-and-Exporting-Worlds) | [Public clients and servers](#Public-clients-and-servers) | [Plugin Development](#Plugin-Development) | | [LAN Worlds](#LAN-Worlds) | [Creating a Server - Bukkit](#Creating-a-server---Bukkit) | [Compiling](#Compiling) | | [Public LAN Relays](#Public-LAN-Relays) | [Creating a Server - EaglercraftBungee](#Creating-a-server---EaglercraftBungee) | [Creating a resource pack](#Creating-a-resource-pack) | | [Creating a LAN Relay](#Creating-a-LAN-Relay) | [Creating a Client](#Creating-a-Client) | [Contributing](#Contributing) | @@ -35,7 +36,7 @@ Eaglercraft is real Minecraft 1.5.2 that you can play in any regular web browser Simply press the 'Singleplayer' button on the main menu and you can create a regular vanilla minecraft and play it any time. -## Importing / Exporting Worlds +## Importing and Exporting Worlds The worlds are stored in your browser's local storage, **you can export them as EPK files and import them again on all other Eaglercraft sites that also support singleplayer.** You can even copy an exported world to an entirely different computer, or send it to a friend, and import it and continue playing with all your progress saved. ## LAN Worlds @@ -71,8 +72,17 @@ Edit the `relayConfig.ini` file generated on first launch to change the port and **The `origin-whitelist` config variable is a semicolon (`;`) seperated list of domains used to restrict what sites are to be allowed to use your relay. When left blank it allows all sites. Add `offline` to allow offline download clients to use your relay as well, and `null` to allow connections that do not specify an `Origin:` header. Use `*` as a wildcard, for example: `*.deev.is` allows all domains ending with "deev.is" to use the relay.** # Multiplayer +Multiplayer functions like vanilla Minecraft, allowing you to join normal Minecraft servers like a normal client. -### There are multiple community hosted servers, the best way to discover those is to use the [official client](https://g.deev.is/eaglercraft/) +## Public clients and servers + +### There are multiple official clients hosted by LAX1DUDE, here is a small list: +- Main: [https://g.deev.is/](https://g.deev.is/ "https://g.deev.is/") +- [https://eaglercraft.net/](https://eaglercraft.net/ "https://eaglercraft.net/") +- [https://eaglercraft.org/](https://eaglercraft.org/ "https://eaglercraft.org/") +- [https://eaglercraft.me/](https://eaglercraft.me/ "https://eaglercraft.me/") +- [https://g.lax1dude.net/eaglercraft/](https://g.lax1dude.net/eaglercraft/ "https://g.lax1dude.net/eaglercraft/") +### There are also multiple community hosted servers, the best way to discover those is to use the [official clients](https://g.deev.is/eaglercraft/) #### Alternatively, there is a server list[^2] to find servers. @@ -109,7 +119,7 @@ Keep both the first and second terminal window you opened, just minimize them, d 3. On macOS or Linux, repeat step 7 in [Creating a Server - Bukkit](#Creating-a-server---Bukkit), but navigate to `java/bungee_command` this time 4. To add some bungee plugins, download the plugin's JAR file and place it in `java/bungee_command/plugins` -There are alot more configurations in EaglercraftBungee, but this should set you up +There are alot more configurations in bungeecord, but this should set you up **Your server is now ready.** Visit any client, and go to 'Multiplayer' from the main menu. Select 'Direct Connect', type `127.0.0.1:25565` and press 'Join Server' **It should allow you to connect, if not, check the two terminal windows for errors** @@ -162,10 +172,10 @@ authservice: ### Miscellaneous - **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase** -- **To disable voice chat, set `voice_enabled: false` in the EaglercraftBungee config.yml** +- **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml** ### Username Bans -- **To ban a username on EaglercraftBungee, use:** `eag-ban ` +- **To ban a username on Eaglercraftbungee, use:** `eag-ban ` - **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved** - To ban users by regular expression, use: `eag-ban-regex ` with a regular expression to match the username in **lowercase** @@ -173,7 +183,7 @@ authservice: In order for IP Bans to work, a [**a reverse proxy**](#Creating-a-Reverse-Proxy---NGINX) is required, and **[`forward_ip`](#NGINX-Configuration) needs to be configured,** ***otherwise it cannot ban the user's IP*** -- **To ban an IP on EaglercraftBungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically +- **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip `, or `eag-ban-ip ` to ban the IP of a player automatically - To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8` - To ban users by wildcard (\*) use: `eag-ban-wildcard *` or `eag-ban-wildcard *` or `eag-ban-wildcard **` @@ -201,9 +211,9 @@ origin_blacklist_block_offline_download: true ```yaml origin_blacklist_block_missing_origin_header: true ``` -- **To add your own blacklisted domains**, create a file called `origin_blacklist.txt` in your EaglercraftBungee directory and put the regular expressions inside, one on each line. There 's also a `domain` command in the console to view a player's domain, and a `block-domain` and `block-domain-name` and `unblock-domain` command to manage the local `origin_blacklist.txt` from the bungee console (if you don't know how to edit a file on your own). The list reloads automatically when changes to the file are detected. +- **To add your own blacklisted domains**, create a file called `origin_blacklist.txt` in your bungeecord directory and put the regular expressions inside, one on each line. There 's also a `domain` command in the console to view a player's domain, and a `block-domain` and `block-domain-name` and `unblock-domain` command to manage the local `origin_blacklist.txt` from the bungee console (if you don't know how to edit a file on your own). The list reloads automatically when changes to the file are detected. -- ### To configure EaglercraftBungee to block connections from all clients except your own, set this option: +- ### To configure bungee to block connections from all clients except your own, set this option: ```yaml origin_blacklist_use_simple_whitelist: true @@ -222,7 +232,7 @@ origin_blacklist_block_offline_download: true ``` ## Others -- The server has built in DoS protection, reset it via typing 'eag-ratelimit reset' in the EaglercraftBungee console** +- The server has built in DoS protection, reset it via typing 'eag-ratelimit reset' in the bungee console** - Rate limiting is possible, but [**a reverse proxy**](#Creating-a-Reverse-Proxy---NGINX) is required, and **[`forward_ip`](#NGINX-Configuration) needs to be configured to use rate limiting,** ***otherwise it will be disabled by default*** @@ -247,7 +257,7 @@ ratelimit: - ### Redirecting the client to a new WebSocket -If you would like to signal the client to disconnect from your EaglercraftBungee and reconnect to a different EaglercraftBungee, configure an entry in the `servers` part of config.yml like this: +If you would like to signal the client to disconnect from your bungeecord and reconnect to a different bungeecord, configure an entry in the `servers` part of config.yml like this: ```yaml test: @@ -255,7 +265,7 @@ test: restricted: false ``` -In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your EaglercraftBungee and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" +In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your bungeecord and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" ## Creating a Reverse Proxy - NGINX From 8392d87a758a6672cb46a595cc5aa9bbac3b66cc Mon Sep 17 00:00:00 2001 From: DiffuseHyperion <95083897+DiffuseHyperion@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:35:07 +0800 Subject: [PATCH 10/10] Update README.md i dont feel right with the small credits at the bottom, i feel its a bit entitled to do so, so i removed it --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 429ad5a..fa3daf0 100644 --- a/README.md +++ b/README.md @@ -351,7 +351,3 @@ The LWJGL runtime is no longer supported it is only included for reference ## Contributing All I really have to say is, tabs not spaces, and format the code to be like the eclipse auto format tool on factory settings, but also run-on lines of code long enough to go off the screen and single line if statements and other format violations in that category are welcome if it helps enhance the contrast between the less important code and the more important code in a file. Don't commit changes to `javascript/classes.js` or `javascript/classes_server.js` or `javascript/assets.epk` or anything in `stable-download/`. I'll recompile those myself when I merge the pull request. - -*** -**README was redesigned by [DiffuseHyperion](https://github.com/DiffuseHyperion) :)** -###### the old readme sucks lol