Store recommendation values without tapping into Nevit Hourglass task.

This commit is contained in:
MobiusDevelopment
2019-11-15 14:59:59 +00:00
parent d4949dc40e
commit 3a7f20ca39
3 changed files with 21 additions and 2 deletions

View File

@@ -337,7 +337,7 @@ public class AdminEditChar implements IAdminCommandHandler
activeChar.sendMessage(player.getName() + "'s Recommend changed to " + recVal);
// Store player recommendations to avoid reseting them with Nevit peace zone check.
player.storeRecommendations(false);
player.storeRecommendationValues();
}
else
{

View File

@@ -14053,6 +14053,25 @@ public class PlayerInstance extends Playable
}
}
/**
* Store recommendation values without tapping into Nevit Hourglass task.
*/
public void storeRecommendationValues()
{
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("REPLACE INTO character_reco_bonus (charId,rec_have,rec_left) VALUES (?,?,?)"))
{
ps.setInt(1, getObjectId());
ps.setInt(2, _recomHave);
ps.setInt(3, _recomLeft);
ps.execute();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Could not update Recommendations for player: " + getObjectId(), e);
}
}
public void checkRecoBonusTask()
{
// Create bonus task

View File

@@ -109,6 +109,6 @@ public class RequestVoteNew implements IClientIncomingPacket
}
// Store player recommendations to avoid reseting them with Nevit peace zone check.
target.storeRecommendations(false);
target.storeRecommendationValues();
}
}