private void func_140005_i() { Session session = this.mc.getSession(); McoClient mcoclient = new McoClient( session.getSessionID(), session.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy()); try { if (mcoclient.func_148695_c().booleanValue()) { this.mc.displayGuiScreen(new GuiScreenClientOutdated(this)); } else { this.mc.displayGuiScreen(new GuiScreenOnlineServers(this)); } } catch (ExceptionMcoService exceptionmcoservice) { logger.error("Couldn\'t connect to realms"); } catch (IOException ioexception) { logger.error("Couldn\'t connect to realms"); } }
@Override public void run() { status = "\247e\247kLogging in..."; Field session = null; for (Field field : Minecraft.class.getDeclaredFields()) { if (field.getName().equalsIgnoreCase("session") || field.getType() == Session.class) { session = field; } } if (session == null) session = Minecraft.class.getDeclaredFields()[28]; session.setAccessible(true); if (account.getPassword().equals("")) { Session newSession = new Session(account.getUsername(), "", "", "mojang"); try { session.set(mc, newSession); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) account.setKeyword(newSession.getUsername()); status = "\247aLogged in as\247r " + newSession.getUsername(); } catch (IllegalAccessException e) { XIV.getInstance() .getLogger() .warn("Failed to set session for alt login, a stacktrace has been printed."); e.printStackTrace(); } } else { Session newSession = createSession(account.getUsername(), account.getPassword()); if (newSession != null) { try { session.set(mc, newSession); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) account.setKeyword(newSession.getUsername()); status = "\247aLogged in as\247r " + newSession.getUsername(); } catch (IllegalAccessException e) { XIV.getInstance() .getLogger() .warn("Failed to set session for alt login, a stacktrace has been printed."); e.printStackTrace(); } } } }
public static String userName() { Session var0 = Minecraft.func_71410_x().func_110432_I(); return var0 == null ? null : var0.func_111285_a(); }
public static String sessionId() { Session var0 = Minecraft.func_71410_x().func_110432_I(); return var0 == null ? null : var0.func_111286_b(); }