summaryrefslogtreecommitdiffstats
path: root/nms-patches/LoginListener.patch
blob: 67328635456a596404cc4c1a08be5feb15eac7b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- ../work/decompile-8eb82bde//net/minecraft/server/LoginListener.java	2014-11-28 17:43:43.249707432 +0000
+++ src/main/java/net/minecraft/server/LoginListener.java	2014-11-28 17:38:20.000000000 +0000
@@ -26,6 +26,7 @@
     private GameProfile i;
     private String j;
     private SecretKey loginKey;
+    public String hostname = ""; // CraftBukkit - add field
 
     public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
         this.g = EnumProtocolState.HELLO;
@@ -64,10 +65,12 @@
             this.i = this.a(this.i);
         }
 
-        String s = this.server.getPlayerList().attemptLogin(this.networkManager.getSocketAddress(), this.i);
+        // CraftBukkit start - fire PlayerLoginEvent
+        EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, hostname);
 
-        if (s != null) {
-            this.disconnect(s);
+        if (s == null) {
+            // this.disconnect(s);
+            // CraftBukkit end
         } else {
             this.g = EnumProtocolState.ACCEPTED;
             if (this.server.aI() >= 0 && !this.networkManager.c()) {
@@ -75,7 +78,7 @@
             }
 
             this.networkManager.handle(new PacketLoginOutSuccess(this.i));
-            this.server.getPlayerList().a(this.networkManager, this.server.getPlayerList().processLogin(this.i));
+            this.server.getPlayerList().a(this.networkManager, this.server.getPlayerList().processLogin(this.i, s)); // CraftBukkit - add player reference
         }
 
     }