Update PaperSpigot to Minecraft 1.8
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 19 Oct 2014 16:01:51 -0500
|
||||
Date: Fri, 28 Nov 2014 13:12:00 -0600
|
||||
Subject: [PATCH] Improve Network Manager packet handling
|
||||
|
||||
Removes an unnecessary "peek at head of queue", and also makes the number of packets
|
||||
processed per player per tick configurable, so larger servers can slow down incoming processing.
|
||||
Removes an unnecessary "peek at head of queue"
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
@@ -12,46 +11,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler {
|
||||
|
||||
private void i() {
|
||||
if (this.m != null && this.m.isOpen()) {
|
||||
- while (!this.l.isEmpty()) {
|
||||
- QueuedPacket queuedpacket = (QueuedPacket) this.l.poll();
|
||||
private void m() {
|
||||
if (this.i != null && this.i.isOpen()) {
|
||||
- while (!this.h.isEmpty()) {
|
||||
- QueuedPacket queuedpacket = (QueuedPacket) this.h.poll();
|
||||
-
|
||||
+ // PaperSpigot start - Improve Network Manager packet handling
|
||||
+ QueuedPacket queuedpacket;
|
||||
+ while ((queuedpacket = (QueuedPacket) this.l.poll()) != null) {
|
||||
this.b(QueuedPacket.a(queuedpacket), QueuedPacket.b(queuedpacket));
|
||||
}
|
||||
+ // PaperSpigot end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler {
|
||||
}
|
||||
|
||||
if (this.o != null) {
|
||||
- for (int i = 1000; !this.k.isEmpty() && i >= 0; --i) {
|
||||
- Packet packet = (Packet) this.k.poll();
|
||||
+ // PaperSpigot start - Improve Network Manager packet handling - Configurable packets per player per tick processing
|
||||
+ Packet packet;
|
||||
+ for (int i = org.github.paperspigot.PaperSpigotConfig.maxPacketsPerPlayer; (packet = (Packet) this.k.poll()) != null && i >= 0; --i) {
|
||||
+ while ((queuedpacket = (QueuedPacket) this.h.poll()) != null) {
|
||||
+ // PaperSpigot end
|
||||
this.a(QueuedPacket.a(queuedpacket), QueuedPacket.b(queuedpacket));
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
if (!this.isConnected() || !this.m.config().isAutoRead()) {
|
||||
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
||||
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperSpigotConfig
|
||||
strengthEffectModifier = getDouble( "effect-modifiers.strength", 1.3D );
|
||||
weaknessEffectModifier = getDouble( "effect-modifiers.weakness", -0.5D );
|
||||
}
|
||||
+
|
||||
+ public static int maxPacketsPerPlayer;
|
||||
+ private static void maxPacketsPerPlayer()
|
||||
+ {
|
||||
+ maxPacketsPerPlayer = getInt( "max-packets-per-player", 1000 );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user