Only notify staff when a report count reaches a certain amount (3 for hacking, 1 for chat abuse).

This commit is contained in:
Keir 2015-11-13 01:27:34 +00:00
parent a6d3ba10c2
commit bf81c26874
2 changed files with 15 additions and 8 deletions

View File

@ -15,20 +15,22 @@ public enum ReportCategory
{
// descriptions borrowed from PunishPage
HACKING(0, Material.IRON_SWORD, C.cRedB + "Hacking", "X-ray, Forcefield, Speed, Fly etc"),
CHAT_ABUSE(1, Material.BOOK_AND_QUILL, C.cDBlueB + "Chat Abuse", "Verbal Abuse, Spam, Harassment, Trolling, etc");
HACKING(0, 3, Material.IRON_SWORD, C.cRedB + "Hacking", "X-ray, Forcefield, Speed, Fly etc"),
CHAT_ABUSE(1, 1, Material.BOOK_AND_QUILL, C.cDBlueB + "Chat Abuse", "Verbal Abuse, Spam, Harassment, Trolling, etc");
private int _id;
private int _notifyThreshold;
private Material _displayMaterial;
private String _title;
private List<String> _lore;
ReportCategory(int id, Material displayMaterial, String title, String... lore)
ReportCategory(int id, int notifyThreshold, Material displayMaterial, String title, String... lore)
{
this._id = id;
this._displayMaterial = displayMaterial;
this._title = title;
this._lore = new ArrayList<>();
_id = id;
_notifyThreshold = notifyThreshold;
_displayMaterial = displayMaterial;
_title = title;
_lore = new ArrayList<>();
// prefix are lore lines
for (String loreLine : lore) {
@ -41,6 +43,11 @@ public enum ReportCategory
return _id;
}
public int getNotifyThreshold()
{
return _notifyThreshold;
}
public Material getItemMaterial()
{
return _displayMaterial;

View File

@ -157,7 +157,7 @@ public class ReportManager {
_reportRepository.addElement(report); // add (or update) the report to Redis
// only start notifying staff when
if (report.getReporters().size() >= 1)
if (report.getReporters().size() >= category.getNotifyThreshold())
{
String prefix = getReportPrefix(reportId);