Ejemplo n.º 1
0
  private void review(
      Player _reviewer, Player _reviewee, String _comment, double _min, double _change) {
    Reputation reviewerReputation = Kudos.get().getDatabaseManager().getReputation(_reviewer);
    Reputation revieweeReputation = Kudos.get().getDatabaseManager().getReputation(_reviewee);

    if (reviewerReputation.getScore() > _min) {
      revieweeReputation.review(_reviewer, _change, _comment);
    } else
      Kudos.get()
          .getCommunicationManager()
          .error(_reviewer, "You don't have enough reputation to do that.");
  }
Ejemplo n.º 2
0
  private void showHelp(Player _player) {
    PermissionManager pm = Kudos.get().getPermissionManager();
    CommunicationManager cm = Kudos.get().getCommunicationManager();

    if (pm.hasSetPermission(_player))
      cm.command(_player, "/kudos set <player> <rep> [msg]", "Override a player's reputation.");

    if (pm.hasReputationPermission(_player))
      cm.command(_player, "/kudos rep [player]", "Get a player's reputation.");

    if (pm.hasRankPermission(_player))
      cm.command(_player, "/kudos rank [player]", "Get a player's reputation ranking.");

    if (pm.hasTopPermission(_player))
      cm.command(_player, "/kudos top [num]", "Get the top [num] player's by reputation.");

    if (pm.hasLikePermission(_player))
      cm.command(_player, "/like <player> [msg]", "Positively influence a player's reputation.");

    if (pm.hasDislikePermission(_player))
      cm.command(_player, "/dislike <player> [msg]", "Negatively influence a player's reputation.");
  }
Ejemplo n.º 3
0
  private void neutralAction(Player _reviewer, Player _reviewee) {
    Reputation reputation = Kudos.get().getDatabaseManager().getReputation(_reviewee);

    reputation.removeReview(_reviewer);
  }
Ejemplo n.º 4
0
  private void dislikeAction(Player _reviewer, Player _reviewee, String _comment) {
    double min = Kudos.get().getConfigManager().getDislikeMinimumReputation();
    double change = -Kudos.get().getConfigManager().getDislikeReputationDecrease();

    review(_reviewer, _reviewee, _comment, min, change);
  }