3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-04 15:20:09 +01:00

Allow skin uploader to log messages instead of closing the connection

Dieser Commit ist enthalten in:
Tim203 2021-04-17 17:39:08 +02:00
Ursprung 404419df08
Commit 11b10e2857
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 064EE9F5BF7C3EE8
2 geänderte Dateien mit 19 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -30,7 +30,8 @@ public enum WebsocketEventType {
SUBSCRIBERS_COUNT,
ADDED_TO_QUEUE,
SKIN_UPLOADED,
CREATOR_DISCONNECTED;
CREATOR_DISCONNECTED,
LOG_MESSAGE;
public static final WebsocketEventType[] VALUES = values();

Datei anzeigen

@ -128,6 +128,23 @@ public final class FloodgateSkinUploader {
PluginMessageUtils.sendMessage(session, getSkinChannel(), bytes);
}
break;
case LOG_MESSAGE:
String logMessage = node.get("message").asText();
switch (node.get("priority").asInt()) {
case -1:
logger.debug("Got debug message from skin uploader: " + logMessage);
break;
case 0:
logger.info("Got info message from skin uploader: " +logMessage);
break;
case 1:
logger.error("Got error message from skin uploader: " + logMessage);
break;
default:
logger.info(logMessage);
break;
}
break;
}
} catch (Exception e) {
logger.error("Error while receiving a message", e);