public void removePenalty(Penalty penalty, Player player) { if (Penalty.BAN == penalty.getType()) { player.setBanInfo(null); } penalty.setActive(false); penaltyDAO.save(penalty); checkNoticeStatus(penalty, player); }
public void addPenalty(Penalty penalty, Player player) { if (Penalty.BAN == penalty.getType()) { player.setBanInfo(penalty.getCreated()); } penalty.setActive(true); penaltyDAO.save(penalty); checkNoticeStatus(penalty, player); }
public void checkNoticeStatus(Penalty penalty, Player player) { if (Penalty.NOTICE == penalty.getType()) { Penalty note = penaltyDAO.findLastActivePenalty(player.getKey(), Penalty.NOTICE); if (note == null) { player.setNote(null); } else { player.setNote(note.getCreated()); } } }