Finish using the UUID, we are still using blocking methods.

I want to get fully away from blocking methods and instead make the
user/player/prisoner/whatever wait to get an answer while we retrieve
the uuid information asynchronously.
This commit is contained in:
graywolf336
2014-04-29 13:20:33 -05:00
parent ad9c70cbbf
commit 4d4f609b82
23 changed files with 118 additions and 69 deletions

View File

@ -334,11 +334,10 @@ public class Jail {
*
* @param name The name of the prisoner to get.
* @return the prisoner instance, can be null
* @deprecated Use {@link #getPrisoner(UUID)}
*/
public Prisoner getPrisoner(String name) {
public Prisoner getPrisonerByLastKnownName(String name) {
for(Prisoner p : this.getAllPrisoners())
if(p.getName().equalsIgnoreCase(name))
if(p.getLastKnownName().equalsIgnoreCase(name))
return p;
return null;

View File

@ -53,8 +53,14 @@ public class Prisoner {
return UUID.fromString(this.uuid);
}
/** Gets the name of this player. */
public String getName() {
/** Gets the name of this prisoner. */
public String getLastKnownName() {
return this.name;
}
/** Sets the name of this prisoner. */
public String setLastKnownName(String username) {
this.name = username;
return this.name;
}