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

@ -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();