Do not restore offline traders that have been kicked from the game.

This commit is contained in:
MobiusDev
2017-10-20 15:11:22 +00:00
parent e378f0041a
commit 1877846629
15 changed files with 155 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ package handlers.admincommandhandlers;
import java.util.StringTokenizer;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -43,6 +44,10 @@ public class AdminKick implements IAdminCommandHandler
final L2PcInstance plyr = L2World.getInstance().getPlayer(player);
if (plyr != null)
{
if (plyr.getOfflineStartTime() > 0)
{
OfflineTradersTable.removeTrader(plyr.getObjectId());
}
plyr.logout();
activeChar.sendMessage("You kicked " + plyr.getName() + " from the game.");
}
@@ -59,7 +64,7 @@ public class AdminKick implements IAdminCommandHandler
player.logout();
}
}
activeChar.sendMessage("Kicked " + counter + " players");
activeChar.sendMessage("Kicked " + counter + " players.");
}
return true;
}

View File

@@ -21,6 +21,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
@@ -171,6 +172,10 @@ public class AdminMenu implements IAdminCommandHandler
String text;
if (plyr != null)
{
if (plyr.getOfflineStartTime() > 0)
{
OfflineTradersTable.removeTrader(plyr.getObjectId());
}
plyr.logout();
text = "You kicked " + plyr.getName() + " from the game.";
}