25w22a Fix unicode usernames and remove restrictions in bungee

This commit is contained in:
catfoolyou 2025-05-30 08:18:21 -04:00
parent f6c573ff2c
commit 0e477da14f
16 changed files with 42206 additions and 42288 deletions

2
.gitignore vendored
View File

@ -4,6 +4,8 @@ build/
lwjgl-rundir/_eagstorage.p.dat
lwjgl-rundir/_eagstorage.g.dat
lwjgl-rundir/_eagstorage.a.dat
lwjgl-rundir/__LIST__
lwjgl-rundir/texturepacks
sp-server/.gradle
sp-server/.settings
sp-server/build

View File

@ -29,7 +29,7 @@ tasks.withType(JavaCompile) {
//sourceSets.main.resources.srcDirs += 'src/lwjgl/java/javazoom/jl/decoder'
dependencies {
//implementation fileTree(dir: './lwjgl-rundir/', include: '*.jar')
//zimplementation fileTree(dir: './lwjgl-rundir/', include: '*.jar')
teavm(teavm.libs.jso)
teavm(teavm.libs.jsoApis)

View File

@ -122,16 +122,18 @@ public class InitialHandler extends PacketHandler implements PendingConnection {
}
String un = handshake.getUsername();
if (un.length() < 3) {
this.disconnect("Username must be at least 3 characters");
return;
System.err.println("Username is under 3 characters!");
// this.disconnect("Username must be at least 3 characters");
// return;
}
if (un.length() > 16) {
this.disconnect("Cannot have username longer than 16 characters");
return;
}
if(!un.equals(un.replaceAll("[^A-Za-z0-9\\-_]", "_").trim())) {
this.disconnect("Go fuck yourself");
return;
System.err.println("Potentially invalid unicode username detected");
// this.disconnect("Go fuck yourself");
// return;
}
if (BungeeCord.getInstance().tokenVerify.isEmpty()) {
String hostname = handshake.getHost();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -5,7 +5,7 @@ import java.util.List;
public class ConfigConstants {
public static final String version = "25w17a";
public static final String version = "25w22a";
public static final String mainMenuString = "Eaglercraft " + version;
public static final String forkMe = "https://git.zelz.net/catfoolyou/Project164";

View File

@ -423,7 +423,7 @@ public class GuiScreenEditProfile extends GuiScreen {
String text = username.getText();
if(text.length() > 16) text = text.substring(0, 16);
text = text.replaceAll("[^A-Za-z0-9\\-_]", "_");
//text = text.replaceAll("[^A-Za-z0-9\\-_]", "_");
this.username.setText(text);
if(par2 == 200 && selectedSlot > 0) {

View File

@ -1,43 +0,0 @@
package net.lax1dude.eaglercraft;
import net.minecraft.src.EnumChatFormatting;
import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiScreen;
public class GuiScreenSingleplayerNotImplemented extends GuiScreen {
private GuiScreen mainmenu;
public GuiScreenSingleplayerNotImplemented(GuiScreen mainmenu) {
this.mainmenu = mainmenu;
}
public void initGui() {
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 3 + 75, "I Understand"));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 3 + 100, "Download server"));
}
public void drawScreen(int par1, int par2, float par3) {
this.drawDefaultBackground();
this.drawCenteredString(fontRenderer, EnumChatFormatting.BOLD + "Singleplayer currently unsupported", this.width / 2, this.height / 3 - 25, 0xFFFFFF);
this.drawCenteredString(fontRenderer, "The desktop runtime does not support singleplayer", this.width / 2, this.height / 3, 0xFFFFFF);
this.drawCenteredString(fontRenderer, "This is not a bug, this version of EaglerAdapter", this.width / 2, this.height / 3 + 20, 0xFFFFFF);
this.drawCenteredString(fontRenderer, "does not support singleplayer on desktop", this.width / 2, this.height / 3 + 30, 0xFFFFFF);
this.drawCenteredString(fontRenderer, "Please self-host a server instead", this.width / 2, this.height / 3 + 50, 0xFFFFFF);
super.drawScreen(par1, par2, par3);
}
protected void actionPerformed(GuiButton par1GuiButton) {
if(par1GuiButton.id == 0) {
this.mc.displayGuiScreen(mainmenu);
}
if(par1GuiButton.id == 1) {
EaglerAdapter.openLink("https://github.com/catfoolyou/Eagler-Server-1.6.4");
}
}
}

View File

@ -135,18 +135,14 @@ public class GuiMainMenu extends GuiScreen {
StringTranslate var2 = StringTranslate.getInstance();
int var4 = this.height / 4 + 48;
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var4, var2.translateKey("menu.singleplayer")));
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4 + 24 * 1, var2.translateKey("menu.multiplayer")));
this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24 * 2, var2.translateKey("menu.forkme")));
// if(EaglerAdapter.isIntegratedServerAvailable()) { // EaglerAdapter.isIntegratedServerAvailable()
// this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var4, var2.translateKey("menu.singleplayer")));
// this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4 + 24 * 1, var2.translateKey("menu.multiplayer")));
// this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24 * 2, var2.translateKey("menu.forkme")));
// }else {
// this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4, var2.translateKey("menu.multiplayer")));
// this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24, var2.translateKey("menu.forkme")));
// }
if(EaglerAdapter.isIntegratedServerAvailable()) { // EaglerAdapter.isIntegratedServerAvailable()
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var4, var2.translateKey("menu.singleplayer")));
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4 + 24 * 1, var2.translateKey("menu.multiplayer")));
this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24 * 2, var2.translateKey("menu.forkme")));
}else {
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var4, var2.translateKey("menu.multiplayer")));
this.buttonList.add(new GuiButton(3, this.width / 2 - 100, var4 + 24, var2.translateKey("menu.forkme")));
}
((GuiButton)this.buttonList.get(this.buttonList.size() - 1)).enabled = false;
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var4 + 72 + 12, 98, 20, var2.translateKey("menu.options")));
@ -278,9 +274,6 @@ public class GuiMainMenu extends GuiScreen {
this.mc.displayGuiScreen(new GuiSelectWorld(this));
}
}
else {
this.mc.displayGuiScreen(new GuiScreenSingleplayerNotImplemented(this));
}
}
if (par1GuiButton.id == 5) {

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long