mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-09-30 23:47:32 +02:00
InitialHandler PROCESSING_USERNAME State
This commit is contained in:
parent
e422dfc79e
commit
1ac9a3b103
@ -1,11 +1,11 @@
|
|||||||
From 3534b38cccbcdd2838d7c994f51cfcf3977f0937 Mon Sep 17 00:00:00 2001
|
From cf468c96ce1390300c7ec73f3bf3a78df012cd10 Mon Sep 17 00:00:00 2001
|
||||||
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
|
||||||
Date: Fri, 25 Feb 2022 12:28:31 -0300
|
Date: Fri, 25 Feb 2022 12:28:31 -0300
|
||||||
Subject: [PATCH] InitialHandler Processing State
|
Subject: [PATCH] InitialHandler Processing State
|
||||||
|
|
||||||
|
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
||||||
index 4295fd68..5296a5ae 100644
|
index 4295fd68..26a3dd25 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
||||||
@@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
@@ -128,7 +128,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||||
@ -13,7 +13,7 @@ index 4295fd68..5296a5ae 100644
|
|||||||
{
|
{
|
||||||
|
|
||||||
- HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING;
|
- HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING;
|
||||||
+ PROCESSING, HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING;
|
+ PROCESSING, PROCESSING_USERNAME, HANDSHAKE, STATUS, PING, USERNAME, ENCRYPT, FINISHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canSendKickMessage()
|
private boolean canSendKickMessage()
|
||||||
@ -37,7 +37,7 @@ index 4295fd68..5296a5ae 100644
|
|||||||
public void handle(Handshake handshake) throws Exception
|
public void handle(Handshake handshake) throws Exception
|
||||||
{
|
{
|
||||||
Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" );
|
Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" );
|
||||||
+ thisState = State.PROCESSING;
|
+ thisState = State.PROCESSING_USERNAME;
|
||||||
this.handshake = handshake;
|
this.handshake = handshake;
|
||||||
ch.setVersion( handshake.getProtocolVersion() );
|
ch.setVersion( handshake.getProtocolVersion() );
|
||||||
|
|
||||||
@ -57,6 +57,23 @@ index 4295fd68..5296a5ae 100644
|
|||||||
|
|
||||||
SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
|
SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
|
||||||
// Waterfall start
|
// Waterfall start
|
||||||
|
@@ -705,14 +710,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||||
|
@Override
|
||||||
|
public void setOnlineMode(boolean onlineMode)
|
||||||
|
{
|
||||||
|
- Preconditions.checkState( thisState == State.USERNAME, "Can only set online mode status whilst state is username" );
|
||||||
|
+ Preconditions.checkState( thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME, "Can only set online mode status whilst state is username" );
|
||||||
|
this.onlineMode = onlineMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUniqueId(UUID uuid)
|
||||||
|
{
|
||||||
|
- Preconditions.checkState( thisState == State.USERNAME, "Can only set uuid while state is username" );
|
||||||
|
+ Preconditions.checkState( thisState == State.USERNAME || thisState == State.PROCESSING_USERNAME, "Can only set uuid while state is username" );
|
||||||
|
// FlameCord - Allow custom uuids even if onlineMode is true
|
||||||
|
this.uniqueId = uuid;
|
||||||
|
}
|
||||||
--
|
--
|
||||||
2.32.0
|
2.32.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user