Esempio n. 1
0
    IEnumerator TestUnload()
    {
        ZLog.D(this, "start coroutine");
        yield return(new WaitForSeconds(_waitSenconds));

        this.DoUnload();
    }
Esempio n. 2
0
    void ClickCall(object[] args)
    {
        string req = _component.iptFight.text;

        _download.AddPostData(_url, Encoding.UTF8.GetBytes(req), OnDownloadOk);
        ZLog.D(this, "click button req {0}", req);
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     //if (Debug.isDebugBuild)
     //    Debug.Log("This is a debug build!");
     ZLog.D(this, "hello");
     ZLog.D(this, "hello message");
     CnUIMgr.Instance.LoadPanelShow <SimplePanel>("panel");
 }
Esempio n. 4
0
 public LuaWebSocket(LuaTable sp)
 {
     ZLog.D(null, "in LuaWebSocket");
     Init(this, LuaMain.Ins);
     LuaMain.Ins.quitDl += OnQuit;
     scriptEnv           = sp;
     Register();
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        ZLog.D(this, "start socket order {0}", this.ZOrder);

        _component._btn1.transform.Find("Text").GetComponent <Text>().text = "connect";
        SetClickEventOnce(_component._btn1, ClickBtnConnet, new object[] { "cnt" });


        _component._btn2.transform.Find("Text").GetComponent <Text>().text = "disconnect";
        SetClickEventOnce(_component._btn2, ClickDisconnet, new object[] { "dis" });

        _component._btn3.transform.Find("Text").GetComponent <Text>().text = "ping";
        SetClickEventOnce(_component._btn3, ClickBtnSendPing, new object[] { "ping" });

        _component._text.text = "init";

        _ws = new ZbyWebSocket(this, this);
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        ZLog.D(this, "start socket order {0}", this.ZOrder);

        _component._btn1.transform.Find("Text").GetComponent <Text>().text = "connect";
        SetClickEventOnce(_component._btn1, ClickBtnConnet, new object[] { "cnt" });


        _component._btn2.transform.Find("Text").GetComponent <Text>().text = "disconnect";
        SetClickEventOnce(_component._btn2, ClickDisconnet, new object[] { "dis" });

        _component._text.text = "init";

        _socket = new Chat_Socket(this);

        _socket.ChatEvent    += OnRecvChat;
        _socket.ConnectEvent += OnConnetEvent;
        _socket.DisEvent     += OnDisconnectEvent;
    }
Esempio n. 7
0
    bool HandleMsg(P32M32Header header, byte[] body, int handleCount)
    {
        ByteBuffer bb = new ByteBuffer(body);

        switch (header.cmd)
        {
        case 3:
        {
            string name    = bb.ReadString();
            string content = bb.ReadString();
            string show    = string.Format("recv [{0}]:{1}", name, content);
            ZLog.D(null, show);
            if (null != ChatEvent)
            {
                ChatEvent(show);
            }
            break;
        }
        }
        return(true);
    }
Esempio n. 8
0
    // Start is called before the first frame update
    void Start()
    {
        ZLog.D(this, "start");
        StringBuilder sb = new StringBuilder();

        sb.AppendFormat("absoluteURL:{0}\n", Application.absoluteURL);
        sb.AppendFormat("dataPath:{0}\n", Application.dataPath);
        sb.AppendFormat("consoleLogPath:{0}\n", Application.consoleLogPath);
        sb.AppendFormat("persistentDataPath:{0}\n", Application.persistentDataPath);
        sb.AppendFormat("streamingAssetsPath:{0}\n", Application.streamingAssetsPath);
        sb.AppendFormat("temporaryCachePath:{0}\n", Application.temporaryCachePath);
        sb.AppendFormat("UserDocumentPath:{0}\n", OSTools.GetUserDocumentPath());


        _component.iptFight.text = sb.ToString();
        Text txt = _component.btnSend.GetComponentInChildren <Text>();

        txt.text = "加载配置";
        SetClickEventOnce(_component.btnSend, ClickCall, null);
        //_component.btnSend.Text = "hello";
    }
Esempio n. 9
0
    void ClickBtnConnet(object[] args)
    {
        //ZLog.D(this, "click connect args {0}", args[0]);
        string luazip = Application.streamingAssetsPath + "/core.zip";

        using (ZipFile zip = new ZipFile(luazip))
        {
            foreach (ZipEntry entry in zip)
            {
                //ZipFile zipFile = new ZipFile(zipFile.GetInputStream(entry));
                ZLog.D(this, entry.Name);
                using (var stream = zip.GetInputStream(entry))
                {
                    byte[] buffer = new byte[entry.Size];
                    stream.Read(buffer, 0, buffer.Length);
                    ZLog.D(this, "{0}", Encoding.UTF8.GetString(buffer));
                    break;
                    // return true;
                }
            }
        }
    }
Esempio n. 10
0
 void ClickBtnConnet(object[] args)
 {
     ZLog.D(this, "click connect args {0}", args[0]);
     _ws.Open(_url);//"ws://localhost:8000/ws"
 }
Esempio n. 11
0
 void ClickDisconnet(object[] args)
 {
     ZLog.D(this, "click connect args {0}", args[0]);
     _socket.Close();
 }
Esempio n. 12
0
 void ClickCall(object[] args)
 {
     ZLog.D(null, "click button");
     this.DoUnload();
 }
Esempio n. 13
0
 public override void OnLoad(params object[] args)
 {
     ZLog.D(null, "onload order {0}", this.ZOrder);
     SetClickEventOnce(_component._btn1, ClickCall, new object[] { "Call java" });
 }
Esempio n. 14
0
 //
 public override void OnLoad(params object[] args)
 {
     _waitSenconds = (float)args[0];
     ZLog.D(this, "onload order {0}", this.ZOrder);
 }
Esempio n. 15
0
 void ClickBtnSendPing(object[] args)
 {
     ZLog.D(this, "click connect args {0}", args[0]);
     //_ws.ping();
 }
Esempio n. 16
0
 // Use this for initialization
 void Start()
 {
     ZLog.D(this, "start order {0}", this.ZOrder);
     this.StartCoroutine("TestUnload");
 }
Esempio n. 17
0
 public override void OnLoad(params object[] args)
 {
     ZLog.D(this, "onload order {0}", this.ZOrder);
 }
Esempio n. 18
0
 public override void OnTop(CnPanelObj topview) //从后层变到顶层
 {
     ZLog.D(this, "OnTop order {0}", this.ZOrder);
 }
Esempio n. 19
0
 void ClickCall(object[] args)
 {
     _method = _component.iptMethod.text;
     _param  = _component.iptParam.text;
     ZLog.D(this, "click button method {0}({1})", _method, _param);
 }
Esempio n. 20
0
 public override bool OnUnload()
 {
     ZLog.D(this, "onunload order {0}", this.ZOrder);
     return(true);
 }
Esempio n. 21
0
 void OnDownloadOk(WWW www, DownloadData urlData)
 {
     ZLog.D(this, "recv {0}", Encoding.UTF8.GetString(www.bytes));
 }
Esempio n. 22
0
 // Start is called before the first frame update
 void Start()
 {
     ZLog.D(this, "in start url {0}", _url);
     SetClickEventOnce(_component.btnSend, ClickCall, new object[] { "Call java" });
     _download = this.gameObject.AddComponent <DownloadQueue>();
 }
Esempio n. 23
0
 void ClickBtnConnet(object[] args)
 {
     ZLog.D(this, "click connect args {0}", args[0]);
     _socket.Connect(Host, Port);
 }
Esempio n. 24
0
 public override void OnLoad(params object[] args)
 {
     ZLog.D(this, "onload order {0} url {1}", this.ZOrder, args[0]);
     _url = args[0] as String;
 }
Esempio n. 25
0
 public override void OnLoad(params object[] args)
 {
     ZLog.D(this, "onload order {0} ip {1}:{2}", this.ZOrder, args[0], args[1]);
     Host = args[0] as String;
     Port = (int)args[1];
 }
Esempio n. 26
0
 void Awake()
 {
     ZLog.D(this, "awake");
 }
Esempio n. 27
0
 public override void OnBehind(CnPanelObj topview) //从顶层移到后一层
 {
     ZLog.D(this, "OnBehind order {0}", this.ZOrder);
 }
Esempio n. 28
0
 // Start is called before the first frame update
 void Start()
 {
     ZLog.D(this, "in start url {0}", _url);
     SetClickEventOnce(_component.btnSend, ClickCall, new object[] { "Call java" });
     _ws = new ZbyWebSocket(this, this);
 }
Esempio n. 29
0
 public override void OnLoad(params object[] args)
 {
     _url = args[0] as string;
     ZLog.D(this, "onload order {0}", this.ZOrder);
 }
Esempio n. 30
0
 // Use this for initialization
 void Start()
 {
     ZLog.D(this, "start order {0}", this.ZOrder);
     SetClickEventOnce(_component.btnCall, ClickCall, new object[] { "Call java" });
 }