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

📄 yosamabin_n60$submitpoints.java

📁 拉登采矿
💻 JAVA
字号:
import javax.microedition.io.Connection;
import javax.microedition.io.Connector;
import javax.microedition.io.ContentConnection;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;

class SubmitPoints extends Form
  implements CommandListener
{
  private Command cmCancel;
  private Command cmOK;
  private Command cmTry;
  private TextField txtName;
  private String strName;
  private int points;
  private int checkSub;
  public int cnt;
  HttpConnection conn;
  private final YosamaBin_N60 this$0;

  SubmitPoints()
  {
    super("Submit Points");
    this.this$0 = paramYosamaBin_N60;
    this.conn = null;
    this.cmOK = new Command("OK", 1, 1);
    this.cmTry = new Command("Try Again", 1, 1);
    this.cmCancel = new Command("Cancel", 3, 1);
    addCommand(this.cmCancel);
    setCommandListener(this);
  }

  public void scroll()
  {
    if (this.cnt > 0)
      this.cnt += 1;
  }

  public void subPoints()
  {
    String str;
    try
    {
      str = "http://203.199.107.129/wapsite/SubmitScore.asp?game=YosamaBin&name=" + this.strName.replace(' ', '_') + "&score=" + this.points + "&series=60";
      this.conn = ((HttpConnection)Connector.open(str));
      long l = this.conn.getLength();
      while (super.size() > 0)
        super.delete(super.size() - 1);
      removeCommand(this.cmOK);
      removeCommand(this.cmTry);
      YosamaBin_N60.a = 2;
      this.this$0.display.setCurrent(this.this$0.intro);
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      removeCommand(this.cmOK);
      addCommand(this.cmTry);
      while (super.size() >= 1)
        super.delete(super.size() - 1);
      this.checkSub = 0;
      super.append("Connection Failed\n");
    }
  }

  public void commandAction(, Displayable paramDisplayable)
  {
    if (paramCommand == this.cmCancel)
    {
      while (super.size() > 0)
        super.delete(super.size() - 1);
      removeCommand(this.cmOK);
      removeCommand(this.cmTry);
      if (this.this$0.subPts.conn != null)
        try
        {
          this.this$0.subPts.conn.close();
        }
        catch (Exception localException)
        {
        }
      YosamaBin_N60.a = 2;
      this.this$0.display.setCurrent(this.this$0.intro);
      this.checkSub = 0;
    }
    else if (paramCommand == this.cmOK)
    {
      this.checkSub += 1;
      if (this.checkSub == 1)
      {
        this.cnt = 1;
        subPoints();
        super.append("Submiting your score please wait...");
      }
    }
    else if (paramCommand == this.cmTry)
    {
      this.checkSub += 1;
      if (this.checkSub == 1)
      {
        this.cnt = 1;
        while (super.size() > 1)
          super.delete(super.size() - 1);
        super.append("Submiting your score please wait...");
      }
    }
  }

  public void setData(, String paramString)
  {
    this.points = paramInt;
    this.cnt = 0;
    this.checkSub = 0;
    this.strName = new String(paramString);
    super.append("Name " + paramString + "\nScore " + paramInt + "\n");
    addCommand(this.cmOK);
  }

  public int getData()
  {
    return this.points;
  }
}

⌨️ 快捷键说明

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