예제 #1
0
파일: Users.java 프로젝트: Newticus/joe.to
 public void addFlag(String name, Flag flag) {
   User user = getUser(name);
   if (user == null) {
     user = this.j2.mysql.getUser(name);
   }
   user.addFlag(flag);
   j2.debug("Adding flag " + flag.getChar() + " for " + name);
   this.j2.mysql.setFlags(name, user.getUserFlags());
 }
예제 #2
0
파일: Users.java 프로젝트: Newticus/joe.to
  public void processJoin(Player player) {
    // Last chance to check
    if (!player.isOnline()) {
      return;
    }
    String name = player.getName();
    j2.irc.processJoin(name);
    j2.ip.processJoin(name);
    j2.warps.processJoin(name);
    j2.damage.processJoin(name);
    j2.jail.processJoin(player);
    this.playerReset(name);
    if (player.getInventory().getHelmet().getTypeId() == Material.FIRE.getId()) {
      player.getInventory().setHelmet(new ItemStack(Material.GRASS));
      player.sendMessage(ChatColor.RED + "You fizzle out");
    }
    if (j2.maintenance) {
      player.sendMessage(ChatColor.YELLOW + "We are in maintenance mode");
    }
    try {
      j2.mcbans.processJoin(player);
    } catch (Exception e) {

    }
    for (String line : j2.motd) {
      player.sendMessage(line);
    }
    if (j2.reallyHasFlag(name, Flag.ADMIN)) {
      int count = this.j2.reports.numReports();
      player.sendMessage(ChatColor.LIGHT_PURPLE + "There are " + count + " reports. ");
    }
    j2.minitrue.processJoin(player);
    if (j2.hasFlag(player, Flag.CONTRIBUTOR)) {
      player.sendMessage(
          ChatColor.LIGHT_PURPLE + "We think you're an " + ChatColor.GOLD + "AMAZING CONTRIBUTOR");
      player.sendMessage(
          ChatColor.LIGHT_PURPLE
              + "to the minecraft community as a whole! "
              + ChatColor.RED
              + "<3");
    }
  }
예제 #3
0
파일: Users.java 프로젝트: Newticus/joe.to
 private void checkOnline() {
   synchronized (this.userlock) {
     for (User u : new ArrayList<User>(this.users)) {
       Player p = j2.getServer().getPlayer(u.getName());
       if (p == null || !p.isOnline()) {
         this.users.remove(u);
         if (p != null) {
           p.kickPlayer("You have glitched. Rejoin");
         }
       }
     }
   }
 }