mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Add unsupported field to disable username validation (#7350)
* Add unsupported field to disable username validation * Add unsupported field to disable username validation
This commit is contained in:
parent
affb89f9a2
commit
756c3377ea
1 changed files with 9 additions and 1 deletions
|
@ -25,6 +25,14 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
private ServerPlayer delayedAcceptPlayer;
|
||||
public String hostname = ""; // CraftBukkit - add field
|
||||
private int velocityLoginMessageId = -1; // Paper - Velocity support
|
||||
+ public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding
|
||||
|
||||
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
|
||||
this.state = ServerLoginPacketListenerImpl.State.HELLO;
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
// Paper end
|
||||
}
|
||||
|
@ -55,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.gameProfile = packet.getGameProfile();
|
||||
+ // Paper start - validate usernames
|
||||
+ if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() && com.destroystokyo.paper.PaperConfig.performUsernameValidation) {
|
||||
+ if (!validateUsername(this.gameProfile.getName())) {
|
||||
+ if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(this.gameProfile.getName())) {
|
||||
+ ServerLoginPacketListenerImpl.this.disconnect("Failed to verify username!");
|
||||
+ return;
|
||||
+ }
|
||||
|
|
Loading…
Reference in a new issue