diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-09-18 13:11:17 +0200 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-09-18 13:11:17 +0200 |
commit | a4355d4bd955ff37d18a72a48102ad5c2a047af7 (patch) | |
tree | 556c42c36778adc619925297ff400492600892fc /src/main/java/net/minecraft/server | |
parent | af6ba0f026bd7b3588a77c246fa2e54785b57d19 (diff) | |
download | craftbukkit-a4355d4bd955ff37d18a72a48102ad5c2a047af7.tar craftbukkit-a4355d4bd955ff37d18a72a48102ad5c2a047af7.tar.gz craftbukkit-a4355d4bd955ff37d18a72a48102ad5c2a047af7.tar.lz craftbukkit-a4355d4bd955ff37d18a72a48102ad5c2a047af7.tar.xz craftbukkit-a4355d4bd955ff37d18a72a48102ad5c2a047af7.zip |
Remove pingpacket updating completely for now -- this needs a better fix, the default original implementation has a hug bug
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManager.java | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index 5acded3e..88c954ec 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -47,13 +47,11 @@ public class ServerConfigurationManager { // CraftBukkit start private CraftServer cserver; - private final int MAX_PACKETS_PER_TICK; public ServerConfigurationManager(MinecraftServer minecraftserver) { minecraftserver.server = new CraftServer(minecraftserver, this); minecraftserver.console = new ColouredConsoleSender(minecraftserver.server); this.cserver = minecraftserver.server; - this.MAX_PACKETS_PER_TICK = minecraftserver.server.getPingPacketLimit(); // CraftBukkit end this.server = minecraftserver; @@ -317,30 +315,23 @@ public class ServerConfigurationManager { // CraftBukkit end } - // CraftBukkit start - Limit/throttle latency packets public void b() { - int playerCount = this.players.size(); - if ((MAX_PACKETS_PER_TICK > 0) && (playerCount > 0)) { - int fromIndex, toIndex; + int i; - int playerListSize = playerCount > 126 ? 126 : playerCount; - int totalPacketCount = playerCount * playerListSize; - int packetsToSend = totalPacketCount < MAX_PACKETS_PER_TICK ? totalPacketCount : MAX_PACKETS_PER_TICK; + /* CraftBukkit start -- remove updating of lag to players -- it spams way to much on big servers. + if (this.p-- <= 0) { + for (i = 0; i < this.players.size(); ++i) { + EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); - int lastIndex = (this.server.ticks * packetsToSend) % totalPacketCount; - - for (int i = lastIndex; i < lastIndex + packetsToSend; i++) { - toIndex = i % playerCount; - fromIndex = (i % totalPacketCount) / playerCount; - - ((EntityPlayer) this.players.get(toIndex)).netServerHandler.sendPacket(new Packet201PlayerInfo(((EntityPlayer) this.players.get(fromIndex)).name, true, ((EntityPlayer) this.players.get(fromIndex)).i)); + this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.i)); } + this.p = 200; // <-- this resetting of flushtime is missing! though whole code is commented out now :) } - for (int j = 0; j < this.server.worlds.size(); ++j) { - this.server.worlds.get(j).manager.flush(); + for (i = 0; i < this.server.worlds.size(); ++i) { + this.server.worlds.get(i).manager.flush(); + // CraftBukkit end } - // CraftBukkit end } public void flagDirty(int i, int j, int k, int l) { |