Beispiel #1
0
  @Override
  public void loop(Action currentAction) {

    currentAction.setActionTick(currentAction.getActionTick() - 1);

    if (currentAction.getActionTick() == 0) {

      currentAction.setActionTick(REPEAT_DELAY);

      for (Player p : PlayerManager.getSingleton().getPlayers()) {

        if (p == null) continue;

        Client client = (Client) p;

        if (client.specialAmount >= 100) continue;

        int extraAmount = 0;

        switch (client.privileges) {
          case 1:
            extraAmount = 5;
            break;
          case 2:
            extraAmount = 10;
            break;
          case 3:
            extraAmount = 15;
            break;
        }
        client.specialAmount += (10 + extraAmount);

        if (client.getSpecialAmount() > 100) client.setSpecialAmount(100);

        Specials.updateSpecialBar(client);
      }
    }
  }
Beispiel #2
0
 @Override
 public void execute(Client client, String command) {
   if (client.getPrivileges() >= 1) {
     if (command.length() > 7) {
       String name = command.substring(7);
       try {
         Connection con = Mysql.getConnection();
         Statement s;
         s = con.createStatement();
         s.executeQuery("delete from badplayers where username = '******' and type = 2");
         s.close();
         con.close();
         Mysql.release();
         client.getActionSender().sendMessage("You have removed ip-mute for " + name + ".");
       } catch (Exception e) {
         client
             .getActionSender()
             .sendMessage("Error processing release of ip-mute for " + name + ".");
       }
     } else {
       client.getActionSender().sendMessage("Syntax is ::mute <name>.");
     }
   }
 }