Correction for dailyReset logic.
This commit is contained in:
parent
e5857a4f25
commit
3f5e226e66
@ -71,34 +71,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -71,34 +71,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -84,34 +84,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -84,34 +84,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -84,34 +84,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -84,34 +84,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -71,34 +71,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
@ -77,34 +77,26 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
public synchronized void reset()
|
||||
{
|
||||
if (_holder.dailyReset())
|
||||
if (!_holder.dailyReset())
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = ?"))
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM character_daily_rewards WHERE rewardId = ? AND status = 3"))
|
||||
{
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
ps.setInt(1, _holder.getId());
|
||||
ps.setInt(2, DailyMissionStatus.COMPLETED.getClientId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error while clearing data for: " + getClass().getSimpleName(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_entries.clear();
|
||||
}
|
||||
_entries.clear();
|
||||
}
|
||||
|
||||
public boolean requestReward(PlayerInstance player)
|
||||
|
Loading…
Reference in New Issue
Block a user