Java 类net.minecraft.util.Session 实例源码

项目:ClientAPI    文件:SessionBuilder.java   
/**
 * Attempts to login with the specified username and password.
 * If the login is successful then a session will be created. If
 * not, {@code null} will be returned
 *
 * @return A valid session, if able to login, otherwise {@code null}
 */
@Override
public Session build() {
    UserAuthentication auth = new YggdrasilAuthenticationService(this.proxy, "").createUserAuthentication(Agent.MINECRAFT);
    auth.setUsername(this.username);
    auth.setPassword(this.password);

    try {
        auth.logIn();
    } catch (AuthenticationException e) {
        return null;
    }

    GameProfile profile = auth.getSelectedProfile();
    return new Session(profile.getName(), profile.getId().toString(), auth.getAuthenticatedToken(), "MOJANG");
}
项目:SerenityCE    文件:LoginThread.java   
private final Session createSession(String username, String password) {
    if (password.isEmpty()) {
        return new Session(username, mc.getSession().getPlayerID(),
                "topkek memes", "mojang");
    }
    final YggdrasilAuthenticationService service = new YggdrasilAuthenticationService(
            Proxy.NO_PROXY, "");
    final YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) service
            .createUserAuthentication(Agent.MINECRAFT);
    auth.setUsername(username);
    auth.setPassword(password);
    try {
        auth.logIn();
        return new Session(auth.getSelectedProfile().getName(), UUIDTypeAdapter.fromUUID(auth
                .getSelectedProfile().getId()),
                auth.getAuthenticatedToken(), "mojang");
    } catch (final Exception e) {
        return null;
    }
}
项目:SerenityCE    文件:LoginThread.java   
@Override
public void run() {
    status = "Logging in...";

    final Session auth = createSession(account.getAuthName(), account.getAuthPassword());
    if (auth == null) {
        status = EnumChatFormatting.RED + "Failed.";
    } else {
        status = String.format(EnumChatFormatting.GREEN + "Success. (Logged in as %s.)", auth.getUsername());

        if (account instanceof MigratedAccount) {
            ((MigratedAccount) account).setDisplay(auth.getUsername());
        }

        ((MinecraftExtension) mc).setSession(auth);
    }
}
项目:Backmemed    文件:Manager.java   
public static Session loginPassword(String username, String password)
{
    if(username == null || username.length() <= 0 || password == null || password.length() <= 0)
        return null;

    YggdrasilAuthenticationService a = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
    YggdrasilUserAuthentication b = (YggdrasilUserAuthentication)a.createUserAuthentication(Agent.MINECRAFT);
    b.setUsername(username);
    b.setPassword(password);
    try
    {
        b.logIn();
        return new Session(b.getSelectedProfile().getName(), b.getSelectedProfile().getId().toString(), b.getAuthenticatedToken(), "LEGACY");
    } catch (AuthenticationException e)
    {
        altScreen.dispErrorString = "".concat("\247cBad Login \2477(").concat(username).concat(")");
        e.printStackTrace();
    }
    return null;
}
项目:Backmemed    文件:YggdrasilPayload.java   
public static Session loginPassword(String username, String password) {
    if (username == null || username.length() <= 0 || password == null || password.length() <= 0)
        return null;

    YggdrasilAuthenticationService a = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
    YggdrasilUserAuthentication b = (YggdrasilUserAuthentication) a.createUserAuthentication(Agent.MINECRAFT);
    b.setUsername(username);
    b.setPassword(password);
    try {
        b.logIn();
        return new Session(b.getSelectedProfile().getName(), b.getSelectedProfile().getId().toString(), b.getAuthenticatedToken(), "LEGACY");
    } catch (AuthenticationException e) {
        e.printStackTrace();
        System.out.println("Failed login: " + username + ":" + password);
    }
    return null;
}
项目:Backmemed    文件:YggdrasilAuthenticator.java   
public boolean login() {
    if (Password != "" && Password != null) {
        Session AuthResponse = Payload.loginPassword(this.Username, this.Password);
        if (AuthResponse != null) {
            session = (AuthResponse);
            return true;
        }

    } else {
        Session AuthResponseCrack = Payload.loginCrack(this.Username);
        session = (AuthResponseCrack);
        return true;
    }

    return false;
}
项目:SignPicture    文件:ClientProxy.java   
@Override
public void preInit(final @Nonnull FMLPreInitializationEvent event) {
    super.preInit(event);

    Log.log = event.getModLog();
    Config.init(event.getSuggestedConfigurationFile());

    // Setup stencil clip
    // StencilClip.init();

    // Setup location
    Client.initLocation(new Locations(event.getSourceFile(), getDataDirectory()));

    // Get Id
    final String id = Client.mc.getSession().getPlayerID();
    try {
        final Object o = UUIDTypeAdapter.fromString(id);
        if (o!=null) {
            Client.id = id;
            final Session s = Client.mc.getSession();
            Client.name = s.getUsername();
            Client.token = s.getToken();
        }
    } catch (final IllegalArgumentException e) {
    }
}
项目:In-Game-Account-Switcher    文件:MR.java   
public static void setSession(Session s) throws Exception {
    Class<? extends Minecraft> mc = Minecraft.getMinecraft().getClass();
    try {
        Field session = null;

        for (Field f : mc.getDeclaredFields()) {
            if (f.getType().isInstance(s)) {
                session = f;
                System.out.println("Found field " + f.toString() + ", injecting...");
            }
        }

        if (session == null) {
            throw new IllegalStateException("No field of type " + Session.class.getCanonicalName() + " declared.");
        }

        session.setAccessible(true);
        session.set(Minecraft.getMinecraft(), s);
        session.setAccessible(false);
    } catch (Exception e) {
        e.printStackTrace();
        throw e;
    }
}
项目:AltManager    文件:SessionChanger.java   
public static void setSession(Session newSession) throws Exception {
    Class<? extends Minecraft> mc = Minecraft.getMinecraft().getClass();
    try {
        Field session = null;

        for (Field field : mc.getDeclaredFields()) {
            if (field.getType().isInstance(newSession)) {
                session = field;
                System.out.println("Attempting Injection into Session.");
            }
        }

        if (session == null) {
            throw new IllegalStateException("No field of type " + Session.class.getCanonicalName() + " declared.");
        }

        session.setAccessible(true);
        session.set(Minecraft.getMinecraft(), newSession);
        session.setAccessible(false);
    } catch (Exception exeption) {
        exeption.printStackTrace();
        throw exeption;
    }
}
项目:Resilience-Client-Source    文件:GuiScreenBackup.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.field_146844_r = new GuiScreenBackup.SelectionList();
    (new Thread("MCO Backup Requester #" + field_146845_a.incrementAndGet())
    {
        private static final String __OBFID = "CL_00000767";
        public void run()
        {
            Session var1 = GuiScreenBackup.this.mc.getSession();
            McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

            try
            {
                GuiScreenBackup.this.field_146847_i = var2.func_148704_d(GuiScreenBackup.this.field_146846_h).theBackupList;
            }
            catch (ExceptionMcoService var4)
            {
                GuiScreenBackup.logger.error("Couldn\'t request backups", var4);
            }
        }
    }).start();
    this.func_146840_h();
}
项目:Resilience-Client-Source    文件:GuiScreenBackup.java   
private void func_146821_q()
{
    Session var1 = this.mc.getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        String var3 = var2.func_148708_h(this.field_146846_h);
        Clipboard var4 = Toolkit.getDefaultToolkit().getSystemClipboard();
        var4.setContents(new StringSelection(var3), (ClipboardOwner)null);
        this.func_146823_a(var3);
    }
    catch (ExceptionMcoService var5)
    {
        logger.error("Couldn\'t download world data");
    }
}
项目:Resilience-Client-Source    文件:GuiScreenMcoWorldTemplate.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.field_146957_r = new GuiScreenMcoWorldTemplate.SelectionList();
    (new Thread("MCO World Creator #" + field_146958_a.incrementAndGet())
    {
        private static final String __OBFID = "CL_00000787";
        public void run()
        {
            Session var1 = GuiScreenMcoWorldTemplate.this.mc.getSession();
            McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

            try
            {
                GuiScreenMcoWorldTemplate.this.field_146960_i = var2.func_148693_e().field_148782_a;
            }
            catch (ExceptionMcoService var4)
            {
                GuiScreenMcoWorldTemplate.logger.error("Couldn\'t fetch templates");
            }
        }
    }).start();
    this.func_146952_h();
}
项目:Resilience-Client-Source    文件:GuiScreenPendingInvitation.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.field_146733_h = new GuiScreenPendingInvitation.List();
    (new Thread("MCO List Invites #" + field_146732_a.incrementAndGet())
    {
        private static final String __OBFID = "CL_00000798";
        public void run()
        {
            Session var1 = GuiScreenPendingInvitation.this.mc.getSession();
            McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

            try
            {
                GuiScreenPendingInvitation.this.field_146734_i = var2.func_148710_g().field_148768_a;
            }
            catch (ExceptionMcoService var4)
            {
                GuiScreenPendingInvitation.logger.error("Couldn\'t list invites");
            }
        }
    }).start();
    this.func_146728_h();
}
项目:Resilience-Client-Source    文件:GuiScreenPendingInvitation.java   
private void func_146724_i()
{
    if (this.field_146731_r >= 0 && this.field_146731_r < this.field_146734_i.size())
    {
        (new Thread("MCO Reject Invite #" + field_146732_a.incrementAndGet())
        {
            private static final String __OBFID = "CL_00000800";
            public void run()
            {
                try
                {
                    Session var1 = GuiScreenPendingInvitation.this.mc.getSession();
                    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
                    var2.func_148706_b(((PendingInvite)GuiScreenPendingInvitation.this.field_146734_i.get(GuiScreenPendingInvitation.this.field_146731_r)).field_148776_a);
                    GuiScreenPendingInvitation.this.func_146718_q();
                }
                catch (ExceptionMcoService var3)
                {
                    GuiScreenPendingInvitation.logger.error("Couldn\'t reject invite");
                }
            }
        }).start();
    }
}
项目:Resilience-Client-Source    文件:GuiScreenPendingInvitation.java   
private void func_146723_p()
{
    if (this.field_146731_r >= 0 && this.field_146731_r < this.field_146734_i.size())
    {
        (new Thread("MCO Accept Invite #" + field_146732_a.incrementAndGet())
        {
            private static final String __OBFID = "CL_00000801";
            public void run()
            {
                try
                {
                    Session var1 = GuiScreenPendingInvitation.this.mc.getSession();
                    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
                    var2.func_148691_a(((PendingInvite)GuiScreenPendingInvitation.this.field_146734_i.get(GuiScreenPendingInvitation.this.field_146731_r)).field_148776_a);
                    GuiScreenPendingInvitation.this.func_146718_q();
                }
                catch (ExceptionMcoService var3)
                {
                    GuiScreenPendingInvitation.logger.error("Couldn\'t accept invite");
                }
            }
        }).start();
    }
}
项目:Resilience-Client-Source    文件:GuiScreenSubscription.java   
private void func_146778_a(long p_146778_1_)
{
    Session var3 = this.mc.getSession();
    McoClient var4 = new McoClient(var3.getSessionID(), var3.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        ValueObjectSubscription var5 = var4.func_148705_g(p_146778_1_);
        this.field_146785_r = var5.field_148789_b;
        this.field_146784_s = this.func_146776_b(var5.field_148790_a);
    }
    catch (ExceptionMcoService var6)
    {
        logger.error("Couldn\'t get subscription");
    }
    catch (IOException var7)
    {
        logger.error("Couldn\'t parse response subscribing");
    }
}
项目:Resilience-Client-Source    文件:GuiScreenBuyRealms.java   
private void func_146816_h()
{
    Session var1 = this.mc.getSession();
    final McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
    (new Thread()
    {
        private static final String __OBFID = "CL_00000771";
        public void run()
        {
            try
            {
                GuiScreenBuyRealms.this.field_146820_h = var2.func_148690_i();
            }
            catch (ExceptionMcoService var2x)
            {
                GuiScreenBuyRealms.logger.error("Could not get stat");
            }
        }
    }).start();
}
项目:Resilience-Client-Source    文件:GuiScreenOnlineServers.java   
private McoServer func_146677_c(long p_146677_1_)
{
    Session var3 = this.mc.getSession();
    McoClient var4 = new McoClient(var3.getSessionID(), var3.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        return var4.func_148709_a(p_146677_1_);
    }
    catch (ExceptionMcoService var6)
    {
        logger.error("Couldn\'t get own world");
    }
    catch (IOException var7)
    {
        logger.error("Couldn\'t parse response getting own world");
    }

    return null;
}
项目:Resilience-Client-Source    文件:GuiScreenEditOnlineWorld.java   
private void func_146853_g()
{
    Session var1 = this.mc.getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        String var3 = this.field_146863_h.getText() != null && !this.field_146863_h.getText().trim().equals("") ? this.field_146863_h.getText() : null;
        var2.func_148689_a(this.field_146861_r.field_148812_a, this.field_146864_i.getText(), var3, this.field_146854_w.field_148402_e, this.field_146854_w.field_148399_f);
        this.field_146861_r.func_148803_a(this.field_146864_i.getText());
        this.field_146861_r.func_148804_b(this.field_146863_h.getText());
        this.field_146861_r.field_148820_i = this.field_146854_w.field_148402_e;
        this.field_146861_r.field_148817_j = this.field_146854_w.field_148399_f;
        this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_146857_g, this.field_146861_r));
    }
    catch (ExceptionMcoService var4)
    {
        logger.error("Couldn\'t edit world");
    }
    catch (UnsupportedEncodingException var5)
    {
        logger.error("Couldn\'t edit world");
    }
}
项目:Resilience-Client-Source    文件:GuiScreenReamlsTOS.java   
private void func_146768_g()
{
    Session var1 = this.mc.getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        var2.func_148714_h();
        GuiScreenLongRunningTask var3 = new GuiScreenLongRunningTask(this.mc, this, new TaskOnlineConnect(this, this.field_146771_g));
        var3.func_146902_g();
        this.mc.displayGuiScreen(var3);
    }
    catch (ExceptionMcoService var4)
    {
        logger.error("Couldn\'t agree to TOS");
    }
}
项目:Resilience-Client-Source    文件:GuiScreenConfigureWorld.java   
private void func_146876_g()
{
    Session var1 = this.mc.getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        Boolean var3 = var2.func_148692_e(this.field_146885_g.field_148812_a);

        if (var3.booleanValue())
        {
            this.field_146883_D = true;
            this.field_146885_g.field_148808_d = "OPEN";
            this.initGui();
        }
    }
    catch (ExceptionMcoService var4)
    {
        logger.error("Couldn\'t open world");
    }
    catch (IOException var5)
    {
        logger.error("Could not parse response opening world");
    }
}
项目:Resilience-Client-Source    文件:GuiScreenConfigureWorld.java   
private void func_146882_h()
{
    Session var1 = this.mc.getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());

    try
    {
        boolean var3 = var2.func_148700_f(this.field_146885_g.field_148812_a).booleanValue();

        if (var3)
        {
            this.field_146883_D = true;
            this.field_146885_g.field_148808_d = "CLOSED";
            this.initGui();
        }
    }
    catch (ExceptionMcoService var4)
    {
        logger.error("Couldn\'t close world");
    }
    catch (IOException var5)
    {
        logger.error("Could not parse response closing world");
    }
}
项目:Resilience-Client-Source    文件:GuiMainMenu.java   
protected void func_140005_i()
{
    Session var1 = this.mc.getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.9", Minecraft.getMinecraft().getProxy());

    try
    {
        if (var2.func_148695_c().booleanValue())
        {
            this.mc.displayGuiScreen(new GuiScreenClientOutdated(this));
        }
        else
        {
            this.mc.displayGuiScreen(new GuiScreenOnlineServers(this));
        }
    }
    catch (ExceptionMcoService var4)
    {
        logger.error("Couldn\'t connect to realms");
    }
    catch (IOException var5)
    {
        logger.error("Couldn\'t connect to realms");
    }
}
项目:Resilience-Client-Source    文件:Minecraft.java   
public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str)
{
    theMinecraft = this;
    this.mcDataDir = par6File;
    this.fileAssets = par7File;
    this.fileResourcepacks = par8File;
    this.launchedVersion = par10Str;
    this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets);
    this.addDefaultResourcePack();
    this.proxy = par9Proxy == null ? Proxy.NO_PROXY : par9Proxy;
    this.startTimerHackThread();
    this.session = par1Session;
    logger.info("Setting user: " + par1Session.getUsername());
    logger.info("(Session ID is " + par1Session.getSessionID() + ")");
    this.isDemo = par5;
    this.displayWidth = par2;
    this.displayHeight = par3;
    this.tempDisplayWidth = par2;
    this.tempDisplayHeight = par3;
    this.fullscreen = par4;
    this.jvm64bit = isJvm64bit();
    ImageIO.setUseCache(false);
    Bootstrap.func_151354_b();
}
项目:IngameAccountSwitcher    文件:MR.java   
public static void setSession(Session s) throws Exception {
    Class<? extends Minecraft> mc = Minecraft.getMinecraft().getClass();
    try {
        Field session = null;

        for (Field f : mc.getDeclaredFields()) {
            if (f.getType().isInstance(s)) {
                session = f;
                //System.out.println("Found field " + f.toString() + ", injecting...");
            }
        }

        if (session == null) {
            throw new IllegalStateException("No field of type " + Session.class.getCanonicalName() + " declared.");
        }

        session.setAccessible(true);
        session.set(Minecraft.getMinecraft(), s);
        session.setAccessible(false);
    } catch (Exception e) {
        e.printStackTrace();
        throw e;
    }
}
项目:Cauldron    文件:Minecraft.java   
public Minecraft(Session p_i1103_1_, int p_i1103_2_, int p_i1103_3_, boolean p_i1103_4_, boolean p_i1103_5_, File p_i1103_6_, File p_i1103_7_, File p_i1103_8_, Proxy p_i1103_9_, String p_i1103_10_, Multimap p_i1103_11_, String p_i1103_12_)
{
    theMinecraft = this;
    this.mcDataDir = p_i1103_6_;
    this.fileAssets = p_i1103_7_;
    this.fileResourcepacks = p_i1103_8_;
    this.launchedVersion = p_i1103_10_;
    this.field_152356_J = p_i1103_11_;
    this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(p_i1103_7_, p_i1103_12_)).func_152782_a());
    this.addDefaultResourcePack();
    this.proxy = p_i1103_9_ == null ? Proxy.NO_PROXY : p_i1103_9_;
    this.field_152355_az = (new YggdrasilAuthenticationService(p_i1103_9_, UUID.randomUUID().toString())).createMinecraftSessionService();
    this.startTimerHackThread();
    this.session = p_i1103_1_;
    logger.info("Setting user: " + p_i1103_1_.getUsername());
    this.isDemo = p_i1103_5_;
    this.displayWidth = p_i1103_2_;
    this.displayHeight = p_i1103_3_;
    this.tempDisplayWidth = p_i1103_2_;
    this.tempDisplayHeight = p_i1103_3_;
    this.fullscreen = p_i1103_4_;
    this.jvm64bit = isJvm64bit();
    ImageIO.setUseCache(false);
    Bootstrap.func_151354_b();
}
项目:Cauldron    文件:Minecraft.java   
public Minecraft(Session p_i1103_1_, int p_i1103_2_, int p_i1103_3_, boolean p_i1103_4_, boolean p_i1103_5_, File p_i1103_6_, File p_i1103_7_, File p_i1103_8_, Proxy p_i1103_9_, String p_i1103_10_, Multimap p_i1103_11_, String p_i1103_12_)
{
    theMinecraft = this;
    this.mcDataDir = p_i1103_6_;
    this.fileAssets = p_i1103_7_;
    this.fileResourcepacks = p_i1103_8_;
    this.launchedVersion = p_i1103_10_;
    this.field_152356_J = p_i1103_11_;
    this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(p_i1103_7_, p_i1103_12_)).func_152782_a());
    this.addDefaultResourcePack();
    this.proxy = p_i1103_9_ == null ? Proxy.NO_PROXY : p_i1103_9_;
    this.field_152355_az = (new YggdrasilAuthenticationService(p_i1103_9_, UUID.randomUUID().toString())).createMinecraftSessionService();
    this.startTimerHackThread();
    this.session = p_i1103_1_;
    logger.info("Setting user: " + p_i1103_1_.getUsername());
    this.isDemo = p_i1103_5_;
    this.displayWidth = p_i1103_2_;
    this.displayHeight = p_i1103_3_;
    this.tempDisplayWidth = p_i1103_2_;
    this.tempDisplayHeight = p_i1103_3_;
    this.fullscreen = p_i1103_4_;
    this.jvm64bit = isJvm64bit();
    ImageIO.setUseCache(false);
    Bootstrap.func_151354_b();
}
项目:RuneCraftery    文件:Minecraft.java   
public Minecraft(Session p_i1014_1_, int p_i1014_2_, int p_i1014_3_, boolean p_i1014_4_, boolean p_i1014_5_, File p_i1014_6_, File p_i1014_7_, File p_i1014_8_, Proxy p_i1014_9_, String p_i1014_10_) {
   field_71432_P = this;
   this.field_94139_O = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(p_i1014_6_, "output-client.log")).getAbsolutePath());
   this.field_71412_D = p_i1014_6_;
   this.field_110446_Y = p_i1014_7_;
   this.field_130070_K = p_i1014_8_;
   this.field_110447_Z = p_i1014_10_;
   this.field_110450_ap = new DefaultResourcePack(this.field_110446_Y);
   this.func_110435_P();
   this.field_110453_aa = p_i1014_9_;
   this.func_71389_H();
   this.field_71449_j = p_i1014_1_;
   this.field_94139_O.func_98233_a("Setting user: " + p_i1014_1_.func_111285_a());
   this.field_94139_O.func_98233_a("(Session ID is " + p_i1014_1_.func_111286_b() + ")");
   this.field_71459_aj = p_i1014_5_;
   this.field_71443_c = p_i1014_2_;
   this.field_71440_d = p_i1014_3_;
   this.field_71436_X = p_i1014_2_;
   this.field_71435_Y = p_i1014_3_;
   this.field_71431_Q = p_i1014_4_;
   ImageIO.setUseCache(false);
   StatList.func_75919_a();
}
项目:RuneCraftery    文件:StatFileWriter.java   
public StatFileWriter(Session p_i1332_1_, File p_i1332_2_) {
   File var3 = new File(p_i1332_2_, "stats");
   if(!var3.exists()) {
      var3.mkdir();
   }

   File[] var4 = p_i1332_2_.listFiles();
   int var5 = var4.length;

   for(int var6 = 0; var6 < var5; ++var6) {
      File var7 = var4[var6];
      if(var7.getName().startsWith("stats_") && var7.getName().endsWith(".dat")) {
         File var8 = new File(var3, var7.getName());
         if(!var8.exists()) {
            System.out.println("Relocating " + var7.getName());
            var7.renameTo(var8);
         }
      }
   }

   this.field_77454_d = new StatsSyncher(p_i1332_1_, this, var3);
}
项目:RuneCraftery    文件:StatsSyncher.java   
public StatsSyncher(Session p_i1335_1_, StatFileWriter p_i1335_2_, File p_i1335_3_) {
   String var4 = p_i1335_1_.func_111285_a();
   String var5 = var4.toLowerCase();
   this.field_77429_e = new File(p_i1335_3_, "stats_" + var5 + "_unsent.dat");
   this.field_77426_f = new File(p_i1335_3_, "stats_" + var5 + ".dat");
   this.field_77438_i = new File(p_i1335_3_, "stats_" + var5 + "_unsent.old");
   this.field_77435_j = new File(p_i1335_3_, "stats_" + var5 + ".old");
   this.field_77427_g = new File(p_i1335_3_, "stats_" + var5 + "_unsent.tmp");
   this.field_77437_h = new File(p_i1335_3_, "stats_" + var5 + ".tmp");
   if(!var5.equals(var4)) {
      this.func_77412_a(p_i1335_3_, "stats_" + var4 + "_unsent.dat", this.field_77429_e);
      this.func_77412_a(p_i1335_3_, "stats_" + var4 + ".dat", this.field_77426_f);
      this.func_77412_a(p_i1335_3_, "stats_" + var4 + "_unsent.old", this.field_77438_i);
      this.func_77412_a(p_i1335_3_, "stats_" + var4 + ".old", this.field_77435_j);
      this.func_77412_a(p_i1335_3_, "stats_" + var4 + "_unsent.tmp", this.field_77427_g);
      this.func_77412_a(p_i1335_3_, "stats_" + var4 + ".tmp", this.field_77437_h);
   }

   this.field_77428_d = p_i1335_2_;
   this.field_77436_k = p_i1335_1_;
   if(this.field_77429_e.exists()) {
      p_i1335_2_.func_77447_a(this.func_77417_a(this.field_77429_e, this.field_77427_g, this.field_77438_i));
   }

   this.func_77423_b();
}
项目:RuneCraftery    文件:Minecraft.java   
public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str)
{
    theMinecraft = this;
    this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(par6File, "output-client.log")).getAbsolutePath());
    this.mcDataDir = par6File;
    this.fileAssets = par7File;
    this.fileResourcepacks = par8File;
    this.launchedVersion = par10Str;
    this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets);
    this.addDefaultResourcePack();
    this.proxy = par9Proxy;
    this.startTimerHackThread();
    this.session = par1Session;
    this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername());
    //this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid...
    this.isDemo = par5;
    this.displayWidth = par2;
    this.displayHeight = par3;
    this.tempDisplayWidth = par2;
    this.tempDisplayHeight = par3;
    this.fullscreen = par4;
    ImageIO.setUseCache(false);
    StatList.nopInit();
}
项目:BetterNutritionMod    文件:Minecraft.java   
public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str)
{
    theMinecraft = this;
    this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(par6File, "output-client.log")).getAbsolutePath());
    this.mcDataDir = par6File;
    this.fileAssets = par7File;
    this.fileResourcepacks = par8File;
    this.launchedVersion = par10Str;
    this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets);
    this.addDefaultResourcePack();
    this.proxy = par9Proxy;
    this.startTimerHackThread();
    this.session = par1Session;
    this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername());
    //this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid...
    this.isDemo = par5;
    this.displayWidth = par2;
    this.displayHeight = par3;
    this.tempDisplayWidth = par2;
    this.tempDisplayHeight = par3;
    this.fullscreen = par4;
    ImageIO.setUseCache(false);
    StatList.nopInit();
}
项目:CreeperHostGui    文件:Client.java   
@Override
public UUID getUUID()
{
    if (cache != null)
        return cache;
    Minecraft mc = Minecraft.getMinecraft();
    Session session = mc.getSession();
    boolean online = true;
    if (session.getToken().length() != 32 || session.getPlayerID().length() != 32)
    {
        online = false;
    }

    UUID uuid;

    if (online)
    {
        PlayerProfileCache playerprofilecache = new PlayerProfileCache(MinecraftServer.getServer(), new File(mc.mcDataDir, MinecraftServer.field_152367_a.getName()));
        uuid = playerprofilecache.func_152655_a(Minecraft.getMinecraft().getSession().getUsername()).getId();
    }
    else
    {
        uuid = EntityPlayer.func_146094_a(new GameProfile(null, session.getUsername().toLowerCase()));
    }
    cache = uuid;
    return uuid;
}
项目:CreeperHostGui    文件:Client.java   
@Override
public UUID getUUID()
{
    if (cache != null)
        return cache;
    Minecraft mc = Minecraft.getMinecraft();
    Session session = mc.getSession();
    boolean online = true;
    if (session.getToken().length() != 32 || session.getPlayerID().length() != 32)
    {
        online = false;
    }

    UUID uuid;

    if (online)
    {
        YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(mc.getProxy(), UUID.randomUUID().toString());
        GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
        PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(mc.mcDataDir, MinecraftServer.USER_CACHE_FILE.getName()));
        uuid = playerprofilecache.getGameProfileForUsername(Minecraft.getMinecraft().getSession().getUsername()).getId();
    }
    else
    {
        uuid = EntityPlayer.getOfflineUUID(session.getUsername().toLowerCase());
    }
    cache = uuid;
    return uuid;
}
项目:DecompiledMinecraft    文件:GameConfiguration.java   
public UserInformation(Session p_i46375_1_, PropertyMap p_i46375_2_, PropertyMap p_i46375_3_, Proxy p_i46375_4_)
{
    this.session = p_i46375_1_;
    this.userProperties = p_i46375_2_;
    this.field_181172_c = p_i46375_3_;
    this.proxy = p_i46375_4_;
}
项目:BaseClient    文件:LoginThread.java   
private Session createSession(String email, String pass) {
    YggdrasilAuthenticationService service = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
    YggdrasilUserAuthentication authentication = (YggdrasilUserAuthentication)service.createUserAuthentication(Agent.MINECRAFT);
    authentication.setUsername(email);
    authentication.setPassword(pass);
    try {
        authentication.logIn();
        return new Session(authentication.getSelectedProfile().getName(), authentication.getSelectedProfile().getId().toString(), authentication.getAuthenticatedToken(), "legacy");
    }
    catch (AuthenticationException e) {
        return null;
    }
}
项目:BaseClient    文件:GameConfiguration.java   
public UserInformation(Session p_i46375_1_, PropertyMap p_i46375_2_, PropertyMap p_i46375_3_, Proxy p_i46375_4_)
{
    this.session = p_i46375_1_;
    this.userProperties = p_i46375_2_;
    this.field_181172_c = p_i46375_3_;
    this.proxy = p_i46375_4_;
}
项目:BaseClient    文件:GameConfiguration.java   
public UserInformation(Session p_i46375_1_, PropertyMap p_i46375_2_, PropertyMap p_i46375_3_, Proxy p_i46375_4_)
{
    this.session = p_i46375_1_;
    this.userProperties = p_i46375_2_;
    this.field_181172_c = p_i46375_3_;
    this.proxy = p_i46375_4_;
}
项目:UniversalRemote    文件:MinecraftProxy.java   
public MinecraftProxy(Minecraft realMinecraft) throws IllegalAccessException {
    // random stuff to make base constructor work
    super(new GameConfiguration(
            new GameConfiguration.UserInformation(new Session("notarealuser",null,null,"mojang"), null, null, null),
            new GameConfiguration.DisplayInformation(0, 0, false, false),
            new GameConfiguration.FolderInformation(null, null, null, null),
            new GameConfiguration.GameInformation(false, null, null),
            new GameConfiguration.ServerInformation(null, 0)));

    // now fix INSTANCE
    InjectionHandler.writeStaticFieldOfType(Minecraft.class, realMinecraft, Minecraft.class);

    m_realMinecraft = realMinecraft;
}
项目:Proyecto-DASI    文件:AuthenticationHelper.java   
public static boolean setPlayerName(Session currentSession, String newPlayerName)
{
    if (currentSession.getUsername().equals(newPlayerName))
        return true;

    // Create new session object:
    Session newSession = new Session(newPlayerName, currentSession.getPlayerID(), currentSession.getToken(), currentSession.getSessionType().toString());
    return setSession(newSession);
}