Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Restore configurable connection throttle.
Dieser Commit ist enthalten in:
Ursprung
e156354a60
Commit
dcf83bc1b5
@ -22,7 +22,9 @@ public class DedicatedServerConnectionThread extends Thread {
|
|||||||
private final InetAddress g;
|
private final InetAddress g;
|
||||||
private final int h;
|
private final int h;
|
||||||
|
|
||||||
public DedicatedServerConnectionThread(ServerConnection serverconnection, InetAddress inetaddress, int i) {
|
long connectionThrottle; // CraftBukkit
|
||||||
|
|
||||||
|
public DedicatedServerConnectionThread(ServerConnection serverconnection, InetAddress inetaddress, int i) throws IOException { // CraftBukkit - added throws
|
||||||
super("Listen thread");
|
super("Listen thread");
|
||||||
this.f = serverconnection;
|
this.f = serverconnection;
|
||||||
this.g = inetaddress;
|
this.g = inetaddress;
|
||||||
@ -62,8 +64,17 @@ public class DedicatedServerConnectionThread extends Thread {
|
|||||||
long i = System.currentTimeMillis();
|
long i = System.currentTimeMillis();
|
||||||
HashMap hashmap = this.c;
|
HashMap hashmap = this.c;
|
||||||
|
|
||||||
|
// CraftBukkit start
|
||||||
|
if (((MinecraftServer) this.f.d()).server == null) {
|
||||||
|
socket.close();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
connectionThrottle = ((MinecraftServer) this.f.d()).server.getConnectionThrottle();
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
synchronized (this.c) {
|
synchronized (this.c) {
|
||||||
if (this.c.containsKey(inetaddress) && !b(inetaddress) && i - ((Long) this.c.get(inetaddress)).longValue() < 4000L) {
|
if (this.c.containsKey(inetaddress) && !b(inetaddress) && i - ((Long) this.c.get(inetaddress)).longValue() < connectionThrottle) {
|
||||||
this.c.put(inetaddress, Long.valueOf(i));
|
this.c.put(inetaddress, Long.valueOf(i));
|
||||||
socket.close();
|
socket.close();
|
||||||
continue;
|
continue;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren