Memory cleanup with all MiniPlugins.

Added Dragon.
Cleanup memory with Class Restore
This commit is contained in:
Jonathan Williams 2013-09-02 05:37:33 -07:00
parent 66131ad0b0
commit 59f2b9ebc8
3 changed files with 14 additions and 13 deletions

View File

@ -79,10 +79,10 @@ public class CoreClientManager implements Listener
synchronized (this)
{
if (_cacheList.containsKey(name.toLowerCase()))
if (_cacheList.containsKey(name))
{
newClient = _cacheList.get(name.toLowerCase()).getKey();
_cacheList.remove(name.toLowerCase());
newClient = _cacheList.get(name).getKey();
_cacheList.remove(name);
}
}
@ -95,7 +95,7 @@ public class CoreClientManager implements Listener
synchronized(_clientLock)
{
oldClient = _clientList.put(name.toLowerCase(), newClient);
oldClient = _clientList.put(name, newClient);
}
if (oldClient != null)
@ -113,7 +113,7 @@ public class CoreClientManager implements Listener
synchronized(_clientLock)
{
oldClient = _clientList.put(player.getName().toLowerCase(), newClient);
oldClient = _clientList.put(player.getName(), newClient);
}
if (oldClient != null)
@ -130,7 +130,7 @@ public class CoreClientManager implements Listener
synchronized(_clientLock)
{
removedClient = _clientList.remove(name.toLowerCase());
removedClient = _clientList.remove(name);
}
synchronized (this)
{
@ -142,7 +142,7 @@ public class CoreClientManager implements Listener
{
synchronized(_clientLock)
{
return _clientList.get(name.toLowerCase());
return _clientList.get(name);
}
}
@ -150,7 +150,7 @@ public class CoreClientManager implements Listener
{
synchronized(_clientLock)
{
return _clientList.get(player.getName().toLowerCase());
return _clientList.get(player.getName());
}
}
@ -222,19 +222,19 @@ public class CoreClientManager implements Listener
{
if (event.getReason().equalsIgnoreCase("You logged in from another location"))
{
_dontRemoveList.add(event.getPlayer().getName().toLowerCase());
_dontRemoveList.add(event.getPlayer().getName());
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void Quit(PlayerQuitEvent event)
{
if (!_dontRemoveList.contains(event.getPlayer().getName().toLowerCase()))
if (!_dontRemoveList.contains(event.getPlayer().getName()))
{
Del(event.getPlayer().getName().toLowerCase());
Del(event.getPlayer().getName());
}
_dontRemoveList.remove(event.getPlayer().getName().toLowerCase());
_dontRemoveList.remove(event.getPlayer().getName());
}
@EventHandler(priority = EventPriority.HIGHEST)

View File

@ -83,7 +83,7 @@ public class Dragon extends MiniPlugin
if (Dragon == null || !Dragon.isValid())
{
//Spawn();
Spawn();
return;
}

View File

@ -63,6 +63,7 @@ public class ClassRestore extends MiniPlugin
return;
WriteBuilds(event.getPlayer().getName());
_skills.remove(event.getPlayer().getName());
}
public Collection<ISkill> GetBuild(String name, IPvpClass gameClass)