Attendance rewards can be shared by account.
Contributed by nasseka.
This commit is contained in:
@@ -261,6 +261,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -285,6 +312,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -261,6 +261,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -285,6 +312,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -261,6 +261,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -285,6 +312,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -254,6 +254,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -278,6 +305,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -254,6 +254,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -278,6 +305,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -254,6 +254,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -278,6 +305,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -327,6 +327,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -351,6 +378,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -441,6 +441,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -465,6 +492,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -441,6 +441,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -465,6 +492,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -282,6 +282,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -306,6 +333,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -282,6 +282,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -306,6 +333,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -282,6 +282,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -306,6 +333,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -282,6 +282,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -306,6 +333,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -282,6 +282,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -306,6 +333,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -355,6 +355,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -379,6 +406,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -261,6 +261,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -285,6 +312,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -425,6 +425,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -449,6 +476,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
@@ -456,6 +456,33 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onResetAttendanceRewards()
|
public void onResetAttendanceRewards()
|
||||||
|
{
|
||||||
|
if (Config.ATTENDANCE_REWARDS_SHARE_ACCOUNT)
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?"))
|
||||||
|
{
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update data for offline players.
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
@@ -480,6 +507,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
|
|
||||||
LOGGER.info("Attendance Rewards has been resetted.");
|
LOGGER.info("Attendance Rewards has been resetted.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DailyTaskManager getInstance()
|
public static DailyTaskManager getInstance()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user