Minor OfflineTradersTable change.

This commit is contained in:
MobiusDev
2017-10-20 15:43:50 +00:00
parent d330ac8093
commit 7dd34b79a1
5 changed files with 100 additions and 100 deletions

View File

@@ -284,26 +284,6 @@ 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();
@@ -411,6 +391,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[removeTrader()]: Error while removing offline trader: " + traderObjId + " " + e, e);
}
}
/**
* Gets the single instance of OfflineTradersTable.
* @return single instance of OfflineTradersTable