Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //go to Minecraft.java, in the run() function, put this code after the first try catch:
- session = new Session("Username", getSession("Username", "password"));
- //put this in Minecraft.java
- public String getSession(String user, String pass) {
- String userName = user;
- String password = pass;
- String result = null;
- try {
- String parameters = (new StringBuilder("user=")).append(URLEncoder.encode(userName, "UTF-8")).append("&password=").append(URLEncoder.encode(password, "UTF-8")).append("&version=").append(12).toString();
- result = Util.excutePost("https://login.minecraft.net/", parameters);
- } catch(Exception e) {
- e.printStackTrace();
- }
- if(result == null) {
- return "";
- }
- if(!result.contains(":")) {
- if(result.trim().equals("Bad login")) {
- //showError("Login failed");
- } else if(result.trim().equals("Old version")) {
- //loginForm.setOutdated();
- //showError("Outdated launcher");
- } else {
- //showError(result);
- }
- //loginForm.setNoNetwork();
- return "";
- }
- String values[] = result.split(":");
- return values[3].trim();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement