コード例 #1
0
  public void a(OEntityPlayerMP var1) {
    //        this.d[0].b(var1);
    //        this.d[1].b(var1);
    //        this.d[2].b(var1);
    for (World w : Canary.getServer().getWorldManager().getAllWorlds()) {
      for (Dimension dim : w.getDimensions()) {
        dim.getPlayerManager().removePlayer(var1.getPlayer());
      }
    }
    //        this.a(var1.w).a(var1); //remove again? rly?

    //        OWorldServer var2 = this.c.a(var1.w);
    var1.getDimension().getPlayerManager().addPlayer(var1.getPlayer());
    OWorldServer var2 = (OWorldServer) ((CanaryDimension) var1.getDimension()).getHandle();
    var2.G.c((int) var1.bm >> 4, (int) var1.bo >> 4);
  }
コード例 #2
0
  public OEntityPlayerMP a(ONetLoginHandler var1, String var2) {
    String var3 = var1.b.c().toString();
    // IP
    var3 = var3.substring(var3.indexOf("/") + 1);
    var3 = var3.substring(0, var3.indexOf(":"));
    Dimension dim = Canary.getServer().getDefaultWorld().getNormal();
    LoginChecksHook hook =
        (LoginChecksHook)
            Canary.hooks().callHook(new LoginChecksHook(var3, var2, dim.getType(), dim.getName()));
    if (hook.getKickReason() != null && !hook.getKickReason().trim().equals("")) {
      var1.a(hook.getKickReason());
    }
    // CanaryMod - end
    // TODO: Refactor to use canary white listing, banning etc etc

    if (this.f.contains(var2.trim().toLowerCase())) {
      var1.a("You are banned from this server!");
      return null;
    } else if (!this.isAllowedToLogin(var2)) {
      var1.a("You are not white-listed on this server!");
      return null;
    } else if (this.g.contains(var3)) {
      var1.a("Your IP address is banned from this server!");
      return null;
    } else {
      if (this.b.size() >= this.e) {
        var1.a("The server is full!");
        return null;
      } else {
        for (int var4 = 0; var4 < this.b.size(); ++var4) {
          OEntityPlayerMP var5 = (OEntityPlayerMP) this.b.get(var4);
          if (var5.v.equalsIgnoreCase(var2)) {
            var5.a.a("You logged in from another location");
          }
        }
        OWorldServer dimension =
            (OWorldServer)
                ((CanaryDimension)
                        Canary.getServer()
                            .getWorld(hook.getWorld())
                            .getDimension(hook.getDimensionType()))
                    .getHandle();
        return new OEntityPlayerMP(this.c, dimension, var2, new OItemInWorldManager(dimension));
      }
    }
  }
コード例 #3
0
  public void b() {
    // TODO: Something with Configuration.getServerConfig().getPlayerlistTicks() and
    // Configuration.getServerConfig().getPlayerlistAutoUpdate() here
    if (++this.p > 200) {
      this.p = 0;
    }

    if (this.p < this.b.size()) {
      OEntityPlayerMP var1 = (OEntityPlayerMP) this.b.get(this.p);
      this.sendPacketToAll((new OPacket201PlayerInfo(var1.v, true, var1.i)));
    }

    for (World w : Canary.getServer().getWorldManager().getAllWorlds()) {
      for (Dimension dim : w.getDimensions()) {
        ((CanaryPlayerManager) dim.getPlayerManager()).getHandle().b();
      }
    }
  }