3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 00:00:28 +01:00

Only print invalid custom payload channel warnings in debug mode (#4257)

We previously had people complaining about this being an error and not understanding what it means + servers can't do anything about these errors anyway.
Dieser Commit ist enthalten in:
EnZaXD 2024-11-10 21:45:06 +01:00 committet von GitHub
Ursprung ddbe8ef0fb
Commit 6553fc9ae9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -205,7 +205,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
String old = channel;
channel = getOldPluginChannelId(channel);
if (channel == null) {
if (!Via.getConfig().isSuppressConversionWarnings()) {
if (Via.getManager().isDebug()) {
protocol.getLogger().warning("Ignoring serverbound plugin message with channel: " + old);
}
wrapper.cancel();
@ -217,7 +217,7 @@ public class ItemPacketRewriter1_13 extends ItemRewriter<ClientboundPackets1_12_
String rewritten = getOldPluginChannelId(s);
if (rewritten != null) {
rewrittenChannels.add(rewritten);
} else if (!Via.getConfig().isSuppressConversionWarnings()) {
} else if (Via.getManager().isDebug()) {
protocol.getLogger().warning("Ignoring plugin channel in serverbound " + channel + ": " + s);
}
}

Datei anzeigen

@ -172,7 +172,7 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
final String channel = wrapper.get(Types.STRING, 0);
final String namespacedChannel = Key.namespaced(channel);
if (channel.length() > 32) {
if (!Via.getConfig().isSuppressConversionWarnings()) {
if (Via.getManager().isDebug()) {
getLogger().warning("Ignoring serverbound plugin channel, as it is longer than 32 characters: " + channel);
}
wrapper.cancel();
@ -181,7 +181,7 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol<ClientboundPackets1_1
List<String> checkedChannels = new ArrayList<>(channels.length);
for (String registeredChannel : channels) {
if (registeredChannel.length() > 32) {
if (!Via.getConfig().isSuppressConversionWarnings()) {
if (Via.getManager().isDebug()) {
getLogger().warning("Ignoring serverbound plugin channel register of '" + registeredChannel + "', as it is longer than 32 characters");
}
continue;