Do not restore offline traders that have been kicked from the game.
This commit is contained in:
parent
e378f0041a
commit
1877846629
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
@ -169,6 +170,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.";
|
||||
}
|
||||
|
@ -322,6 +322,26 @@ public class OfflineTradersTable
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void removeTrader(int traderObjId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);
|
||||
PreparedStatement stm2 = con.prepareStatement(CLEAR_OFFLINE_TABLE_PLAYER))
|
||||
{
|
||||
stm1.setInt(1, traderObjId);
|
||||
stm1.execute();
|
||||
stm1.close();
|
||||
|
||||
stm2.setInt(1, traderObjId);
|
||||
stm2.execute();
|
||||
stm2.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "OfflineTradersTable[onTransaction()]: Error while removing offline trader: " + traderObjId + " " + e, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void onTransaction(L2PcInstance trader, boolean finished, boolean firstCall)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
@ -169,6 +170,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.";
|
||||
}
|
||||
|
@ -322,6 +322,26 @@ public class OfflineTradersTable
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void removeTrader(int traderObjId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);
|
||||
PreparedStatement stm2 = con.prepareStatement(CLEAR_OFFLINE_TABLE_PLAYER))
|
||||
{
|
||||
stm1.setInt(1, traderObjId);
|
||||
stm1.execute();
|
||||
stm1.close();
|
||||
|
||||
stm2.setInt(1, traderObjId);
|
||||
stm2.execute();
|
||||
stm2.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "OfflineTradersTable[onTransaction()]: Error while removing offline trader: " + traderObjId + " " + e, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void onTransaction(L2PcInstance trader, boolean finished, boolean firstCall)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
@ -169,6 +170,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.";
|
||||
}
|
||||
|
@ -322,6 +322,26 @@ public class OfflineTradersTable
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void removeTrader(int traderObjId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);
|
||||
PreparedStatement stm2 = con.prepareStatement(CLEAR_OFFLINE_TABLE_PLAYER))
|
||||
{
|
||||
stm1.setInt(1, traderObjId);
|
||||
stm1.execute();
|
||||
stm1.close();
|
||||
|
||||
stm2.setInt(1, traderObjId);
|
||||
stm2.execute();
|
||||
stm2.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "OfflineTradersTable[onTransaction()]: Error while removing offline trader: " + traderObjId + " " + e, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void onTransaction(L2PcInstance trader, boolean finished, boolean firstCall)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.";
|
||||
}
|
||||
|
@ -284,6 +284,26 @@ public class OfflineTradersTable
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void removeTrader(int traderObjId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);
|
||||
PreparedStatement stm2 = con.prepareStatement(CLEAR_OFFLINE_TABLE_PLAYER))
|
||||
{
|
||||
stm1.setInt(1, traderObjId);
|
||||
stm1.execute();
|
||||
stm1.close();
|
||||
|
||||
stm2.setInt(1, traderObjId);
|
||||
stm2.execute();
|
||||
stm2.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "OfflineTradersTable[onTransaction()]: Error while removing offline trader: " + traderObjId + " " + e, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void onTransaction(L2PcInstance trader, boolean finished, boolean firstCall)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
@ -169,6 +170,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.";
|
||||
}
|
||||
|
@ -322,6 +322,26 @@ public class OfflineTradersTable
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void removeTrader(int traderObjId)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement stm1 = con.prepareStatement(CLEAR_OFFLINE_TABLE_ITEMS_PLAYER);
|
||||
PreparedStatement stm2 = con.prepareStatement(CLEAR_OFFLINE_TABLE_PLAYER))
|
||||
{
|
||||
stm1.setInt(1, traderObjId);
|
||||
stm1.execute();
|
||||
stm1.close();
|
||||
|
||||
stm2.setInt(1, traderObjId);
|
||||
stm2.execute();
|
||||
stm2.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "OfflineTradersTable[onTransaction()]: Error while removing offline trader: " + traderObjId + " " + e, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void onTransaction(L2PcInstance trader, boolean finished, boolean firstCall)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
|
Loading…
Reference in New Issue
Block a user