mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-10 16:48:05 +02:00
Only write to UUIDMap if the entry doesn't exist.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user