import jaclib.ping.Ping;
import java.net.InetAddress;
import java.util.LinkedList;
import java.util.Queue;

public class Class499 implements Runnable {

   Thread aThread5946 = new Thread(this);
   Queue aQueue5947 = new LinkedList();
   Object anObject5948 = new Object();


   void method8340(Object var1) {
      Queue var2 = this.aQueue5947;
      synchronized(var2) {
         this.aQueue5947.add(var1);
         this.aQueue5947.notify();
      }
   }

   public Class519 method8341(String var1, byte var2) {
      if(null == this.aThread5946) {
         if(var2 <= 0) {
            ;
         }

         throw new IllegalStateException("");
      } else if(null == var1) {
         if(var2 <= 0) {
            ;
         }

         throw new IllegalArgumentException("");
      } else {
         Class519 var3 = new Class519(var1);
         this.method8343(var3, (byte)-52);
         return var3;
      }
   }

   public void method8342() {
      while(true) {
         Queue var1 = this.aQueue5947;
         Class519 var4;
         synchronized(var1) {
            Object var2;
            for(var2 = this.aQueue5947.poll(); var2 == null; var2 = this.aQueue5947.poll()) {
               try {
                  this.aQueue5947.wait();
               } catch (InterruptedException var7) {
                  ;
               }
            }

            if(this.anObject5948 == var2) {
               return;
            }

            var4 = (Class519)var2;
         }

         int var9;
         try {
            byte[] var10 = InetAddress.getByName(var4.aString7131).getAddress();
            var9 = Ping.method808(var10[0], var10[1], var10[2], var10[3], 1000L);
         } catch (Throwable var6) {
            var9 = 1000;
         }

         var4.anInt7132 = var9 * 755628833;
      }
   }

   void method8343(Object var1, byte var2) {
      Queue var3 = this.aQueue5947;
      synchronized(var3) {
         this.aQueue5947.add(var1);
         this.aQueue5947.notify();
      }
   }

   public void run() {
      while(true) {
         Queue var1 = this.aQueue5947;
         Class519 var4;
         synchronized(var1) {
            Object var2;
            for(var2 = this.aQueue5947.poll(); var2 == null; var2 = this.aQueue5947.poll()) {
               try {
                  this.aQueue5947.wait();
               } catch (InterruptedException var7) {
                  ;
               }
            }

            if(this.anObject5948 == var2) {
               return;
            }

            var4 = (Class519)var2;
         }

         int var9;
         try {
            byte[] var10 = InetAddress.getByName(var4.aString7131).getAddress();
            var9 = Ping.method808(var10[0], var10[1], var10[2], var10[3], 1000L);
         } catch (Throwable var6) {
            var9 = 1000;
         }

         var4.anInt7132 = var9 * 755628833;
      }
   }

   public void method8344(byte var1) {
      if(null != this.aThread5946) {
         this.method8343(this.anObject5948, (byte)-18);

         try {
            this.aThread5946.join();
         } catch (InterruptedException var3) {
            ;
         }

         this.aThread5946 = null;
      }
   }

   public void method8345() {
      while(true) {
         Queue var1 = this.aQueue5947;
         Class519 var4;
         synchronized(var1) {
            Object var2;
            for(var2 = this.aQueue5947.poll(); var2 == null; var2 = this.aQueue5947.poll()) {
               try {
                  this.aQueue5947.wait();
               } catch (InterruptedException var7) {
                  ;
               }
            }

            if(this.anObject5948 == var2) {
               return;
            }

            var4 = (Class519)var2;
         }

         int var9;
         try {
            byte[] var10 = InetAddress.getByName(var4.aString7131).getAddress();
            var9 = Ping.method808(var10[0], var10[1], var10[2], var10[3], 1000L);
         } catch (Throwable var6) {
            var9 = 1000;
         }

         var4.anInt7132 = var9 * 755628833;
      }
   }

   public void method8346() {
      while(true) {
         Queue var1 = this.aQueue5947;
         Class519 var4;
         synchronized(var1) {
            Object var2;
            for(var2 = this.aQueue5947.poll(); var2 == null; var2 = this.aQueue5947.poll()) {
               try {
                  this.aQueue5947.wait();
               } catch (InterruptedException var7) {
                  ;
               }
            }

            if(this.anObject5948 == var2) {
               return;
            }

            var4 = (Class519)var2;
         }

         int var9;
         try {
            byte[] var10 = InetAddress.getByName(var4.aString7131).getAddress();
            var9 = Ping.method808(var10[0], var10[1], var10[2], var10[3], 1000L);
         } catch (Throwable var6) {
            var9 = 1000;
         }

         var4.anInt7132 = var9 * 755628833;
      }
   }

   public Class519 method8347(String var1) {
      if(null == this.aThread5946) {
         throw new IllegalStateException("");
      } else if(null == var1) {
         throw new IllegalArgumentException("");
      } else {
         Class519 var2 = new Class519(var1);
         this.method8343(var2, (byte)-34);
         return var2;
      }
   }

   public Class519 method8348(String var1) {
      if(null == this.aThread5946) {
         throw new IllegalStateException("");
      } else if(null == var1) {
         throw new IllegalArgumentException("");
      } else {
         Class519 var2 = new Class519(var1);
         this.method8343(var2, (byte)-2);
         return var2;
      }
   }

   public Class499() {
      this.aThread5946.setDaemon(true);
      this.aThread5946.start();
   }

   void method8349(Object var1) {
      Queue var2 = this.aQueue5947;
      synchronized(var2) {
         this.aQueue5947.add(var1);
         this.aQueue5947.notify();
      }
   }

   static final void method8350(Class508 var0, int var1) {
      var0.anInt6003 -= 393249892;
      int var2 = var0.anIntArray6027[-937710807 * var0.anInt6003];
      int var3 = var0.anIntArray6027[-937710807 * var0.anInt6003 + 1];
      int var4 = var0.anIntArray6027[2 + var0.anInt6003 * -937710807];
      int var5 = var0.anIntArray6027[var0.anInt6003 * -937710807 + 3];
      Class548 var6 = client.aClass279_7807.method4909(120597695);
      Class412.method7083((var2 >> 14 & 16383) - -843659437 * var6.anInt7419, (var2 & 16383) - -1518942839 * var6.anInt7420, var3 << 2, var4, var5, false, 1896979010);
   }

   static void method8351(int var0, int var1) {
      for(Class225 var2 = client.aClass423_7883.method7208(-405853513); null != var2; var2 = client.aClass423_7883.method7226(15714938)) {
         if(var1 == -1637153950) {
            ;
         }

         if((-7222396723785363401L * var2.aLong2606 >> 48 & 65535L) == (long)var0) {
            if(var1 == -1637153950) {
               ;
            }

            var2.method3857(-296540827);
         }
      }

   }

   public static final void method8352(boolean var0, byte var1) {
      Class225_Sub15 var2 = Class543.method11415(OutgoingOpcode.aClass302_3851, client.aClass180_7704.aClass433_2184, (byte)1);
      client.aClass180_7704.method3191(var2, (byte)-38);

      for(Class225_Sub4 var3 = (Class225_Sub4)client.aClass423_7832.method7208(-405853513); null != var3; var3 = (Class225_Sub4)client.aClass423_7832.method7226(1404215465)) {
         if(!var3.method3858(1470909732)) {
            var3 = (Class225_Sub4)client.aClass423_7832.method7208(-405853513);
            if(var3 == null) {
               break;
            }
         }

         if(0 == var3.anInt8384 * 1797784371) {
            Class81.method1662(var3, true, var0, 1702276856);
         }
      }

      if(null != client.aClass124_7834) {
         Class460.method7767(client.aClass124_7834, -1870680574);
         client.aClass124_7834 = null;
      }

   }
}
