3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Fix: protocol being null during online mode login (#4369)

* fix: protocol being null during online mode login

* gimme more space

* add debug logging for too early downstream packet sending
Dieser Commit ist enthalten in:
chris 2023-12-31 02:24:44 +01:00 committet von GitHub
Ursprung 592a58a0c8
Commit 46bde0c019
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -1633,6 +1633,15 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
* @param intendedState the state the client should be in
*/
public void sendDownstreamPacket(Packet packet, ProtocolState intendedState) {
// protocol can be null when we're not yet logged in (online auth)
if (protocol == null) {
if (geyser.getConfig().isDebugMode()) {
geyser.getLogger().debug("Tried to send downstream packet with no downstream session!");
Thread.dumpStack();
}
return;
}
if (protocol.getState() != intendedState) {
geyser.getLogger().debug("Tried to send " + packet.getClass().getSimpleName() + " packet while not in " + intendedState.name() + " state");
return;