/*     */   public void login(String userName, String password) {
/*     */     try {
/*  85 */       String parameters = "user=" + URLEncoder.encode(userName, "UTF-8") + "&password=" + URLEncoder.encode(password, "UTF-8") + "&version=" + 12;
/*  86 */       String result = Util.excutePost("https://login.minecraft.net/", parameters);
/*     */ 
/*  88 */       if (result == null) {
/*  89 */         showError("Can't connect to minecraft.net");
/*  90 */         this.loginForm.setNoNetwork();
/*  91 */         return;
/*     */       }
/*  93 */       if (!result.contains(":")) {
/*  94 */         if (result.trim().equals("Bad login")) {
/*  95 */           showError("Login failed");
/*  96 */         } else if (result.trim().equals("Old version")) {
/*  97 */           this.loginForm.setOutdated();
/*  98 */           showError("Outdated launcher");
/*     */         } else {
/* 100 */           showError(result);
/*     */         }
/* 102 */         this.loginForm.setNoNetwork();
/* 103 */         return;
/*     */       }
/* 105 */       String[] values = result.split(":");
/*     */ 
/* 107 */       System.out.println("Username is '" + values[2] + "'");
/*     */ 
/* 109 */       this.launcher = new Launcher();
/* 110 */       this.launcher.customParameters.put("userName", values[2].trim());
/* 111 */       this.launcher.customParameters.put("latestVersion", values[0].trim());
/* 112 */       this.launcher.customParameters.put("downloadTicket", values[1].trim());
/* 113 */       this.launcher.customParameters.put("sessionId", values[3].trim());
/* 114 */       this.launcher.init();
/*     */ 
/* 116 */       removeAll();
/* 117 */       add(this.launcher, "Center");
/* 118 */       validate();
/* 119 */       this.launcher.start();
/* 120 */       this.loginForm.loginOk();
/* 121 */       this.loginForm = null;
/* 122 */       setTitle("CommunityCraft");
/*     */     } catch (Exception e) {
/* 124 */       e.printStackTrace();
/* 125 */       showError(e.toString());
/* 126 */       this.loginForm.setNoNetwork();
/*     */     }
/*     */   }