Pass the offline/bungee uuid to PreLogin events (Closes #147)

This commit is contained in:
Thinkofdeath 2014-04-07 00:42:16 +01:00
parent ded44c47f0
commit 35048d22f5
12 changed files with 68 additions and 45 deletions

View File

@ -1,4 +1,4 @@
From 084fa4da5aa714cbec570c3268a26cd1545e2dd8 Mon Sep 17 00:00:00 2001
From 5dee6f66cd4e91d2c1c643ee16964351269f2f18 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 3 Dec 2013 11:07:48 +1100
Subject: [PATCH] Clear Flower Pot on Drop

View File

@ -1,4 +1,4 @@
From 02e581fff0d1daa9931f52c8ed644ecef8054f3a Mon Sep 17 00:00:00 2001
From 0ed66ccec3c2472717d49a37ebd8c22b1e57fc38 Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Mon, 2 Dec 2013 23:42:09 +0000
Subject: [PATCH] Fix some chunks not being sent to the client

View File

@ -1,4 +1,4 @@
From 7b361009b21908c445791bc650eef71dcd35e468 Mon Sep 17 00:00:00 2001
From 5743f6c6a8179d530e15ea8aa883ab42c7a3aa68 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 5 Dec 2013 13:55:53 +1100
Subject: [PATCH] Fix Broken Async Chat

View File

@ -1,11 +1,11 @@
From 015c23123158d752c654b696b44c42bb32cf514d Mon Sep 17 00:00:00 2001
From ef522cef52d46863be10da19322970154d9075ea Mon Sep 17 00:00:00 2001
From: ItsHarry <info@itsjerryandharry.com>
Date: Thu, 5 Dec 2013 21:58:11 +0100
Subject: [PATCH] Allow Teleportation of Vehicles and Passengers
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9bc708e..76e5643 100644
index 03d6d36..b14098a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -453,9 +453,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -1,11 +1,11 @@
From db1bb9c68c937ff426aa387951cea91ec97ba269 Mon Sep 17 00:00:00 2001
From f83fcc664288a21eba0fba320a098f6dd57575dc Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 8 Dec 2013 16:52:42 +1100
Subject: [PATCH] Remove OS X Special Chars from Signs
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 1ea7e4a..248d48e 100644
index 4c509b6..213183d 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1584,6 +1584,7 @@ public class PlayerConnection implements PacketPlayInListener {

View File

@ -1,4 +1,4 @@
From 149f988a0165f036934d7f0fd527404b5a53a224 Mon Sep 17 00:00:00 2001
From f9c86f4865d4330baea6630e32bbd41bd005ffa8 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 16 May 2013 18:51:05 +1000
Subject: [PATCH] Orebfuscator

View File

@ -1,4 +1,4 @@
From c05b40f1087cf9c762825ccf6c0e01e3d528bc9d Mon Sep 17 00:00:00 2001
From 59714a94a25306d1f88a85331f32a64d1875302d Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 11:45:47 +1100
Subject: [PATCH] Optimize DataWatcher

View File

@ -1,14 +1,40 @@
From d95c3ac45bb9a2ce9fbe9e241d64e8a1ea467a9a Mon Sep 17 00:00:00 2001
From 731f42f442109e046706fe7c92d9e71359eadc99 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 18 Dec 2013 13:32:10 +1100
Subject: [PATCH] Fire PreLogin Events in Offline Mode
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index efba029..6f35aa0 100644
index dddd9aa..0d82e7d 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -108,7 +108,7 @@ public class LoginListener implements PacketLoginInListener {
@@ -59,12 +59,25 @@ public class LoginListener implements PacketLoginInListener {
}
}
+ // Spigot start
+ public void initUUID()
+ {
+ String uuid = UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + this.i.getName() ).getBytes( Charsets.UTF_8 ) ).toString().replaceAll( "-", "" );
+
+ this.i = new GameProfile( uuid, this.i.getName() );
+ }
+ // Spigot end
+
public void c() {
+ // Spigot start - Moved to initUUID
+ /*
if (!this.i.isComplete()) {
UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + this.i.getName()).getBytes(Charsets.UTF_8));
this.i = new GameProfile(uuid.toString().replaceAll("-", ""), this.i.getName());
}
+ */
+ // Spigot end
// CraftBukkit start - fire PlayerLoginEvent
EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, this.hostname);
@@ -99,7 +112,7 @@ public class LoginListener implements PacketLoginInListener {
this.g = EnumProtocolState.KEY;
this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.J().getPublic(), this.e), new GenericFutureListener[0]);
} else {
@ -18,18 +44,20 @@ index efba029..6f35aa0 100644
}
diff --git a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java
index 496b7c9..766b8c7 100644
index 496b7c9..fe4502a 100644
--- a/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java
+++ b/src/main/java/net/minecraft/server/ThreadPlayerLookupUUID.java
@@ -22,48 +22,20 @@ class ThreadPlayerLookupUUID extends Thread {
@@ -22,48 +22,22 @@ class ThreadPlayerLookupUUID extends Thread {
public void run() {
try {
+ // Spigot Start
+ if ( !LoginListener.b( this.a ).getOnlineMode() )
+ {
+ a.initUUID();
+ fireLoginEvents();
+ LoginListener.a(this.a, EnumProtocolState.READY_TO_ACCEPT);
+ LoginListener.e().info( "UUID of player " + LoginListener.d( this.a ).getName() + " is " + LoginListener.d( this.a ).getId() );
+ LoginListener.a( this.a, EnumProtocolState.READY_TO_ACCEPT );
+ return;
+ }
+ // Spigot End
@ -81,7 +109,7 @@ index 496b7c9..766b8c7 100644
LoginListener.e().info("UUID of player " + LoginListener.d(this.a).getName() + " is " + LoginListener.d(this.a).getId());
LoginListener.a(this.a, EnumProtocolState.READY_TO_ACCEPT);
} else {
@@ -80,4 +52,45 @@ class ThreadPlayerLookupUUID extends Thread {
@@ -80,4 +54,45 @@ class ThreadPlayerLookupUUID extends Thread {
// CraftBukkit end
}
}

View File

@ -1,4 +1,4 @@
From 4eb238db3911500b14a76a47e87c382e47febb58 Mon Sep 17 00:00:00 2001
From c879accb1fd1f44194ec7161f5d212cc67455327 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 1 Dec 2013 18:18:41 +1100
Subject: [PATCH] BungeeCord Support
@ -33,31 +33,26 @@ index b80a760..42539b4 100644
}
break;
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index dddd9aa..efba029 100644
index 0d82e7d..07c1d4b 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -61,9 +61,18 @@ public class LoginListener implements PacketLoginInListener {
public void c() {
if (!this.i.isComplete()) {
- UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + this.i.getName()).getBytes(Charsets.UTF_8));
@@ -62,8 +62,14 @@ public class LoginListener implements PacketLoginInListener {
// Spigot start
public void initUUID()
{
- String uuid = UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + this.i.getName() ).getBytes( Charsets.UTF_8 ) ).toString().replaceAll( "-", "" );
-
- this.i = new GameProfile(uuid.toString().replaceAll("-", ""), this.i.getName());
+ // Spigot Start
+ String uuid;
+ if ( networkManager.spoofedUUID != null )
+ {
+ uuid = networkManager.spoofedUUID;
+ } else
+ {
+ uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + this.i.getName()).getBytes(Charsets.UTF_8)).toString().replaceAll("-", "");
+ uuid = UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + this.i.getName() ).getBytes( Charsets.UTF_8 ) ).toString().replaceAll("-", "");
+ }
+
+ this.i = new GameProfile(uuid, this.i.getName());
+ // Spigot End
this.i = new GameProfile( uuid, this.i.getName() );
}
// CraftBukkit start - fire PlayerLoginEvent
// Spigot end
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 9ff1694..f6cca80 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
@ -98,10 +93,10 @@ index 385dc0a..0d6ffef 100644
if (this.banByName.isBanned(gameprofile.getName())) {
BanEntry banentry = (BanEntry) this.banByName.getEntries().get(gameprofile.getName());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 03d6d36..9bc708e 100644
index b14098a..76e5643 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1282,6 +1282,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1289,6 +1289,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
{
@Override

View File

@ -1,4 +1,4 @@
From c06d0a4f26ee6c7790eca418f2a6127288c1ffcc Mon Sep 17 00:00:00 2001
From e23d0235ac494adf917bb40cc56e7fda781bdf1c Mon Sep 17 00:00:00 2001
From: Dylan Xaldin <Puremin0rez515@gmail.com>
Date: Thu, 12 Dec 2013 18:05:03 -0600
Subject: [PATCH] Allow Disabling Zombie Villager Aggression

View File

@ -1,4 +1,4 @@
From b00d4f7e51de301740148b6ce62e2630aa5dae50 Mon Sep 17 00:00:00 2001
From fb40c05e1cf4f7b22e803545d37b8ed56547ffdb Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 11:58:58 +1100
Subject: [PATCH] Configurable Amount of Netty Threads
@ -53,5 +53,5 @@ index 8bfffa5..b3278fd 100644
+ }
}
--
1.8.3.2
1.8.5.2.msysgit.0

View File

@ -1,4 +1,4 @@
From 93f9eba0f93d66a80285d823aea88e3ac1841237 Mon Sep 17 00:00:00 2001
From 73eb7c52c528f150fe3c3c601c2ec53b4cf1e10b Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 15:21:02 +1100
Subject: [PATCH] Prevent Mineshaft Saving