Attendance rewards can be shared by account.
Contributed by nasseka.
This commit is contained in:
@@ -262,28 +262,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -262,28 +262,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -262,28 +262,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -255,28 +255,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -255,28 +255,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -255,28 +255,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -328,28 +328,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -442,28 +442,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -442,28 +442,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -283,28 +283,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -283,28 +283,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -283,28 +283,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -283,28 +283,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -283,28 +283,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -356,28 +356,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -262,28 +262,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -426,28 +426,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
@@ -457,28 +457,56 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
ps.execute();
|
{
|
||||||
|
ps.setString(1, "ATTENDANCE_DATE");
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getAccountVariables().remove("ATTENDANCE_DATE");
|
||||||
|
player.getAccountVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Account shared Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?"))
|
||||||
|
{
|
||||||
|
ps.setString(1, PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Attendance Rewards: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
||||||
|
player.getVariables().storeMe();
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update data for online players.
|
|
||||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
|
||||||
{
|
|
||||||
player.getVariables().remove(PlayerVariables.ATTENDANCE_DATE);
|
|
||||||
player.getVariables().storeMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
|
Reference in New Issue
Block a user