Package org.spoutcraft.launcher.exception

Examples of org.spoutcraft.launcher.exception.MCNetworkException


  }

  public static String[] doLogin(String user, String pass, JProgressBar progress) throws BadLoginException, MCNetworkException, OutdatedMCLauncherException, UnsupportedEncodingException, MinecraftUserNotPremiumException, AccountMigratedException {
    String parameters = "user=" + URLEncoder.encode(user, "UTF-8") + "&password=" + URLEncoder.encode(pass, "UTF-8") + "&version=" + 13;
    String result = PlatformUtils.excutePost("https://login.minecraft.net/", parameters, progress);
    if (result == null) { throw new MCNetworkException(); }
    if (!result.contains(":")) {
      if (result.trim().equals("Bad login")) {
        throw new BadLoginException();
      } else if (result.trim().equals("User not premium")) {
        throw new MinecraftUserNotPremiumException();
      } else if (result.trim().equals("Old version")) {
        throw new OutdatedMCLauncherException();
      } else if (result.trim().equals("Account migrated, use e-mail as username.")) {
        throw new AccountMigratedException();
        }else {
        System.err.print("Unknown login result: " + result);
      }
      throw new MCNetworkException();
    }
    return result.split(":");
  }
View Full Code Here

TOP

Related Classes of org.spoutcraft.launcher.exception.MCNetworkException

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.