Merge branch 'main' of https://github.com/lax1dude/eaglercraft
This commit is contained in:
commit
0ecde03a95
3
.gitattributes
vendored
3
.gitattributes
vendored
|
@ -5,3 +5,6 @@
|
||||||
*.bat text eol=crlf
|
*.bat text eol=crlf
|
||||||
*.sh text eol=lf
|
*.sh text eol=lf
|
||||||
gradlew text eol=lf
|
gradlew text eol=lf
|
||||||
|
|
||||||
|
*.html linguist-vendored
|
||||||
|
*.htm linguist-vendored
|
||||||
|
|
12
README.md
12
README.md
|
@ -1,8 +1,8 @@
|
||||||
# Eaglercraft
|
# Eaglercraft
|
||||||
|
|
||||||
### Note: someone got eags.us suspended for copyright infringement, use [https://eaglercraft.us/](https://eaglercraft.us/) for now (until it gets deleted too)
|
### Note: someone got eags.us suspended for copyright infringement, use [https://eaglercraft.net/](https://eaglercraft.net/) for now (until it gets deleted too)
|
||||||
|
|
||||||
### Client: [https://eaglercraft.us/](https://eaglercraft.us/)
|
### Client: [https://eaglercraft.net/](https://eaglercraft.net/)
|
||||||
|
|
||||||
### Offline Download: [Offline_Download_Version.html](https://github.com/LAX1DUDE/eaglercraft/raw/main/stable-download/Offline_Download_Version.html)
|
### Offline Download: [Offline_Download_Version.html](https://github.com/LAX1DUDE/eaglercraft/raw/main/stable-download/Offline_Download_Version.html)
|
||||||
|
|
||||||
|
@ -12,13 +12,13 @@
|
||||||
|
|
||||||
![eaglercraft](https://cdn.discordapp.com/attachments/378764518081429506/964047481849643018/new_github_screenshot.png)
|
![eaglercraft](https://cdn.discordapp.com/attachments/378764518081429506/964047481849643018/new_github_screenshot.png)
|
||||||
|
|
||||||
### Official Demo URL: [https://eaglercraft.us/](https://eaglercraft.us/)
|
### Official Demo URL: [https://eaglercraft.net/](https://eaglercraft.net/)
|
||||||
|
|
||||||
### Download Locally: [stable-download/Offline_Download_Version.html](https://github.com/LAX1DUDE/eaglercraft/raw/main/stable-download/Offline_Download_Version.html)
|
### 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: use [https://eaglercraft.us/beta/](https://eaglercraft.us/beta/) for now until I fix eags.us
|
### Play Minecraft Beta Singleplayer: use [https://eaglercraft.net/beta/](https://eaglercraft.net/beta/) for now until I fix eags.us
|
||||||
|
|
||||||
**For any questions you can join the discord server and hit me up there [https://discord.gg/Ekzcgs3DKZ](https://discord.gg/Ekzcgs3DKZ)**
|
**For any questions you can join the discord server and hit me up there [https://discord.gg/Ekzcgs3DKZ](https://discord.gg/Ekzcgs3DKZ)**
|
||||||
|
|
||||||
|
@ -84,9 +84,9 @@ Keep both the first and second terminal window you opened, just minimize them do
|
||||||
|
|
||||||
## Singleplayer?
|
## Singleplayer?
|
||||||
|
|
||||||
I successfully created Singleplayer for this version of eaglercraft and it works 100%, **but after many rounds of very thorough testing**, I found that TeaVM is unable to optimize certain aspects of terrain generation and world ticking as well as it can optimize the rendering for a multiplayer-only build. On an [i9-11900K]( https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i9-11900K+%40+3.50GHz&id=3904) a render distance of 'Tiny' struggles to pass 12 TPS while standing still, and drops below 1 TPS as soon as a couple new chunks have to be generated and trigger lighting updates. The playerbase of this game **will bother me every f\*\*king day if what I release as singleplayer is not perfect** and therefore singleplayer will remain private indefinetly and I will not answer any further questions about it or share the source code unless you are just looking to repurpose some of the base OS emulation code.
|
**You can play the singleplayer fork here, which has not yet been merged: [https://eaglercraft.net/new_singleplayer/](https://eaglercraft.net/new_singleplayer/)**
|
||||||
|
|
||||||
**You can play Minecraft Beta singleplayer here: [https://g.eags.us/eaglercraft/singleplayer_test/](https://g.eags.us/eaglercraft/singleplayer_test/)**
|
You can play Minecraft Beta here: [https://eaglercraft.net/beta/](https://eaglercraft.net/beta/)
|
||||||
|
|
||||||
## How does it work?
|
## How does it work?
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
@ -131,6 +132,7 @@ public class BungeeCord extends ProxyServer {
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
private Collection<Command> banCommands;
|
private Collection<Command> banCommands;
|
||||||
public AuthSystem authSystem;
|
public AuthSystem authSystem;
|
||||||
|
public String tokenVerify;
|
||||||
|
|
||||||
public static BungeeCord getInstance() {
|
public static BungeeCord getInstance() {
|
||||||
return (BungeeCord) ProxyServer.getInstance();
|
return (BungeeCord) ProxyServer.getInstance();
|
||||||
|
@ -244,6 +246,7 @@ public class BungeeCord extends ProxyServer {
|
||||||
this.authSystem = new AuthSystem(this.config.getAuthInfo());
|
this.authSystem = new AuthSystem(this.config.getAuthInfo());
|
||||||
this.getPluginManager().registerCommand(null, new CommandChangePassword(this.authSystem));
|
this.getPluginManager().registerCommand(null, new CommandChangePassword(this.authSystem));
|
||||||
}
|
}
|
||||||
|
this.tokenVerify = Optional.ofNullable(System.getenv("YEEISH_TOKEN")).orElse(this.config.getTokenVerify());
|
||||||
if (this.reconnectHandler == null) {
|
if (this.reconnectHandler == null) {
|
||||||
this.reconnectHandler = new SQLReconnectHandler();
|
this.reconnectHandler = new SQLReconnectHandler();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class Configuration {
|
||||||
private boolean onlineMode;
|
private boolean onlineMode;
|
||||||
private boolean voiceEnabled;
|
private boolean voiceEnabled;
|
||||||
private boolean protocolSupport;
|
private boolean protocolSupport;
|
||||||
|
private String tokenVerify;
|
||||||
private int playerLimit;
|
private int playerLimit;
|
||||||
private String name;
|
private String name;
|
||||||
private boolean showBanType;
|
private boolean showBanType;
|
||||||
|
@ -63,6 +64,7 @@ public class Configuration {
|
||||||
this.onlineMode = false;
|
this.onlineMode = false;
|
||||||
this.voiceEnabled = adapter.getBoolean("voice_enabled", true);
|
this.voiceEnabled = adapter.getBoolean("voice_enabled", true);
|
||||||
this.protocolSupport = adapter.getBoolean("protocol_support_fix", false);
|
this.protocolSupport = adapter.getBoolean("protocol_support_fix", false);
|
||||||
|
this.tokenVerify = adapter.getString("token_verify", "");
|
||||||
this.playerLimit = adapter.getInt("player_limit", this.playerLimit);
|
this.playerLimit = adapter.getInt("player_limit", this.playerLimit);
|
||||||
this.name = adapter.getString("server_name", EaglercraftBungee.name + " Server");
|
this.name = adapter.getString("server_name", EaglercraftBungee.name + " Server");
|
||||||
this.showBanType = adapter.getBoolean("display_ban_type_on_kick", false);
|
this.showBanType = adapter.getBoolean("display_ban_type_on_kick", false);
|
||||||
|
@ -129,6 +131,10 @@ public class Configuration {
|
||||||
return protocolSupport;
|
return protocolSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTokenVerify() {
|
||||||
|
return tokenVerify;
|
||||||
|
}
|
||||||
|
|
||||||
public String getServerName() {
|
public String getServerName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,15 @@ public class InitialHandler extends PacketHandler implements PendingConnection {
|
||||||
this.disconnect("Go fuck yourself");
|
this.disconnect("Go fuck yourself");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (BungeeCord.getInstance().tokenVerify.isEmpty()) {
|
||||||
|
String hostname = handshake.getHost();
|
||||||
|
if (hostname.contains(":")) {
|
||||||
|
handshake.setHost(hostname.substring(0, hostname.indexOf(':')));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handshake.setHost(BungeeCord.getInstance().tokenVerify);
|
||||||
|
handshake.setPort(0);
|
||||||
|
}
|
||||||
InetAddress sc;
|
InetAddress sc;
|
||||||
synchronized(WebSocketProxy.localToRemote) {
|
synchronized(WebSocketProxy.localToRemote) {
|
||||||
sc = WebSocketProxy.localToRemote.get(this.ch.getHandle().remoteAddress());
|
sc = WebSocketProxy.localToRemote.get(this.ch.getHandle().remoteAddress());
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class AuthSystem {
|
||||||
private final Map<String, AuthData> database = new HashMap<>();
|
private final Map<String, AuthData> database = new HashMap<>();
|
||||||
|
|
||||||
public boolean register(String username, String password, String ip) {
|
public boolean register(String username, String password, String ip) {
|
||||||
|
username = username.toLowerCase();
|
||||||
synchronized (database) {
|
synchronized (database) {
|
||||||
AuthData authData = database.get(username);
|
AuthData authData = database.get(username);
|
||||||
if (authData != null)
|
if (authData != null)
|
||||||
|
@ -66,12 +67,14 @@ public class AuthSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRegistered(String username) {
|
public boolean isRegistered(String username) {
|
||||||
|
username = username.toLowerCase();
|
||||||
synchronized (database) {
|
synchronized (database) {
|
||||||
return database.containsKey(username);
|
return database.containsKey(username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean changePass(String username, String password) {
|
public boolean changePass(String username, String password) {
|
||||||
|
username = username.toLowerCase();
|
||||||
synchronized (database) {
|
synchronized (database) {
|
||||||
AuthData authData = database.get(username);
|
AuthData authData = database.get(username);
|
||||||
authData.salt = createSalt(16);
|
authData.salt = createSalt(16);
|
||||||
|
@ -82,6 +85,7 @@ public class AuthSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean login(String username, String password) {
|
public boolean login(String username, String password) {
|
||||||
|
username = username.toLowerCase();
|
||||||
synchronized (database) {
|
synchronized (database) {
|
||||||
AuthData authData = database.get(username);
|
AuthData authData = database.get(username);
|
||||||
if (authData == null)
|
if (authData == null)
|
||||||
|
|
|
@ -45,6 +45,14 @@ public class Packet2Handshake extends DefinedPacket {
|
||||||
this.procolVersion = (byte)b;
|
this.procolVersion = (byte)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHost(String h) {
|
||||||
|
this.host = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPort(int p) {
|
||||||
|
this.port = p;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return this.username;
|
return this.username;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -25,6 +25,8 @@
|
||||||
.*lapx\..*$
|
.*lapx\..*$
|
||||||
.*oxgaming.*repl\.co$
|
.*oxgaming.*repl\.co$
|
||||||
.*olproject\.ml$
|
.*olproject\.ml$
|
||||||
|
.*prof.*aming\.repl\.co$
|
||||||
|
.*sucks\.repl\.co$
|
||||||
|
|
||||||
# block ambiguous domains (excuse the regex skill issues)
|
# block ambiguous domains (excuse the regex skill issues)
|
||||||
^(?!g\.eags\.us).*eags\.us$
|
^(?!g\.eags\.us).*eags\.us$
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user