Use new inactivity cleanup system

This commit is contained in:
Magnus Ulf Jørgensen
2017-05-19 08:47:42 +02:00
parent 9ed9ad4f82
commit b681ee01a4
9 changed files with 150 additions and 266 deletions

View File

@@ -3,9 +3,9 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.type.TypeMPlayer;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsRemovePlayerMillis;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.Progressbar;
import com.massivecraft.massivecore.event.EventMassiveCorePlayercleanToleranceMillis;
import com.massivecraft.massivecore.util.TimeDiffUtil;
import com.massivecraft.massivecore.util.TimeUnit;
import com.massivecraft.massivecore.util.Txt;
@@ -80,12 +80,12 @@ public class CmdFactionsPlayer extends FactionsCommand
msg("<a>Power per Death: <v>%.2f", mplayer.getPowerPerDeath());
// Display automatic kick / remove info if the system is in use
if (MConf.get().removePlayerMillisDefault <= 0) return;
if (MConf.get().playercleanToleranceMillis <= 0) return;
EventFactionsRemovePlayerMillis event = new EventFactionsRemovePlayerMillis(false, mplayer);
EventMassiveCorePlayercleanToleranceMillis event = new EventMassiveCorePlayercleanToleranceMillis(mplayer);
event.run();
msg("<i>Automatic removal after %s <i>of inactivity:", format(event.getMillis()));
for (Entry<String, Long> causeMillis : event.getCauseMillis().entrySet())
msg("<i>Automatic removal after %s <i>of inactivity:", format(event.getToleranceMillis()));
for (Entry<String, Long> causeMillis : event.getToleranceCauseMillis().entrySet())
{
String cause = causeMillis.getKey();
long millis = causeMillis.getValue();