summaryrefslogtreecommitdiffstats
path: root/nms-patches/LoginListener.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-05-30 21:25:59 +1000
committermd_5 <git@md-5.net>2017-05-30 21:55:13 +1000
commite13d1196863d5dcfea3d17b79238427dfb2c61b2 (patch)
tree56220ee8c2b98066fddfce1f7239a6f3e6261187 /nms-patches/LoginListener.patch
parentc155d8dd32556a197ab73c437760e6194ae4e04a (diff)
downloadcraftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar.gz
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar.lz
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar.xz
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.zip
Update to Minecraft 1.12-pre6
Diffstat (limited to 'nms-patches/LoginListener.patch')
-rw-r--r--nms-patches/LoginListener.patch37
1 files changed, 29 insertions, 8 deletions
diff --git a/nms-patches/LoginListener.patch b/nms-patches/LoginListener.patch
index 795b5424..789331f0 100644
--- a/nms-patches/LoginListener.patch
+++ b/nms-patches/LoginListener.patch
@@ -21,7 +21,28 @@
public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
this.g = LoginListener.EnumProtocolState.HELLO;
-@@ -82,10 +89,12 @@
+@@ -64,6 +71,20 @@
+
+ }
+
++ // CraftBukkit start
++ @Deprecated
++ public void disconnect(String s) {
++ try {
++ IChatBaseComponent ichatbasecomponent = new ChatComponentText(s);
++ LoginListener.c.info("Disconnecting {}: {}", this.c(), s);
++ this.networkManager.sendPacket(new PacketLoginOutDisconnect(ichatbasecomponent));
++ this.networkManager.close(ichatbasecomponent);
++ } catch (Exception exception) {
++ LoginListener.c.error("Error whilst disconnecting player", exception);
++ }
++ }
++ // CraftBukkit end
++
+ public void disconnect(IChatBaseComponent ichatbasecomponent) {
+ try {
+ LoginListener.c.info("Disconnecting {}: {}", this.c(), ichatbasecomponent.toPlainText());
+@@ -80,10 +101,12 @@
this.i = this.a(this.i);
}
@@ -30,14 +51,14 @@
+ EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, hostname);
- if (s != null) {
-- this.disconnect(s);
+- this.disconnect(new ChatMessage(s, new Object[0]));
+ if (s == null) {
-+ // this.disconnect(s);
++ // this.disconnect(new ChatMessage(s, new Object[0]));
+ // CraftBukkit end
} else {
this.g = LoginListener.EnumProtocolState.ACCEPTED;
if (this.server.aG() >= 0 && !this.networkManager.isLocal()) {
-@@ -94,7 +103,7 @@
+@@ -92,7 +115,7 @@
LoginListener.this.networkManager.setCompressionLevel(LoginListener.this.server.aG());
}
@@ -46,7 +67,7 @@
this.a((ChannelFuture) future);
}
}, new GenericFutureListener[0]);
-@@ -105,9 +114,9 @@
+@@ -103,9 +126,9 @@
if (entityplayer != null) {
this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT;
@@ -58,7 +79,7 @@
}
}
-@@ -152,6 +161,43 @@
+@@ -150,6 +173,43 @@
LoginListener.this.i = LoginListener.this.server.az().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a());
if (LoginListener.this.i != null) {
@@ -102,8 +123,8 @@
LoginListener.c.info("UUID of player {} is {}", LoginListener.this.i.getName(), LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else if (LoginListener.this.server.R()) {
-@@ -171,6 +217,11 @@
- LoginListener.this.disconnect("Authentication servers are down. Please try again later, sorry!");
+@@ -169,6 +229,11 @@
+ LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0]));
LoginListener.c.error("Couldn\'t verify username because servers are unavailable");
}
+ // CraftBukkit start - catch all exceptions