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

项目:RuneCraftery    文件:McoClient.java   
private String func_96377_a(Request p_96377_1_) throws ExceptionMcoService {
   p_96377_1_.func_100006_a("sid", this.field_96390_a);
   p_96377_1_.func_100006_a("user", this.field_100007_c);
   p_96377_1_.func_100006_a("version", "1.6.4");

   try {
      int var2 = p_96377_1_.func_96362_a();
      if(var2 == 503) {
         int var3 = p_96377_1_.func_111221_b();
         throw new ExceptionRetryCall(var3);
      } else if(var2 >= 200 && var2 < 300) {
         return p_96377_1_.func_96364_c();
      } else {
         throw new ExceptionMcoService(p_96377_1_.func_96362_a(), p_96377_1_.func_96364_c(), p_96377_1_.func_130110_g());
      }
   } catch (ExceptionMcoHttp var4) {
      throw new ExceptionMcoService(500, "Server not available!", -1);
   }
}
项目:RuneCraftery    文件:RunnableTitleScreen.java   
public void run() {
   McoClient var1 = new McoClient(GuiMainMenu.func_110348_a(this.field_104058_d).func_110432_I());
   boolean var2 = false;

   for(int var3 = 0; var3 < 3; ++var3) {
      try {
         Boolean var4 = var1.func_96375_b();
         if(var4.booleanValue()) {
            GuiMainMenu.func_130021_b(this.field_104058_d);
         }

         GuiMainMenu.func_110349_a(var4.booleanValue());
      } catch (ExceptionRetryCall var6) {
         var2 = true;
      } catch (ExceptionMcoService var7) {
         GuiMainMenu.func_130018_c(this.field_104058_d).func_98033_al().func_98232_c(var7.toString());
      } catch (IOException var8) {
         GuiMainMenu.func_130019_d(this.field_104058_d).func_98033_al().func_98236_b("Realms: could not parse response");
      }

      if(!var2) {
         break;
      }

      try {
         Thread.sleep(10000L);
      } catch (InterruptedException var5) {
         Thread.currentThread().interrupt();
      }
   }

}
项目: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);
        }
    }
}
项目:Resilience-Client-Source    文件:GuiMainMenu.java   
protected void func_130020_g()
{
    if (this.field_96141_q)
    {
        if (!field_96140_r)
        {
            field_96140_r = true;
            (new Thread("MCO Availability Checker #" + field_146973_f.incrementAndGet())
            {
                private static final String __OBFID = "CL_00001155";
                public void run()
                {
                    Session var1 = GuiMainMenu.this.mc.getSession();
                    McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.9", Minecraft.getMinecraft().getProxy());
                    boolean var3 = false;

                    for (int var4 = 0; var4 < 3; ++var4)
                    {
                        try
                        {
                            Boolean var5 = var2.func_148687_b();

                            if (var5.booleanValue())
                            {
                                GuiMainMenu.this.func_130022_h();
                            }

                            GuiMainMenu.field_96139_s = var5.booleanValue();
                        }
                        catch (ExceptionRetryCall var7)
                        {
                            var3 = true;
                        }
                        catch (ExceptionMcoService var8)
                        {
                            GuiMainMenu.logger.error("Couldn\'t connect to Realms");
                        }
                        catch (IOException var9)
                        {
                            GuiMainMenu.logger.error("Couldn\'t parse response connecting to Realms");
                        }

                        if (!var3)
                        {
                            break;
                        }

                        try
                        {
                            Thread.sleep(10000L);
                        }
                        catch (InterruptedException var6)
                        {
                            Thread.currentThread().interrupt();
                        }
                    }
                }
            }).start();
        }
        else if (field_96139_s)
        {
            this.func_130022_h();
        }
    }
}
项目: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    文件:RunnableTitleScreen.java   
public void run()
{
    McoClient mcoclient = new McoClient(GuiMainMenu.func_110348_a(this.theMainMenu).getSession());
    boolean flag = false;

    for (int i = 0; i < 3; ++i)
    {
        try
        {
            Boolean obool = mcoclient.func_96375_b();

            if (obool.booleanValue())
            {
                GuiMainMenu.func_130021_b(this.theMainMenu);
            }

            GuiMainMenu.func_110349_a(obool.booleanValue());
        }
        catch (ExceptionRetryCall exceptionretrycall)
        {
            flag = true;
        }
        catch (ExceptionMcoService exceptionmcoservice)
        {
            GuiMainMenu.func_130018_c(this.theMainMenu).getLogAgent().logSevere(exceptionmcoservice.toString());
        }
        catch (IOException ioexception)
        {
            GuiMainMenu.func_130019_d(this.theMainMenu).getLogAgent().logWarning("Realms: could not parse response");
        }

        if (!flag)
        {
            break;
        }

        try
        {
            Thread.sleep(10000L);
        }
        catch (InterruptedException interruptedexception)
        {
            Thread.currentThread().interrupt();
        }
    }
}
项目: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    文件:RunnableTitleScreen.java   
public void run()
{
    McoClient mcoclient = new McoClient(GuiMainMenu.func_110348_a(this.theMainMenu).getSession());
    boolean flag = false;

    for (int i = 0; i < 3; ++i)
    {
        try
        {
            Boolean obool = mcoclient.func_96375_b();

            if (obool.booleanValue())
            {
                GuiMainMenu.func_130021_b(this.theMainMenu);
            }

            GuiMainMenu.func_110349_a(obool.booleanValue());
        }
        catch (ExceptionRetryCall exceptionretrycall)
        {
            flag = true;
        }
        catch (ExceptionMcoService exceptionmcoservice)
        {
            GuiMainMenu.func_130018_c(this.theMainMenu).getLogAgent().logSevere(exceptionmcoservice.toString());
        }
        catch (IOException ioexception)
        {
            GuiMainMenu.func_130019_d(this.theMainMenu).getLogAgent().logWarning("Realms: could not parse response");
        }

        if (!flag)
        {
            break;
        }

        try
        {
            Thread.sleep(10000L);
        }
        catch (InterruptedException interruptedexception)
        {
            Thread.currentThread().interrupt();
        }
    }
}
项目: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);
        }
    }
}