Support for item daily reuse reset.
This commit is contained in:
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -58,6 +61,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -111,6 +118,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -235,13 +243,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,9 +259,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -58,6 +61,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -111,6 +118,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -235,13 +243,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,9 +259,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -30,14 +30,17 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -56,6 +59,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -110,6 +117,7 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -227,13 +235,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,9 +251,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -30,14 +30,17 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -56,6 +59,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -110,6 +117,7 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -227,13 +235,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,9 +251,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -30,14 +30,17 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -56,6 +59,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -110,6 +117,7 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -227,13 +235,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,9 +251,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -30,6 +30,7 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.clan.Clan;
|
|||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -58,6 +61,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -113,6 +120,7 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -231,13 +239,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,9 +255,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -40,8 +41,10 @@ import org.l2jmobius.gameserver.model.clan.Clan;
|
|||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -60,6 +63,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -115,6 +122,7 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -235,13 +243,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,9 +259,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -40,8 +41,10 @@ import org.l2jmobius.gameserver.model.clan.Clan;
|
|||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -60,6 +63,11 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
60011, // Festival Fairy's Good Luck Bag
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -115,6 +123,7 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -235,13 +244,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,9 +260,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -33,6 +33,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -42,8 +43,10 @@ import org.l2jmobius.gameserver.model.clan.ClanMember;
|
|||||||
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -62,6 +65,11 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
60011, // Festival Fairy's Good Luck Bag
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -118,6 +126,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetAttendanceRewards();
|
resetAttendanceRewards();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetDailyLimitShopData();
|
resetDailyLimitShopData();
|
||||||
resetHomunculusResetPoints();
|
resetHomunculusResetPoints();
|
||||||
@@ -238,13 +247,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,9 +263,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -33,6 +33,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -42,8 +43,10 @@ import org.l2jmobius.gameserver.model.clan.ClanMember;
|
|||||||
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -62,6 +65,11 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
47387, // Balthus Knights Supply Items
|
||||||
|
60011, // Festival Fairy's Good Luck Bag
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -118,6 +126,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetAttendanceRewards();
|
resetAttendanceRewards();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetDailyLimitShopData();
|
resetDailyLimitShopData();
|
||||||
resetHomunculusResetPoints();
|
resetHomunculusResetPoints();
|
||||||
@@ -238,13 +247,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,9 +263,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -59,6 +62,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -112,6 +119,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -237,13 +245,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,9 +261,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -59,6 +62,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -112,6 +119,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -237,13 +245,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,9 +261,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -59,6 +62,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -112,6 +119,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -237,13 +245,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,9 +261,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -59,6 +62,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -112,6 +119,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -237,13 +245,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,9 +261,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -59,6 +62,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -112,6 +119,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -237,13 +245,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,9 +261,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -40,8 +41,10 @@ import org.l2jmobius.gameserver.model.clan.Clan;
|
|||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -61,6 +64,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -115,6 +122,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -241,13 +249,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -256,9 +265,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -31,6 +31,7 @@ import org.l2jmobius.commons.util.Chronos;
|
|||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -38,8 +39,10 @@ import org.l2jmobius.gameserver.model.actor.stat.PlayerStat;
|
|||||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||||
@@ -58,6 +61,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -111,6 +118,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetRecommends();
|
resetRecommends();
|
||||||
@@ -235,13 +243,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,9 +259,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
|
|||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -42,8 +43,10 @@ import org.l2jmobius.gameserver.model.clan.ClanMember;
|
|||||||
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -63,6 +66,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -118,6 +125,7 @@ public class DailyTaskManager
|
|||||||
// Daily tasks.
|
// Daily tasks.
|
||||||
resetClanBonus();
|
resetClanBonus();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetDailyLimitShopData();
|
resetDailyLimitShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
@@ -253,13 +261,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -268,9 +277,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetWorldChatPoints()
|
private void resetWorldChatPoints()
|
||||||
{
|
{
|
||||||
if (!Config.ENABLE_WORLD_CHAT)
|
if (!Config.ENABLE_WORLD_CHAT)
|
||||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
|
|||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -42,8 +43,10 @@ import org.l2jmobius.gameserver.model.clan.ClanMember;
|
|||||||
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -63,6 +66,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -120,6 +127,7 @@ public class DailyTaskManager
|
|||||||
resetClanContributionList();
|
resetClanContributionList();
|
||||||
resetClanDonationPoints();
|
resetClanDonationPoints();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetDailyLimitShopData();
|
resetDailyLimitShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
@@ -263,13 +271,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,9 +287,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetClanDonationPoints()
|
private void resetClanDonationPoints()
|
||||||
{
|
{
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
|
|||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -42,8 +43,10 @@ import org.l2jmobius.gameserver.model.clan.ClanMember;
|
|||||||
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -63,6 +66,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -121,6 +128,7 @@ public class DailyTaskManager
|
|||||||
resetClanDonationPoints();
|
resetClanDonationPoints();
|
||||||
resetDailyHennaPattern();
|
resetDailyHennaPattern();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetDailyLimitShopData();
|
resetDailyLimitShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
@@ -264,13 +272,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,9 +288,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetClanDonationPoints()
|
private void resetClanDonationPoints()
|
||||||
{
|
{
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
|
|||||||
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
import org.l2jmobius.gameserver.data.xml.DailyMissionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||||
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
import org.l2jmobius.gameserver.data.xml.PrimeShopData;
|
||||||
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@@ -42,8 +43,10 @@ import org.l2jmobius.gameserver.model.clan.ClanMember;
|
|||||||
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
import org.l2jmobius.gameserver.model.holders.SubClassHolder;
|
||||||
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
|
||||||
|
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||||
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
|
||||||
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.vip.VipManager;
|
import org.l2jmobius.gameserver.model.vip.VipManager;
|
||||||
@@ -63,6 +66,10 @@ public class DailyTaskManager
|
|||||||
2510, // Wondrous Cubic
|
2510, // Wondrous Cubic
|
||||||
22180, // Wondrous Cubic - 1 time use
|
22180, // Wondrous Cubic - 1 time use
|
||||||
};
|
};
|
||||||
|
private static final int[] RESET_ITEMS =
|
||||||
|
{
|
||||||
|
49782, // Balthus Knights' Supply Box
|
||||||
|
};
|
||||||
|
|
||||||
protected DailyTaskManager()
|
protected DailyTaskManager()
|
||||||
{
|
{
|
||||||
@@ -121,6 +128,7 @@ public class DailyTaskManager
|
|||||||
resetClanDonationPoints();
|
resetClanDonationPoints();
|
||||||
resetDailyHennaPattern();
|
resetDailyHennaPattern();
|
||||||
resetDailySkills();
|
resetDailySkills();
|
||||||
|
resetDailyItems();
|
||||||
resetDailyPrimeShopData();
|
resetDailyPrimeShopData();
|
||||||
resetDailyLimitShopData();
|
resetDailyLimitShopData();
|
||||||
resetWorldChatPoints();
|
resetWorldChatPoints();
|
||||||
@@ -264,13 +272,14 @@ public class DailyTaskManager
|
|||||||
|
|
||||||
private void resetDailySkills()
|
private void resetDailySkills()
|
||||||
{
|
{
|
||||||
|
// Update data for offline players.
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
{
|
{
|
||||||
for (int skill : RESET_SKILLS)
|
for (int skillId : RESET_SKILLS)
|
||||||
{
|
{
|
||||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_skills_save WHERE skill_id=?;"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, skill);
|
ps.setInt(1, skillId);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,9 +288,73 @@ public class DailyTaskManager
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
LOGGER.log(Level.SEVERE, "Could not reset daily skill reuse: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
// final Set<Player> updates = new HashSet<>();
|
||||||
|
for (int skillId : RESET_SKILLS)
|
||||||
|
{
|
||||||
|
final Skill skill = SkillData.getInstance().getSkill(skillId, 1 /* No known need for more levels */);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
if (player.hasSkillReuse(skill.getReuseHashCode()))
|
||||||
|
{
|
||||||
|
player.removeTimeStamp(skill);
|
||||||
|
// updates.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (Player player : updates)
|
||||||
|
// {
|
||||||
|
// player.sendSkillList();
|
||||||
|
// }
|
||||||
|
|
||||||
LOGGER.info("Daily skill reuse cleaned.");
|
LOGGER.info("Daily skill reuse cleaned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetDailyItems()
|
||||||
|
{
|
||||||
|
// Update data for offline players.
|
||||||
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
{
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_item_reuse_save WHERE itemId=?;"))
|
||||||
|
{
|
||||||
|
ps.setInt(1, itemId);
|
||||||
|
ps.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, "Could not reset daily item reuse: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update data for online players.
|
||||||
|
boolean update;
|
||||||
|
for (Player player : World.getInstance().getPlayers())
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
for (int itemId : RESET_ITEMS)
|
||||||
|
{
|
||||||
|
for (Item item : player.getInventory().getAllItemsByItemId(itemId))
|
||||||
|
{
|
||||||
|
player.getItemReuseTimeStamps().remove(item.getObjectId());
|
||||||
|
update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (update)
|
||||||
|
{
|
||||||
|
player.sendItemList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("Daily item reuse cleaned.");
|
||||||
|
}
|
||||||
|
|
||||||
private void resetClanDonationPoints()
|
private void resetClanDonationPoints()
|
||||||
{
|
{
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
try (Connection con = DatabaseFactory.getConnection())
|
||||||
|
Reference in New Issue
Block a user