3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Downgrade severity of handling several incoming user input packet states

Dieser Commit ist enthalten in:
Shane Freeder 2024-01-21 11:47:14 +00:00
Ursprung 953ab6d8e7
Commit f6fbd25805
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C
2 geänderte Dateien mit 18 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -116,7 +116,7 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler {
@Override @Override
public boolean handle(PluginMessagePacket packet) { public boolean handle(PluginMessagePacket packet) {
VelocityServerConnection serverConn = player.getConnectionInFlight(); VelocityServerConnection serverConn = player.getConnectionInFlight();
if (serverConn != null) { if (serverConn != null) {L
if (PluginMessageUtil.isMcBrand(packet)) { if (PluginMessageUtil.isMcBrand(packet)) {
String brand = PluginMessageUtil.readBrandMessage(packet.content()); String brand = PluginMessageUtil.readBrandMessage(packet.content());
server.getEventManager().fireAndForget(new PlayerClientBrandEvent(player, brand)); server.getEventManager().fireAndForget(new PlayerClientBrandEvent(player, brand));

Datei anzeigen

@ -200,7 +200,10 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override @Override
public boolean handle(SessionPlayerCommandPacket packet) { public boolean handle(SessionPlayerCommandPacket packet) {
player.ensureAndGetCurrentServer(); if (player.getCurrentServer().isEmpty()) {
return true;
}
if (!updateTimeKeeper(packet.getTimeStamp())) { if (!updateTimeKeeper(packet.getTimeStamp())) {
return true; return true;
@ -215,7 +218,9 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override @Override
public boolean handle(SessionPlayerChatPacket packet) { public boolean handle(SessionPlayerChatPacket packet) {
player.ensureAndGetCurrentServer(); if (player.getCurrentServer().isEmpty()) {
return true;
}
if (!updateTimeKeeper(packet.getTimestamp())) { if (!updateTimeKeeper(packet.getTimestamp())) {
return true; return true;
@ -230,7 +235,9 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override @Override
public boolean handle(KeyedPlayerCommandPacket packet) { public boolean handle(KeyedPlayerCommandPacket packet) {
player.ensureAndGetCurrentServer(); if (player.getCurrentServer().isEmpty()) {
return true;
}
if (!updateTimeKeeper(packet.getTimestamp())) { if (!updateTimeKeeper(packet.getTimestamp())) {
return true; return true;
@ -245,7 +252,9 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override @Override
public boolean handle(KeyedPlayerChatPacket packet) { public boolean handle(KeyedPlayerChatPacket packet) {
player.ensureAndGetCurrentServer(); if (player.getCurrentServer().isEmpty()) {
return true;
}
if (!updateTimeKeeper(packet.getExpiry())) { if (!updateTimeKeeper(packet.getExpiry())) {
return true; return true;
@ -260,7 +269,10 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override @Override
public boolean handle(LegacyChatPacket packet) { public boolean handle(LegacyChatPacket packet) {
player.ensureAndGetCurrentServer(); if (player.getCurrentServer().isEmpty()) {
return true;
}
String msg = packet.getMessage(); String msg = packet.getMessage();
if (!validateChat(msg)) { if (!validateChat(msg)) {
return true; return true;