mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Don't look up offline players by name
This commit is contained in:
parent
e9a020565f
commit
cc1b511c02
@ -197,7 +197,8 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
|
|||||||
|
|
||||||
while ((line = in.readLine()) != null) {
|
while ((line = in.readLine()) != null) {
|
||||||
String[] character = line.split(":");
|
String[] character = line.split(":");
|
||||||
String name = character[USERNAME_INDEX];
|
String uuidString = character[UUID_INDEX];
|
||||||
|
UUID uuid = UUID.fromString(uuidString);
|
||||||
long lastPlayed = 0;
|
long lastPlayed = 0;
|
||||||
boolean rewrite = false;
|
boolean rewrite = false;
|
||||||
|
|
||||||
@ -208,7 +209,7 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (lastPlayed == -1) {
|
if (lastPlayed == -1) {
|
||||||
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(name);
|
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(uuid);
|
||||||
|
|
||||||
if(player.getLastPlayed() != 0) {
|
if(player.getLastPlayed() != 0) {
|
||||||
lastPlayed = player.getLastPlayed();
|
lastPlayed = player.getLastPlayed();
|
||||||
@ -216,7 +217,7 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastPlayed != -1 && lastPlayed != 0 && currentTime - lastPlayed > purgeTime) {
|
if (lastPlayed < 1 && (currentTime - lastPlayed > purgeTime)) {
|
||||||
removedPlayers++;
|
removedPlayers++;
|
||||||
} else {
|
} else {
|
||||||
if (rewrite) {
|
if (rewrite) {
|
||||||
|
Loading…
Reference in New Issue
Block a user