Remove pingpacket updating completely for now -- this needs a better fix, the default original implementation has a hug bug
Dieser Commit ist enthalten in:
Ursprung
af6ba0f026
Commit
a4355d4bd9
@ -47,13 +47,11 @@ public class ServerConfigurationManager {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private CraftServer cserver;
|
private CraftServer cserver;
|
||||||
private final int MAX_PACKETS_PER_TICK;
|
|
||||||
|
|
||||||
public ServerConfigurationManager(MinecraftServer minecraftserver) {
|
public ServerConfigurationManager(MinecraftServer minecraftserver) {
|
||||||
minecraftserver.server = new CraftServer(minecraftserver, this);
|
minecraftserver.server = new CraftServer(minecraftserver, this);
|
||||||
minecraftserver.console = new ColouredConsoleSender(minecraftserver.server);
|
minecraftserver.console = new ColouredConsoleSender(minecraftserver.server);
|
||||||
this.cserver = minecraftserver.server;
|
this.cserver = minecraftserver.server;
|
||||||
this.MAX_PACKETS_PER_TICK = minecraftserver.server.getPingPacketLimit();
|
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.server = minecraftserver;
|
this.server = minecraftserver;
|
||||||
@ -317,31 +315,24 @@ public class ServerConfigurationManager {
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - Limit/throttle latency packets
|
|
||||||
public void b() {
|
public void b() {
|
||||||
int playerCount = this.players.size();
|
int i;
|
||||||
if ((MAX_PACKETS_PER_TICK > 0) && (playerCount > 0)) {
|
|
||||||
int fromIndex, toIndex;
|
|
||||||
|
|
||||||
int playerListSize = playerCount > 126 ? 126 : playerCount;
|
/* CraftBukkit start -- remove updating of lag to players -- it spams way to much on big servers.
|
||||||
int totalPacketCount = playerCount * playerListSize;
|
if (this.p-- <= 0) {
|
||||||
int packetsToSend = totalPacketCount < MAX_PACKETS_PER_TICK ? totalPacketCount : MAX_PACKETS_PER_TICK;
|
for (i = 0; i < this.players.size(); ++i) {
|
||||||
|
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
|
||||||
|
|
||||||
int lastIndex = (this.server.ticks * packetsToSend) % totalPacketCount;
|
this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.i));
|
||||||
|
|
||||||
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.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) {
|
for (i = 0; i < this.server.worlds.size(); ++i) {
|
||||||
this.server.worlds.get(j).manager.flush();
|
this.server.worlds.get(i).manager.flush();
|
||||||
}
|
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void flagDirty(int i, int j, int k, int l) {
|
public void flagDirty(int i, int j, int k, int l) {
|
||||||
this.getPlayerManager(l).flagDirty(i, j, k);
|
this.getPlayerManager(l).flagDirty(i, j, k);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren