Add 1.9.1 support.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-03-16 16:49:50 +11:00
parent 4fbcead283
commit 19e357e11a
5 changed files with 71 additions and 11 deletions

View File

@@ -18,10 +18,17 @@
private final MinecraftServer a;
private final NetworkManager b;
@@ -16,6 +26,41 @@
@@ -11,12 +21,48 @@
}
public void a(PacketHandshakingInSetProtocol packethandshakinginsetprotocol) {
+ this.b.channel.pipeline().get(PacketEncoder.class).version = packethandshakinginsetprotocol.b(); // CraftBukkit
switch (HandshakeListener.SyntheticClass_1.a[packethandshakinginsetprotocol.a().ordinal()]) {
case 1:
this.b.setProtocol(EnumProtocol.LOGIN);
ChatComponentText chatcomponenttext;
- if (packethandshakinginsetprotocol.b() > 107) {
+ // CraftBukkit start - Connection throttle
+ try {
+ long currentTime = System.currentTimeMillis();
@@ -57,10 +64,11 @@
+ }
+ // CraftBukkit end
+
if (packethandshakinginsetprotocol.b() > 107) {
+ if (packethandshakinginsetprotocol.b() > 108) {
chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9");
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
@@ -26,6 +71,7 @@
this.b.close(chatcomponenttext);
@@ -26,6 +72,7 @@
this.b.close(chatcomponenttext);
} else {
this.b.setPacketListener(new LoginListener(this.a, this.b));