Removed extend drop task and variable methods.

This commit is contained in:
MobiusDevelopment 2020-05-21 14:41:49 +00:00
parent 68f1c57115
commit f522d6d247
30 changed files with 0 additions and 1050 deletions

View File

@ -61,7 +61,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailySkills();
resetRecommends();
resetWorldChatPoints();
@ -143,30 +142,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -62,7 +62,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
@ScheduleTarget
private void onReset()
{
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -139,30 +138,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Vitality resetted");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -62,7 +62,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
@ScheduleTarget
private void onReset()
{
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -139,30 +138,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Vitality resetted");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -62,7 +62,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
@ScheduleTarget
private void onReset()
{
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -139,30 +138,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Vitality resetted");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -62,7 +62,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
@ScheduleTarget
private void onReset()
{
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -139,30 +138,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Vitality resetted");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -242,48 +241,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -242,48 +241,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}

View File

@ -63,7 +63,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
private void onReset()
{
resetClanBonus();
resetExtendDrop();
resetDailyMissionRewards();
resetDailySkills();
resetRecommends();
@ -146,30 +145,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
LOGGER.info("Daily clan bonus has been resetted.");
}
private void resetExtendDrop()
{
// Update data for offline players.
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var = ?"))
{
ps.setString(1, PlayerVariables.EXTEND_DROP);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not reset extend drop : ", e);
}
// Update data for online players.
World.getInstance().getPlayers().stream().forEach(player ->
{
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
player.getVariables().storeMe();
});
LOGGER.info("Daily world chat points has been resetted.");
}
private void resetDailySkills()
{
try (Connection con = DatabaseFactory.getConnection())

View File

@ -59,7 +59,6 @@ public class PlayerVariables extends AbstractVariables
public static final String REVELATION_SKILL_2_MAIN_CLASS = "RevelationSkill2";
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
public static final String EXTEND_DROP = "EXTEND_DROP";
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
@ -241,48 +240,4 @@ public class PlayerVariables extends AbstractVariables
}
return rewards != null ? rewards : Collections.emptyList();
}
public void updateExtendDrop(int id, long count)
{
String result = "";
final String data = getString(EXTEND_DROP, "");
if (data.isEmpty())
{
result = id + "," + count;
}
else if (data.contains(";"))
{
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
s += ";" + drop[0] + "," + count;
continue;
}
result += ";" + s;
}
result = result.substring(1);
}
else
{
result = id + "," + count;
}
set(EXTEND_DROP, result);
}
public long getExtendDropCount(int id)
{
final String data = getString(EXTEND_DROP, "");
for (String s : data.split(";"))
{
final String[] drop = s.split(",");
if (drop[0].equals(Integer.toString(id)))
{
return Long.parseLong(drop[1]);
}
}
return 0;
}
}