Package simpleserver

Examples of simpleserver.Authenticator$MinecraftOnlineChecker


    super("login PLAYER PASSWORD", "Login using CustAuth.");
  }

  public void execute(Player player, String message) {

    Authenticator auth = player.getServer().authenticator;
    if (!allowUse(player, auth)) {
      return;
    }

    String[] arguments = extractArguments(message);

    if (arguments.length != 2) {
      player.addTMessage(Color.RED, "Wrong number of arguments!");
      return;
    }

    String userName = arguments[0];
    String password = arguments[1];

    if (player.getServer().playerList.findPlayerExact(userName) != null) {
      player.addTMessage(Color.RED, "Login failed! Player already in server.");
      return;
    }

    if (!auth.isRegistered(userName)) {
      player.addTMessage(Color.RED, "You are not registered!");
      player.addTMessage(Color.RED, "Use the %s command to register.", (commandPrefix() + "register"));
      return;
    }

    if (!auth.loginBanTimeOver(player)) {
      player.addTMessage(Color.RED, "You've to wait %s seconds before another try to login.", auth.leftBanTime(player));
      return;
    }

    if (auth.login(player, userName, password)) {
      player.addTMessage(Color.GRAY, "Login successfull!");
      player.addTMessage(Color.GRAY, "Please reconnect to the server within %s seconds to complete the CustAuth process.", Authenticator.REQUEST_EXPIRATION);
      player.setUsedAuthenticator(true);
      auth.unbanLogin(player);
    } else {
      player.addTMessage(Color.RED, "Login failed! Password missmatch.");
      auth.banLogin(player);
    }
  }
View Full Code Here


    super("register [OLD PASSWORD] NEW_PASSWORD NEW_PASSWORD", "Set or change password for CustAuth.");
  }

  public void execute(Player player, String message) {

    Authenticator auth = player.getServer().authenticator;
    if (!auth.allowRegistration()) {
      player.addTMessage(Color.RED, "Registration failed! CustAuth registration currently not allowed.");
      return;
    }
    if (player.isGuest()) {
      player.addTMessage(Color.RED, "You cannot use the CustAuth registration if you are a Guest on the Server.");
View Full Code Here

TOP

Related Classes of simpleserver.Authenticator$MinecraftOnlineChecker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.