@@ -10,7 +10,7 @@
|
||||
+import org.bukkit.event.player.PlayerPreLoginEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
public class LoginListener implements PacketLoginInListener {
|
||||
|
||||
private static final AtomicInteger b = new AtomicInteger(0);
|
||||
@@ -32,6 +38,7 @@
|
||||
@@ -30,7 +30,7 @@
|
||||
+ public void disconnect(String s) {
|
||||
+ try {
|
||||
+ IChatBaseComponent ichatbasecomponent = new ChatComponentText(s);
|
||||
+ LoginListener.c.info("Disconnecting {}: {}", this.c(), s);
|
||||
+ LoginListener.c.info("Disconnecting {}: {}", this.d(), s);
|
||||
+ this.networkManager.sendPacket(new PacketLoginOutDisconnect(ichatbasecomponent));
|
||||
+ this.networkManager.close(ichatbasecomponent);
|
||||
+ } catch (Exception exception) {
|
||||
@@ -41,7 +41,7 @@
|
||||
+
|
||||
public void disconnect(IChatBaseComponent ichatbasecomponent) {
|
||||
try {
|
||||
LoginListener.c.info("Disconnecting {}: {}", this.c(), ichatbasecomponent.getString());
|
||||
LoginListener.c.info("Disconnecting {}: {}", this.d(), ichatbasecomponent.getString());
|
||||
@@ -76,10 +97,12 @@
|
||||
this.i = this.a(this.i);
|
||||
}
|
||||
@@ -57,7 +57,7 @@
|
||||
+ // CraftBukkit end
|
||||
} else {
|
||||
this.g = LoginListener.EnumProtocolState.ACCEPTED;
|
||||
if (this.server.aw() >= 0 && !this.networkManager.isLocal()) {
|
||||
if (this.server.ay() >= 0 && !this.networkManager.isLocal()) {
|
||||
@@ -93,9 +116,9 @@
|
||||
|
||||
if (entityplayer != null) {
|
||||
@@ -70,9 +70,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +163,43 @@
|
||||
@@ -143,6 +166,43 @@
|
||||
|
||||
LoginListener.this.i = LoginListener.this.server.ap().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a());
|
||||
LoginListener.this.i = LoginListener.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a());
|
||||
if (LoginListener.this.i != null) {
|
||||
+ // CraftBukkit start - fire PlayerPreLoginEvent
|
||||
+ if (!networkManager.isConnected()) {
|
||||
@@ -113,8 +113,8 @@
|
||||
+ // CraftBukkit end
|
||||
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.H()) {
|
||||
@@ -159,6 +219,11 @@
|
||||
} else if (LoginListener.this.server.isEmbeddedServer()) {
|
||||
@@ -162,6 +222,11 @@
|
||||
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0]));
|
||||
LoginListener.c.error("Couldn't verify username because servers are unavailable");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user