3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-17 05:20:05 +01:00

More latency handling fixes.

Fixed Clientside rendering issues of the PlayerInfo window if max players > 126.
Limited PlayerInfo packets to 126 at a time as it cannot render anymore than 126.
Dieser Commit ist enthalten in:
Rigby 2011-09-16 08:52:36 +01:00 committet von EvilSeph
Ursprung 76493f9c76
Commit 456ce51711
2 geänderte Dateien mit 12 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -101,7 +101,13 @@ public class NetLoginHandler extends NetHandler {
byte b1 = (byte) worldserver.spawnMonsters;
worldserver.getClass();
Packet1Login packet1login1 = new Packet1Login("", i, j, k, b0, b1, (byte) -128, (byte) this.server.serverConfigurationManager.h());
// CraftBukkit start -- Don't send a higher than 126 MaxPlayer size, otherwise the PlayerInfo window won't render correctly.
int maxPlayers = this.server.serverConfigurationManager.h();
if (maxPlayers > 126) {
maxPlayers = 126;
}
Packet1Login packet1login1 = new Packet1Login("", i, j, k, b0, b1, (byte) -128, (byte) maxPlayers);
// CraftBukkit end
netserverhandler.sendPacket(packet1login1);
netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z));

Datei anzeigen

@ -320,6 +320,11 @@ public class ServerConfigurationManager {
if (this.p-- <= 0) {
for (i = 0; i < this.players.size(); ++i) {
// CraftBukkit start -- Client cannot render anymore than 126 Players so there's no point sending anymore packets.
if (i > 126) {
break;
}
// CraftBukkit end
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.i));