Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Relocate NaN check on PacketPlayInFlying.
Dieser Commit ist enthalten in:
Ursprung
6e6ad530e7
Commit
e4ba663d2a
@ -179,6 +179,13 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void a(PacketPlayInFlying packetplayinflying) {
|
public void a(PacketPlayInFlying packetplayinflying) {
|
||||||
|
// CraftBukkit start - Check for NaN
|
||||||
|
if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) {
|
||||||
|
c.warn(player.getName() + " was caught trying to crash the server with an invalid position.");
|
||||||
|
getPlayer().kickPlayer("Nope!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||||
|
|
||||||
this.g = true;
|
this.g = true;
|
||||||
@ -249,13 +256,6 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) {
|
|
||||||
player.teleport(player.getWorld().getSpawnLocation(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
|
|
||||||
System.err.println(player.getName() + " was caught trying to crash the server with an invalid position.");
|
|
||||||
player.kickPlayer("Nope!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.checkMovement && !this.player.dead) {
|
if (this.checkMovement && !this.player.dead) {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
double d1;
|
double d1;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren