summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorRigby <rigby@onarandombox.com>2011-09-16 08:52:36 +0100
committerEvilSeph <evilseph@gmail.com>2011-09-16 06:02:06 -0400
commit456ce5171101bef331dc8c0f594e345288713dae (patch)
tree2fbcea0851740002d7b10c1621f62d8177ff3fa9 /src/main/java
parent76493f9c76cbae03e75832719381304657a2341a (diff)
downloadcraftbukkit-456ce5171101bef331dc8c0f594e345288713dae.tar
craftbukkit-456ce5171101bef331dc8c0f594e345288713dae.tar.gz
craftbukkit-456ce5171101bef331dc8c0f594e345288713dae.tar.lz
craftbukkit-456ce5171101bef331dc8c0f594e345288713dae.tar.xz
craftbukkit-456ce5171101bef331dc8c0f594e345288713dae.zip
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.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/NetLoginHandler.java8
-rw-r--r--src/main/java/net/minecraft/server/ServerConfigurationManager.java5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java
index 305d7caa..59ce9327 100644
--- a/src/main/java/net/minecraft/server/NetLoginHandler.java
+++ b/src/main/java/net/minecraft/server/NetLoginHandler.java
@@ -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));
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
index a361b7a3..e9bf8e05 100644
--- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java
+++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
@@ -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));