3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-27 08:30:12 +01:00

Don't send an awkward "null" when a exeption disconnect cause doesn't have a message (#4306)

* Don't send an awkward "null" when a cause doesn't have a message

* Fix accidental regression leading to unhandled "CraftingEventPackets"
Dieser Commit ist enthalten in:
chris 2023-11-22 22:03:24 +01:00 committet von GitHub
Ursprung 44174fdc04
Commit 119fbc86bc
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -115,6 +115,11 @@ public class LoggingPacketHandler implements BedrockPacketHandler {
return defaultHandler(packet); return defaultHandler(packet);
} }
@Override
public PacketSignal handle(CraftingEventPacket packet) {
return defaultHandler(packet);
}
@Override @Override
public PacketSignal handle(EntityEventPacket packet) { public PacketSignal handle(EntityEventPacket packet) {
return defaultHandler(packet); return defaultHandler(packet);

Datei anzeigen

@ -1039,7 +1039,11 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.disconnect", authData.name(), remoteServer.address(), disconnectMessage)); geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.remote.disconnect", authData.name(), remoteServer.address(), disconnectMessage));
} }
if (cause != null) { if (cause != null) {
GeyserImpl.getInstance().getLogger().error(cause.getMessage()); if (cause.getMessage() != null) {
GeyserImpl.getInstance().getLogger().error(cause.getMessage());
} else {
GeyserImpl.getInstance().getLogger().error("An exception occurred: ", cause);
}
// GeyserSession is disconnected via session.disconnect() called indirectly be the server // GeyserSession is disconnected via session.disconnect() called indirectly be the server
// This only needs to be "initiated" here when there is an exception, hence the cause clause // This only needs to be "initiated" here when there is an exception, hence the cause clause
GeyserSession.this.disconnect(disconnectMessage); GeyserSession.this.disconnect(disconnectMessage);