Sync with L2jServer HighFive Jul 25th 2015.

This commit is contained in:
MobiusDev
2015-07-26 10:59:25 +00:00
parent 83854bc5e5
commit 1fc14085f5
161 changed files with 2288 additions and 2181 deletions

View File

@ -23,7 +23,7 @@ import java.sql.PreparedStatement;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
import com.l2jserver.gameserver.instancemanager.ClanHallAuctionManager;
@ -218,14 +218,14 @@ public final class AuctionableHall extends ClanHall
@Override
public final void updateDb()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("UPDATE clanhall SET ownerId=?, paidUntil=?, paid=? WHERE id=?"))
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clanhall SET ownerId=?, paidUntil=?, paid=? WHERE id=?"))
{
statement.setInt(1, getOwnerId());
statement.setLong(2, getPaidUntil());
statement.setInt(3, (getPaid()) ? 1 : 0);
statement.setInt(4, getId());
statement.execute();
ps.setInt(1, getOwnerId());
ps.setLong(2, getPaidUntil());
ps.setInt(3, (getPaid()) ? 1 : 0);
ps.setInt(4, getId());
ps.execute();
}
catch (Exception e)
{

View File

@ -30,7 +30,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
import com.l2jserver.gameserver.enums.ChatType;
@ -93,11 +93,11 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
public void loadAttackers()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement(SQL_LOAD_ATTACKERS))
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(SQL_LOAD_ATTACKERS))
{
statement.setInt(1, _hall.getId());
try (ResultSet rset = statement.executeQuery())
ps.setInt(1, _hall.getId());
try (ResultSet rset = ps.executeQuery())
{
while (rset.next())
{
@ -115,11 +115,11 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
public final void saveAttackers()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement delStatement = con.prepareStatement("DELETE FROM clanhall_siege_attackers WHERE clanhall_id = ?"))
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM clanhall_siege_attackers WHERE clanhall_id = ?"))
{
delStatement.setInt(1, _hall.getId());
delStatement.execute();
ps.setInt(1, _hall.getId());
ps.execute();
if (_attackers.size() > 0)
{
@ -147,11 +147,11 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
if (_guards == null)
{
_guards = new ArrayList<>();
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement(SQL_LOAD_GUARDS))
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(SQL_LOAD_GUARDS))
{
statement.setInt(1, _hall.getId());
try (ResultSet rset = statement.executeQuery())
ps.setInt(1, _hall.getId());
try (ResultSet rset = ps.executeQuery())
{
while (rset.next())
{

View File

@ -23,7 +23,7 @@ import java.sql.PreparedStatement;
import java.util.Calendar;
import java.util.logging.Level;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
import com.l2jserver.gameserver.enums.SiegeClanType;
import com.l2jserver.gameserver.model.L2Clan;
import com.l2jserver.gameserver.model.L2SiegeClan;
@ -132,13 +132,13 @@ public final class SiegableHall extends ClanHall
@Override
public final void updateDb()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement(SQL_SAVE))
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(SQL_SAVE))
{
statement.setInt(1, getOwnerId());
statement.setLong(2, getNextSiegeTime());
statement.setInt(3, getId());
statement.execute();
ps.setInt(1, getOwnerId());
ps.setLong(2, getNextSiegeTime());
ps.setInt(3, getId());
ps.execute();
}
catch (Exception e)
{