示例#1
0
    /// <summary>
    /// 네트워크 상태 변경시 호출될 콜백 매소드.
    /// </summary>
    /// <param name="server_token"></param>
    void on_status_changed(NETWORK_EVENT status)
    {
        switch (status)
        {
        // 접속 성공.
        case NETWORK_EVENT.connected:
        {
            CLogManager.log("on connected");
            this.received_msg += "on connected\n";

            //   if (SaveServer == false)
            GetComponent <CMainTitle>().on_connected();
            //else
            //    GetComponent<CSaveServerNet>().on_connected();
        }
        break;

        // 연결 끊김.
        case NETWORK_EVENT.disconnected:
            GetComponent <CMainTitle>().on_Disconnected();
            CLogManager.log("disconnected");
            this.received_msg += "disconnected\n";

            Awake();
            break;
        }
    }
示例#2
0
        private void shipButton_Click(object sender, EventArgs e)
        {
            shipButton.Enabled    = false;
            shipProgressBar.Value = 0;
            new Thread(new ThreadStart(() =>
            {
                mLog.log("GetShippingLabelList:" + SysConfig.LGNUM + ":" + this.shipDateTime.Value.Date.ToString("yyyyMMdd"));
                List <ShippingLabel> shipList = SAPDataService.GetShippingLabelList(SysConfig.LGNUM
                                                                                    , this.shipDateTime.Value.Date.ToString("yyyyMMdd"));
                if (shipList != null)
                {
                    Invoke(new Action(() => { shipProgressBar.Maximum = shipList.Count; }));

                    int failCount = 0;

                    foreach (ShippingLabel sl in shipList)
                    {
                        Invoke(new Action(() => { shipProgressBar.Value++; }));
                        if (!LocalDataService.SaveShippingLabelNew(sl))
                        {
                            failCount++;
                        }
                    }

                    string log = string.Format("手工下载货运{0}条,失败{1}条", shipList.Count, failCount);
                    Invoke(new Action(() =>
                    {
                        shipLogLabel.Text      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + log;
                        shipLogLabel.BackColor = failCount > 0 ? Color.Red : Color.White;
                    }));
                }
                else
                {
                    string log = string.Format("手工下载货运0条,失败0条");
                    Invoke(new Action(() =>
                    {
                        shipLogLabel.Text      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + log;
                        shipLogLabel.BackColor = Color.White;
                    }));
                }

                Invoke(new Action(() => { shipButton.Enabled = true; }));
            })).Start();
        }
示例#3
0
    void on_status_changed(NETWORK_EVENT status)
    {
        switch (status)
        {
        case NETWORK_EVENT.connected:
        {
            CLogManager.log("on connected");
            this.txtServerMsg.text = "on connected\n";

            GameObject.Find("MainTitle").GetComponent <NetworkTitle>().on_connected();
        }
        break;

        case NETWORK_EVENT.disconnected:
            CLogManager.log("disconnected");
            this.txtServerMsg.text = "disconnected\n";
            break;
        }
    }
    /// <summary>
    /// 네트워크 상태 변경시 호출될 콜백 매소드.
    /// </summary>
    /// <param name="server_token"></param>
    void on_status_changed(NETWORK_EVENT status)
    {
        switch (status)
        {
        // 접속 성공.
        case NETWORK_EVENT.connected:
        {
            CLogManager.log("on connected");
            this.received_msg += "on connected\n";

            GameObject.Find("MainTitle").GetComponent <CMainTitle>().on_connected();
        }
        break;

        // 연결 끊김.
        case NETWORK_EVENT.disconnected:
            CLogManager.log("disconnected");
            this.received_msg += "disconnected\n";
            break;
        }
    }
示例#5
0
    void on_status_changed(NETWORK_EVENT status)
    {
        switch (status)
        {
        case NETWORK_EVENT.connected:
        {
            CLogManager.log("on connected");
            this.received_msg += "on connected\n";
            user_state         = USER_STATE.CONNECTED;
            break;
        }

        case NETWORK_EVENT.disconnected:
        {
            CLogManager.log("disconnected");
            this.received_msg += "disconnected\n";
            user_state         = USER_STATE.NOT_CONNECTED;
            break;
        }
        }
    }
示例#6
0
    /// <summary>
    /// 네트워크 상태 변경시 호출될 콜백 매소드.
    /// </summary>
    /// <param name="server_token"></param>
    void on_status_changed(NETWORK_EVENT status)
    {
        switch (status)
        {
        // 접속 성공.
        case NETWORK_EVENT.connected:
        {
            CLogManager.log("on connected");
            this.received_msg += "on connected\n";

            //CPacket msg = CPacket.create((short)PROTOCOL.CHAT_MSG_REQ);
            //msg.push("Hello!!!");
            //this.gameserver.send(msg);
        }
        break;

        // 연결 끊김.
        case NETWORK_EVENT.disconnected:
            CLogManager.log("disconnected");
            this.received_msg += "disconnected\n";
            break;
        }
    }