Ejemplo n.º 1
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close();   //关掉客户端链接
        int protocal = dis == DisType.EXCEPTION ? Protocal.EXCEPTION : Protocal.DISCONNECT;

        NetworkManager.AddEvent(protocal, null);
    }
Ejemplo n.º 2
0
        //тип расцепителя
        private void pbxClearDisType_Click(object sender, EventArgs e)
        {
            dgvcCmbDisTyp.DefaultCellStyle.BackColor = System.Drawing.Color.White;
            if (disCurrent == null)
            {
                bs_disTCbr.DataSource = EquipServices.GetAllDisType();
            }

            disType = null;
            cboCbrDisType.ResetText();

            if (disModel == null)
            {
                if (manufacturer == null)
                {
                    bs_disMCbr.DataSource = EquipServices.GetAllDisModel();
                    cboCbrDisModel.ResetText();
                }
                else
                {
                    bs_disMCbr.DataSource = EquipServices.GetAllDisModel(manufacturer.Id);
                    cboCbrDisModel.ResetText();
                }
            }
            SearchCbr(null);
        }
Ejemplo n.º 3
0
        /* [ Очистить все ] */
        private void btnCbrClear_Click(object sender, EventArgs e)
        {
            CbrDataSourceLoad();
            cboCbrDisModel.Enabled = false;

            foreach (DataGridViewColumn column in dataGridViewCbrSearch.Columns)
            {
                column.DefaultCellStyle.BackColor = Color.White;
            }

            manufacturer = null;
            disCurrent   = null;
            cbCurrent    = null;
            icuValue     = null;
            disType      = null;
            disModel     = null;

            SearchCbr(null);

            foreach (Control ctr in gbxFilterCbr.Controls)
            {
                if (ctr.GetType() == typeof(ComboBox))
                {
                    ctr.ResetText();
                }
            }
        }
Ejemplo n.º 4
0
        private void OnDisconnected(DisType dis, string msg)
        {
            this.mConnectState = false;
            int        protocal = (dis == DisType.Exception) ? 102 : 103;
            ByteBuffer buffer   = new ByteBuffer(Encoding.Default.GetBytes(msg));

            DispatchMessage(protocal, buffer);
        }
Ejemplo n.º 5
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close();   //关掉客户端链接
        int protocal = dis == DisType.Exception ?
                       Protocal.Exception : Protocal.Disconnect;

        NetworkManager.AddEvent(protocal.ToString(), new LuaByteBuffer(new byte[] { }));
        Debug.LogWarning("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 6
0
        /// <summary>
        /// 丢失链接
        /// </summary>
        void OnDisconnected(DisType dis, string msg)
        {
            Close();   //关掉客户端链接
            int protocal = dis == DisType.Exception ?
                           Protocal.Exception : Protocal.Disconnect;

            byte[] buffer = new byte[20];
            NetworkManager.AddEvent(protocal, buffer);
            Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
        }
Ejemplo n.º 7
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close();           //关掉客户端链接
        int protocol = dis == DisType.Exception ? Protocol.Exception : Protocol.Disconnect;

        ByteBuffer buffer = new ByteBuffer();

        buffer.WriteShort((short)protocol);
        NetworkManager.AddEvent(protocol, buffer);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        this.host = "";
        this.port = -1;

        Close(); //关掉客户端链接
        //int protocal = dis == DisType.Exception ? Protocal.Exception : Protocal.Disconnect;

        //Odin.Log.Error("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close(); //关掉客户端链接
        int protocal = dis == DisType.Exception ? Protocal.Exception : Protocal.Disconnect;

        //ByteBuffer buffer = new ByteBuffer();
        //buffer.WriteShort((ushort) protocal);
        NetworkManager.AddMessageEvent((ushort)protocal, null);
        Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 10
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        int protocal = dis == DisType.Exception ?
                       Protocal.Exception : Protocal.Disconnect;

        // ByteBuffer buffer = new ByteBuffer();
        // buffer.WriteShort((ushort)protocal);
        // AddEvent(protocal, buffer);
        AddEvent(protocal, "");
        Debug.LogWarning("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 11
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    private void OnDisconnected(DisType dis, string msg)
    {
        Close(); //关掉客户端链接
        var protocal = dis == DisType.Exception ? Protocal.Exception : Protocal.Disconnect;

        var buffer = new ByteBuffer();

        buffer.WriteInt(protocal);
        NetworkManager.AddEvent(protocal, string.Empty);
        Util.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 12
0
    private void OnDisconnected(DisType dis, string msg)
    {
        //关掉客户端链接
        Close();
        int        protocal = dis == DisType.Exception ? Protocal.Exception : Protocal.Disconnect;
        ByteBuffer buffer   = new ByteBuffer();

        buffer.WriteShort((ushort)protocal);
        //NetworkManager.AddEvent(protocal, buffer);
        //Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 13
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close();   //关掉客户端链接
        int protocal = dis == DisType.Exception ?
                       Protocal.Exception : Protocal.Disconnect;

        ByteBuffer buffer = new ByteBuffer();

        buffer.WriteShort((ushort)protocal);
        // NetworkManager.AddEvent(protocal, buffer);
        m_socketdata.status_data.Enqueue((int)dis);
        Debug.Log("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 14
0
        /// <summary>
        /// 丢失链接
        /// </summary>
        public void Disconnected(DisType dis, string msg)
        {
            bool holdConnected = (client != null);

            Close();

            if (holdConnected)
            {
                lock (mRecvDatas){
                    mRecvDatas.Clear();
                }
                m_NetMgr.OnDisConnected(net_id);
            }
        }
Ejemplo n.º 15
0
	private void OnDisconnected(DisType dis, string msg)
	{
		this.Close();
		int num = (dis != DisType.Exception) ? 103 : 102;
		ByteBuffer byteBuffer = new ByteBuffer();
		byteBuffer.WriteShort((ushort)num);
		NetworkManager.AddEvent(num, byteBuffer);
		Debug.LogError(string.Concat(new object[]
		{
			"Connection was closed by the server:>",
			msg,
			'Distype:>",
			dis
		}));
Ejemplo n.º 16
0
        //тип расцепителя
        private void cboCbrDisType_SelectionChangeCommitted(object sender, EventArgs e)
        {
            disType = cboCbrDisType.SelectedItem as DisType;

            if (disType != null)
            {
                SearchCbr(dgvcCmbDisTyp);
            }
            if (manufacturer != null)
            {
                bs_disMCbr.DataSource = EquipServices.GetAllDisModel(manufacturer.Id, disType.Id);
                cboCbrDisModel.ResetText();
            }
        }
Ejemplo n.º 17
0
    private void OnDisconnected(DisType dis, string msg)
    {
        this.Close();
        int @event = (dis != DisType.Exception) ? 103 : 102;

        NetworkManager.AddEvent(@event, new LuaByteBuffer(Encoding.Default.GetBytes(msg)));
        Debug.LogWarning(string.Concat(new object[]
        {
            "Connection was closed by the server:>",
            msg,
            " Distype:>",
            dis
        }));
    }
Ejemplo n.º 18
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    private void OnDisconnected(DisType dis, string msg = null)
    {
        Close();   //关掉客户端链接

        if (dis == DisType.None)
        {
        }
        else if (dis == DisType.Exception)
        {
        }
        else
        {
        }
        DebugHelper.LogError(string.Format("DisType:> {0} Msg: {1}", dis, msg));
    }
Ejemplo n.º 19
0
 /// <summary>
 /// Calculating the distance between two face features.
 /// </summary>
 /// <param name="faceFeature1">The first input feature</param>
 /// <param name="faceFeature2">The second input feature of the same size and the same type as <paramref name="faceFeature1"/></param>
 /// <param name="disType">Defining the similarity with optional values</param>
 /// <returns>The distance between two face features.</returns>
 public double Match(
     IInputArray faceFeature1,
     IInputArray faceFeature2,
     DisType disType = DisType.Cosine)
 {
     using (InputArray iaFaceFeature1 = faceFeature1.GetInputArray())
         using (InputArray iaFaceFeature2 = faceFeature2.GetInputArray())
         {
             return(CvInvoke.cveFaceRecognizerSFMatch(
                        _ptr,
                        iaFaceFeature1,
                        iaFaceFeature2,
                        disType
                        ));
         }
 }
Ejemplo n.º 20
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        sockteClientState = netState.DisConnected;
        Close();   //关掉客户端链接
        int protocal = dis == DisType.Exception ?
                       Protocal.Exception : Protocal.Disconnect;

        ByteBuffer buffer = new ByteBuffer();

        buffer.WriteShort((ushort)protocal);
        lock (NetworkManager.sEvents)
        {
            NetworkManager.AddEvent(protocal, buffer);
        }
        //Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 21
0
 /// 丢失链接
 private void OnDisconnected(DisType dis, string msg)
 {
     //bool connecting = (null != m_client && m_client.Connected);//记下是否已经连接中的
     Close(); //关掉客户端链接
     if (dis == DisType.Disconnect)
     {        //*断开连接网络广播
         Debug.Log("@net 正常主动断线");
     }
     else if (dis == DisType.ConnectTimeOut)
     {
         Debug.Log("@net 连接服务器超时");
     }
     else if (dis == DisType.Exception)
     {
         Debug.LogError("@net 异常断开服务器:> " + msg + " Distype:>" + dis);
     }
 }
Ejemplo n.º 22
0
        /// <summary>
        /// 丢失链接
        /// </summary>
        void OnDisconnected(DisType dis, string msg)
        {
            if (client != null)
            {
                Close();   //关掉客户端链接
                int protocal = dis == DisType.Exception ?
                               Protocal.Exception : Protocal.Disconnect;

                ByteBuffer buffer = new ByteBuffer();
                buffer.WriteShort((ushort)protocal);
                ConnectObserver.DispatchEvent(protocal, buffer);
                if (ConnectObserver.inReconnect)
                {
                    ConnectObserver.inReconnect = false;
                }
                ConsoleView.LogWarning(string.Format("Connection was closed:>{0} Distype:>{1}", msg, dis));
            }
        }
Ejemplo n.º 23
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close();   //关掉客户端链接

        int        protocal = 0;
        ByteBuffer buffer   = new ByteBuffer();

        if (dis == DisType.Disconnect)
        {
            protocal = Protocal.Disconnect;
        }
        else
        {
            protocal = Protocal.Exception;
            buffer.WriteString("Connection was closed by the server:>" + msg + ", Distype:>" + dis);
        }
        NetWorkManager.AddEvent(protocal, buffer);
    }
Ejemplo n.º 24
0
    private void OnDisconnected(DisType dis, string msg)
    {
        this.Close();
        int        num        = (dis != DisType.Exception) ? 103 : 102;
        ByteBuffer byteBuffer = new ByteBuffer();

        byteBuffer.WriteShort((ushort)num);
        NetworkManager.AddEvent(num, byteBuffer);
        if (AppFacade.Instance.GetManager <NetworkManager>("NetworkManager").inReconnect)
        {
            AppFacade.Instance.GetManager <NetworkManager>("NetworkManager").inReconnect = false;
        }
        Debug.LogWarning(string.Concat(new object[]
        {
            "Connection was closed:>",
            msg,
            " Distype:>",
            dis
        }));
    }
Ejemplo n.º 25
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    private void OnDisconnected(DisType dis, string msg = null)
    {
        Close();   //关掉客户端链接

        if (dis == DisType.None)
        {
            UIDialogMgr.Instance.ShowDialog(10014, delegate(GameObject go) { Application.Quit(); });
        }
        else if (dis == DisType.Exception)
        {
            UIDialogMgr.Instance.ShowDialog(10017, delegate(GameObject go) { Application.Quit(); });
        }
        else
        {
            UIDialogMgr.Instance.ShowDialog(10016, delegate(GameObject go) { NetReceptionMgr.Instance.ReConnect(); }, delegate(GameObject go) { Application.Quit(); });

            //retries = 0;
            //DialogController.Instance.ShowDialog(10016, null, null, delegate (Hashtable ha) { NetReceptionMgr.Instance.ReConnect(); }, delegate (Hashtable ha) { Application.Quit(); });
        }
        DebugHelper.LogError(string.Format("DisType:> {0} Msg: {1}", dis, msg));
    }
Ejemplo n.º 26
0
 void OnDisconnected(DisType dis, string msg)
 {
     Close();   //关掉客户端链接
     Debug.Log("networkmanager on disconnect!" + msg + " trace:" + new System.Diagnostics.StackTrace().ToString());
     AddEvent(onDisConnectCallBack, null);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// 丢失链接
 /// </summary>
 void OnDisconnected(DisType dis, string msg)
 {
     Util.LogForNet("服务器关掉了!");
     Debug.Log("!Connection was closed by the server:>" + msg + " Distype:>" + dis);
     Close();   //关掉客户端链接
 }
Ejemplo n.º 28
0
 /// <summary>
 /// 丢失链接
 /// </summary>
 void OnDisconnected(DisType dis, string msg)
 {
     Debug.Log("OnDisconnected" + msg);
     Close();   //关掉客户端链接
     NetManager.Instance.OnDisConnect();
 }
Ejemplo n.º 29
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg)
    {
        Close();   //关掉客户端链接
        int protocal = dis == DisType.Exception ?
        Protocal.Exception : Protocal.Disconnect;

        ByteBuffer buffer = new ByteBuffer();
        buffer.WriteShort((ushort)protocal);
        
		//NetworkManager.AddEvent(protocal, buffer);
		//TODO: notify Disconnected
        Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
Ejemplo n.º 30
0
 /// <summary>
 /// 丢失链接
 /// </summary>
 void OnDisconnected(DisType dis, string msg)
 {
     Close();   //关掉客户端链接
     NetManager.Instance.OnDisConnect();
 }
Ejemplo n.º 31
0
    /// <summary>
    /// 丢失链接
    /// </summary>
    void OnDisconnected(DisType dis, string msg) {
        sockteClientState = netState.DisConnected;
        Close();   //关掉客户端链接
        int protocal = dis == DisType.Exception ?
        Protocal.Exception : Protocal.Disconnect;

        ByteBuffer buffer = new ByteBuffer();
        buffer.WriteShort((ushort)protocal);
        lock (NetworkManager.sEvents)
        {
            NetworkManager.AddEvent(protocal, buffer);
        }
        //Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }
 /// <summary>
 /// 丢失链接
 /// </summary>
 void OnDisconnected(DisType dis, string msg)
 {
     LogSystem.instance.Log(LogCategory.GameEngine, "OnDisconnected" + msg);
     LogSystem.instance.Log(LogCategory.GameEngine, "======断开连接========");
     Close();   //关掉客户端链接
 }