Example #1
0
 public static JFSocket GetInstance()
 {
     if (instance == null)
     {
         instance = new JFSocket();
     }
     return(instance);
 }
Example #2
0
 public void disConnect()
 {
     if (_net != null)
     {
         _net.Closed();
         if (PlayerSys.getSingleton().getHero() != null)
         {
             PlayerSys.getSingleton().getHero().NotifyRemove("all");
         }
         _net = null;
     }
 }
Example #3
0
 public virtual void Start()
 {
     mJFsorket       = JFSocket.GetInstance();
     MaxHp           = 100;
     CurrentHp       = 100;
     MaxSpeed        = 0.3f;
     Speed_a         = 1;
     ship            = this.gameObject;
     slider          = GameObject.FindGameObjectWithTag("Slider").GetComponent <Slider>();
     slider.maxValue = MaxHp;
     slider.minValue = 0;
     setSlider(CurrentHp);
 }
Example #4
0
 public void connect(string ip, int port, System.Action <object> connectedCB)
 {
     if (false == isConnected())
     {
         _net = JFSocket.getInstance();
         if (connectedCB == null)
         {
             _net.connect(ip, port, OnConnected);
         }
         else
         {
             _net.connect(ip, port, connectedCB);
         }
     }
 }
Example #5
0
 // Use this for initialization
 void Start()
 {
     mJFsorket = JFSocket.GetInstance();
 }
Example #6
0
    // Use this for initialization
    void Start()
    {
        mJFsocket = JFSocket.GetInstance();

        req = "{\"bean\":\"login\",\"method\":\"login\",\"param\":{\"sss\":1,\"token\":\"12345678901234567890123456789012999\"}}";
    }