Fix fetching player report stats.

This commit is contained in:
Keir 2015-11-20 22:20:56 +00:00
parent ad16c59ab7
commit 435f2b643d

View File

@ -138,17 +138,9 @@ public class ReportManager {
public boolean canReport(Player player)
{
try {
PlayerStats playerStats = _statsManager.getOfflinePlayerStats(player.getName());
long abusiveReportsCount = playerStats.getStat(ReportResult.ABUSIVE.getStatName());
return abusiveReportsCount < ABUSE_BAN_THRESHOLD;
}
catch (SQLException e)
{
player.sendMessage(C.cRed + "Internal error.");
e.printStackTrace();
return false;
}
PlayerStats playerStats = _statsManager.Get(player.getName());
long abusiveReportsCount = playerStats.getStat(ReportResult.ABUSIVE.getStatName());
return abusiveReportsCount < ABUSE_BAN_THRESHOLD;
}
private void incrementTotalStat(String reporter)
@ -199,8 +191,8 @@ public class ReportManager {
// Report #2 > Reported by Chiss.
// Report #2 > 5 total reporter(s).
JsonMessage message = new JsonMessage(F.main(prefix, String.format("%s - %s (%s)",
C.cGoldB + report.getPlayerName() + C.mBody,
reason, C.cGoldB + report.getCategory().getTitle() + C.mBody))
C.cGoldB + report.getPlayerName() + C.mBody,
reason, C.cGoldB + report.getCategory().getTitle() + C.mBody))
+ "\n"
+ F.main(prefix, String.format("Reported by %s.", reporter.getName()))
+ "\n"