Add Shared World Relay

This commit is contained in:
eaglercraft 2024-05-04 17:17:44 -07:00
parent 94f8795676
commit 70c27bce74
7 changed files with 108 additions and 0 deletions

BIN
Eaglercraft_SharedWorldRelay.zip Executable file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,32 @@
From the 1.5.2 README.md:
## Creating a LAN Relay
### Simply download (DEAD URL) 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.**
2023 notes:
Shared worlds work between any two eaglercraft clients that share a relay server, anyone can join your world it is not limited to just the other devices on your local network
When adding the relay address to the client you must provide it in URI format like "ws://address:port" or "wss://address:port", and determining the IP address and setting up port forwarding is the same as making a regular minecraft server
Ratelimiting is the same as eaglercraftbungee, "ping-ratelimit" is for limiting pings from clients searching for worlds, "world-ratelimit" is for limiting creating and joining new worlds
The relay is not used for transferring the actual gameplay packets, it is only used for the initial discovery process to allow clients to find each other, stuff such as coordinates and chat messages aren't visible to the relay
For your convenience, a "run.bat" and "run.sh" script is included which will auto-restart the relay if it crashes, remove the "--debug" flag from the java command in the script when used in production
2024 notes:
The default openrelayproject TURN servers are no longer free (did we kill them?) so you will need to also host your own TURN server as well and edit the default relays.txt to use it instead of openrelayproject, we recommend you use https://github.com/coturn/coturn

View File

@ -0,0 +1,23 @@
[EaglerSPRelay]
address: 0.0.0.0
port: 6699
code-length: 5
code-chars: abcdefghijklmnopqrstuvwxyz0123456789
code-mix-case: false
connections-per-ip: 128
ping-ratelimit-enable: true
ping-ratelimit-period: 256
ping-ratelimit-limit: 128
ping-ratelimit-lockout-limit: 192
ping-ratelimit-lockout-duration: 300
worlds-per-ip: 32
world-ratelimit-enable: true
world-ratelimit-period: 192
world-ratelimit-limit: 32
world-ratelimit-lockout-limit: 48
world-ratelimit-lockout-duration: 600
origin-whitelist:
real-ip-header-name: X-Real-IP
enable-real-ip-header: false
show-local-worlds: true
server-comment: Eags. Shared World Relay

View File

@ -0,0 +1,28 @@
[STUN]
url=stun:stun.l.google.com:19302
[STUN]
url=stun:stun1.l.google.com:19302
[STUN]
url=stun:stun2.l.google.com:19302
[STUN]
url=stun:stun3.l.google.com:19302
[STUN]
url=stun:stun4.l.google.com:19302
[STUN]
url=stun:openrelay.metered.ca:80
[TURN]
url=turn:openrelay.metered.ca:443
username=openrelayproject
password=openrelayproject
[TURN]
url=turn:openrelay.metered.ca:443?transport=tcp
username=openrelayproject
password=openrelayproject

View File

@ -0,0 +1,13 @@
@echo off
title LAN World Relay
echo:
echo Eaglercraft 1.5.2 LAN World Relay
echo Note: Requires java 8 or newer!
:fuck
timeout /t 10 /nobreak
echo:
java -jar EaglerSPRelay.jar --debug
echo:
echo RELAY STOPPED!
echo Restarting...
goto fuck

View File

@ -0,0 +1,12 @@
#!/bin/sh
echo ""
echo "Eaglercraft 1.5.2 LAN World Relay"
echo "Note: Requires java 8 or newer!"
while true
do
echo ""
java -jar EaglerSPRelay.jar --debug
echo ""
echo "press [CTRL+C] to cancel restart"
sleep 5
done