mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Changed how we remove PlayerProfiles to reduce lag
This commit is contained in:
parent
4acc0b63fd
commit
a372ca34e6
@ -23,6 +23,7 @@ Version 1.3.00-dev
|
||||
= Fixed memory leak with mob spawner tracking
|
||||
= Fixed /mcability not respecting permissions
|
||||
= Prettied up new config files
|
||||
! Changed mcMMO user information to be stored for 2 minutes after log out to reduce lag on rejoins
|
||||
! Changed the name of Unarmed Apprentice/Mastery to Iron Arm Style
|
||||
! Changed Unarmed to gain bonus damage every 50 skill levels, capping out at what Unarmed Mastery was before
|
||||
! Changed Tree Feller to take down entire trees
|
||||
|
@ -84,7 +84,8 @@ public class Users {
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
|
||||
if(PP != null)
|
||||
//Only remove PlayerProfile if user is offline
|
||||
if(!player.isOnline())
|
||||
{
|
||||
PP.save();
|
||||
if(players.containsKey(player))
|
||||
|
@ -169,7 +169,7 @@ public class mcPlayerListener implements Listener
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerQuit(PlayerQuitEvent event)
|
||||
public void onPlayerQuit(final PlayerQuitEvent event)
|
||||
{
|
||||
|
||||
/*
|
||||
@ -192,8 +192,14 @@ public class mcPlayerListener implements Listener
|
||||
//Save PlayerData to MySQL/FlatFile on player quit
|
||||
Users.getProfile(player).save();
|
||||
|
||||
//Remove PlayerProfile
|
||||
Users.removeUser(event.getPlayer());
|
||||
//Schedule PlayerProfile removal 2 minutes after quitting
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin,
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
//Remove PlayerProfile
|
||||
Users.removeUser(event.getPlayer());
|
||||
}
|
||||
}, 2400);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
|
Loading…
Reference in New Issue
Block a user