Java 类net.minecraft.client.mco.McoServerAddress 实例源码

项目:Resilience-Client-Source    文件:TaskOnlineConnect.java   
public void run()
{
    this.func_148417_b(I18n.format("mco.connect.connecting", new Object[0]));
    Session var1 = this.func_148413_b().getSession();
    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
    boolean var3 = false;
    boolean var4 = false;
    int var5 = 5;
    McoServerAddress var6 = null;
    boolean var7 = false;

    for (int var8 = 0; var8 < 10 && !this.func_148418_c(); ++var8)
    {
        try
        {
            var6 = var2.func_148688_b(this.field_148437_e.field_148812_a);
            var3 = true;
        }
        catch (ExceptionRetryCall var10)
        {
            var5 = var10.field_148832_d;
        }
        catch (ExceptionMcoService var11)
        {
            if (var11.field_148830_c == 6002)
            {
                var7 = true;
            }
            else
            {
                var4 = true;
                this.func_148416_a(var11.toString());
                logger.error("Couldn\'t connect to world", var11);
            }

            break;
        }
        catch (IOException var12)
        {
            logger.error("Couldn\'t parse response connecting to world", var12);
        }
        catch (Exception var13)
        {
            var4 = true;
            logger.error("Couldn\'t connect to world", var13);
            this.func_148416_a(var13.getLocalizedMessage());
        }

        if (var3)
        {
            break;
        }

        this.func_148429_a(var5);
    }

    if (var7)
    {
        this.func_148413_b().displayGuiScreen(new GuiScreenReamlsTOS(this.field_148435_f, this.field_148437_e));
    }
    else if (!this.func_148418_c() && !var4)
    {
        if (var3)
        {
            ServerAddress var14 = ServerAddress.func_78860_a(var6.field_148770_a);
            this.func_148432_a(var14.getIP(), var14.getPort());
        }
        else
        {
            this.func_148413_b().displayGuiScreen(this.field_148435_f);
        }
    }
}
项目:RuneCraftery    文件:McoClient.java   
public McoServerAddress func_96374_a(long p_96374_1_) throws ExceptionMcoService, IOException {
   String var3 = field_96388_b + "worlds" + "/$ID/join".replace("$ID", "" + p_96374_1_);
   String var4 = this.func_96377_a(Request.func_96358_a(var3));
   return McoServerAddress.func_98162_a(var4);
}
项目:RuneCraftery    文件:TaskOnlineConnect.java   
public void run() {
   this.func_96576_b(I18n.func_135053_a("mco.connect.connecting"));
   McoClient var1 = new McoClient(this.func_96578_b().func_110432_I());
   boolean var2 = false;
   boolean var3 = false;
   int var4 = 5;
   McoServerAddress var5 = null;

   for(int var6 = 0; var6 < 10 && !this.func_96577_c(); ++var6) {
      try {
         var5 = var1.func_96374_a(this.field_96585_c.field_96408_a);
         var2 = true;
      } catch (ExceptionRetryCall var8) {
         var4 = var8.field_96393_c;
      } catch (ExceptionMcoService var9) {
         var3 = true;
         this.func_96575_a(var9.toString());
         Minecraft.func_71410_x().func_98033_al().func_98232_c(var9.toString());
         break;
      } catch (IOException var10) {
         Minecraft.func_71410_x().func_98033_al().func_98236_b("Realms: could not parse response");
      } catch (Exception var11) {
         var3 = true;
         this.func_96575_a(var11.getLocalizedMessage());
      }

      if(var2) {
         break;
      }

      this.func_111251_a(var4);
   }

   if(!this.func_96577_c() && !var3) {
      if(var2) {
         ServerAddress var12 = ServerAddress.func_78860_a(var5.field_96417_a);
         this.func_96582_a(var12.func_78861_a(), var12.func_78864_b());
      } else {
         this.func_96578_b().func_71373_a(this.field_96584_d);
      }
   }

}
项目:RuneCraftery    文件:TaskOnlineConnect.java   
public void run()
{
    this.setMessage(I18n.getString("mco.connect.connecting"));
    McoClient mcoclient = new McoClient(this.getMinecraft().getSession());
    boolean flag = false;
    boolean flag1 = false;
    int i = 5;
    McoServerAddress mcoserveraddress = null;

    for (int j = 0; j < 10 && !this.wasScreenClosed(); ++j)
    {
        try
        {
            mcoserveraddress = mcoclient.func_96374_a(this.field_96585_c.field_96408_a);
            flag = true;
        }
        catch (ExceptionRetryCall exceptionretrycall)
        {
            i = exceptionretrycall.field_96393_c;
        }
        catch (ExceptionMcoService exceptionmcoservice)
        {
            flag1 = true;
            this.setFailedMessage(exceptionmcoservice.toString());
            Minecraft.getMinecraft().getLogAgent().logSevere(exceptionmcoservice.toString());
            break;
        }
        catch (IOException ioexception)
        {
            Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response");
        }
        catch (Exception exception)
        {
            flag1 = true;
            this.setFailedMessage(exception.getLocalizedMessage());
        }

        if (flag)
        {
            break;
        }

        this.func_111251_a(i);
    }

    if (!this.wasScreenClosed() && !flag1)
    {
        if (flag)
        {
            ServerAddress serveraddress = ServerAddress.func_78860_a(mcoserveraddress.field_96417_a);
            this.func_96582_a(serveraddress.getIP(), serveraddress.getPort());
        }
        else
        {
            this.getMinecraft().displayGuiScreen(this.field_96584_d);
        }
    }
}
项目:BetterNutritionMod    文件:TaskOnlineConnect.java   
public void run()
{
    this.setMessage(I18n.getString("mco.connect.connecting"));
    McoClient mcoclient = new McoClient(this.getMinecraft().getSession());
    boolean flag = false;
    boolean flag1 = false;
    int i = 5;
    McoServerAddress mcoserveraddress = null;

    for (int j = 0; j < 10 && !this.wasScreenClosed(); ++j)
    {
        try
        {
            mcoserveraddress = mcoclient.func_96374_a(this.field_96585_c.field_96408_a);
            flag = true;
        }
        catch (ExceptionRetryCall exceptionretrycall)
        {
            i = exceptionretrycall.field_96393_c;
        }
        catch (ExceptionMcoService exceptionmcoservice)
        {
            flag1 = true;
            this.setFailedMessage(exceptionmcoservice.toString());
            Minecraft.getMinecraft().getLogAgent().logSevere(exceptionmcoservice.toString());
            break;
        }
        catch (IOException ioexception)
        {
            Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response");
        }
        catch (Exception exception)
        {
            flag1 = true;
            this.setFailedMessage(exception.getLocalizedMessage());
        }

        if (flag)
        {
            break;
        }

        this.func_111251_a(i);
    }

    if (!this.wasScreenClosed() && !flag1)
    {
        if (flag)
        {
            ServerAddress serveraddress = ServerAddress.func_78860_a(mcoserveraddress.field_96417_a);
            this.func_96582_a(serveraddress.getIP(), serveraddress.getPort());
        }
        else
        {
            this.getMinecraft().displayGuiScreen(this.field_96584_d);
        }
    }
}