mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-13 19:52:03 +01:00
Only write to UUIDMap if the entry doesn't exist.
This commit is contained in:
parent
b6c0871daa
commit
b6d6b24796
@ -72,7 +72,11 @@ public class UUIDMap
|
||||
}
|
||||
else
|
||||
{
|
||||
history.get(uuid).add(name);
|
||||
final ArrayList<String> list = history.get(uuid);
|
||||
if (!list.contains(name))
|
||||
{
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -145,7 +149,7 @@ public class UUIDMap
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
synchronized (location)
|
||||
synchronized (pendingDiskWrites)
|
||||
{
|
||||
if (pendingDiskWrites.get() > 1)
|
||||
{
|
||||
|
@ -144,8 +144,12 @@ public class UserMap extends CacheLoader<UUID, User> implements IConf
|
||||
keys.add(uuid);
|
||||
if (name != null && name.length() > 0)
|
||||
{
|
||||
names.put(StringUtil.sanitizeFileName(name), uuid);
|
||||
uuidMap.writeUUIDMap();
|
||||
final String keyName = StringUtil.sanitizeFileName(name);
|
||||
if (!names.containsKey(keyName))
|
||||
{
|
||||
names.put(keyName, uuid);
|
||||
uuidMap.writeUUIDMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user