⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f.java

📁 microtik tool to vie another router in a network
💻 JAVA
字号:
package com.hoya.client;

import com.hoya.games.common.a;
import com.hoya.games.sp.lx;
import com.hoya.util.code.h;
import java.io.PrintStream;
import java.lang.reflect.Field;
import java.util.TreeMap;
import java.util.Vector;

public class f extends Thread
{
  private static Field[] f = ((e == null) ? (f.e = a("com.hoya.client.f")) : e).getDeclaredFields();
  private static TreeMap g;
  private static boolean s = true;
  private String h;
  private int i;
  private String j;
  private String k;
  private String l;
  private g m;
  private Vector n;
  private Vector o;
  public int a = 0;
  private boolean p = false;
  private boolean q = false;
  private boolean r = true;
  private boolean u = false;
  public boolean t = true;
  int b = 0;
  int c = 0;
  long d = -1L;
  static Class e;

  public f(String paramString1, int paramInt, String paramString2, String paramString3, String paramString4)
  {
    b("in SmartGameClientController constructor");
    this.n = new Vector();
    this.o = new Vector();
    this.h = paramString1;
    this.i = paramInt;
    this.j = paramString2;
    this.k = paramString3;
    this.l = paramString4;
    start();
  }

  public final void a()
  {
    if (this.u)
      return;
    this.r = false;
    this.q = false;
    this.p = false;
    this.u = true;
    c("STOP client controller, isAlive:" + isAlive());
    if (this.m != null)
      this.m.f();
  }

  public void run()
  {
    while (this.r)
    {
      Object localObject;
      if ((this.a == 0) || (this.a == -200))
      {
        this.c += 1;
        if (this.d < 0L)
        {
          this.d = System.currentTimeMillis();
          b("###################################################### set try time:" + this.d);
          this.t = false;
        }
        b("try " + this.c + " times to create connection!");
        if ((this.a != 0) && (this.m != null))
          this.m.f();
        this.m = new g(this.h, this.i, this.l);
        a(10);
        b("--------sgc.start();");
        this.m.start();
        c("=======================status:" + this.a);
        if (s)
        {
          if (lx.aQ)
            localObject = this.k + "<@>" + lx.aH + "S," + this.m.p + "/" + this.m.o + ":" + this.m.q;
          localObject = this.k + "<@>" + lx.aH + "," + this.m.p + "/" + this.m.o + ":" + this.m.q;
        }
        this.m.a(h.a(this.j, null), h.a(this.k + "<@>" + lx.aH, null));
        b(((this.m.b(h.a(this.j, null), h.a((String)localObject, null))) ? "send message(C_LOGIN_0),acc:" : "send message(C_LOGIN),acc:") + this.j + ",pass:" + this.k + "<@>" + ((this.m.b(h.a(this.j, null), h.a((String)localObject, null))) ? "S" : lx.aH));
      }
      if (this.m.j);
      if (this.m.h);
      if (this.m.i)
      {
        a(20);
        g();
        this.c = 0;
        if (this.d != -1L)
        {
          this.d = -1L;
          b("###################################################### set try time:" + this.d);
        }
      }
      else if (this.m.g)
      {
        a(15);
      }
      if ((localObject = this.m.a_()) != null)
        if (((a)localObject).c() == 1005)
        {
          a(20);
          this.m.i = true;
          this.m.f = ((a)localObject).d();
          c("set sessionid====>" + ((a)localObject).d());
          this.n.add(localObject);
          if (!(this.j.equals("_")))
          {
            b("===== set isFirst to FALSE");
            s = false;
          }
        }
        else if (((a)localObject).c() == 1095)
        {
          b("time:" + (System.currentTimeMillis() - lx.as));
          if (System.currentTimeMillis() - lx.as < 20000L)
            this.m.h();
          else
            a();
        }
        else
        {
          this.n.add(localObject);
        }
      a(5L, false);
    }
  }

  public final void a(int paramInt)
  {
    if (paramInt == this.a)
      return;
    b("---set status:" + paramInt + ",:" + b(paramInt) + ",origin:" + b(this.a));
    this.a = paramInt;
    switch (paramInt)
    {
    case 15:
      this.p = true;
      return;
    case 20:
      this.q = true;
      return;
    case -100:
      a();
      this.b += 1;
      b("the " + this.b + " times Connection broken");
      return;
    case -200:
      a(1000L, true);
    }
  }

  public final int b()
  {
    return this.n.size();
  }

  public static String b(int paramInt)
  {
    String str = null;
    return (str = (String)g.get(new Integer(paramInt)));
  }

  public final void a(int paramInt, String paramString)
  {
    a locala;
    if (paramString == null)
      paramString = "";
    b("in sendData:" + a.b(paramInt) + ",\t data======>" + paramString);
    (locala = this.m.a(paramInt)).d(paramString);
    this.o.add(locala);
  }

  private synchronized void g()
  {
    if (this.o.size() == 0)
      return;
    while (this.o.size() != 0)
    {
      a locala = (a)this.o.remove(0);
      this.m.a(locala);
    }
  }

  public final a c()
  {
    if (this.n.size() == 0)
      return null;
    return ((a)this.n.remove(0));
  }

  public final boolean h()
  {
    if (this.m == null)
      return false;
    return this.m.h;
  }

  public final boolean d()
  {
    return this.p;
  }

  public final boolean e()
  {
    return this.q;
  }

  public static void a(long paramLong, boolean paramBoolean)
  {
    try
    {
      if (paramBoolean)
        b("pause " + paramLong);
      Thread.sleep(paramLong);
      return;
    }
    catch (InterruptedException localInterruptedException)
    {
    }
  }

  private static void b(String paramString)
  {
    if (lx.aJ)
      System.out.println(paramString);
  }

  private static void c(String paramString)
  {
    if (lx.aJ)
      System.out.println(paramString);
  }

  public final long f()
  {
    return (System.currentTimeMillis() - this.d);
  }

  static
  {
    if (g == null)
    {
      b("---------------------");
      g = new TreeMap();
      for (int i1 = 0; i1 < f.length; ++i1)
        if (f[i1].getName().startsWith("STATUS_"))
          try
          {
            int i2 = f[i1].getInt(f[i1]);
            for (int i3 = 0; i3 < 100; ++i3)
              if (g.get(new Integer(i2)) != null)
                c("ATTTTTT\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
            g.put(new Integer(i2), f[i1].getName());
            b(f[i1].getName() + "\t" + i2);
          }
          catch (Exception localException)
          {
          }
      b("---------------------");
    }
  }

  static Class a(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -