//主线程调用,当收到一个整包时.
        public bool OnReceiveFullPacket(proto_header head, byte[] block)
        {
            //Initial uin from first message

            /*
             * if (m_SocketInfo.m_Uin == 0 && uin != 0)
             * {
             * m_SocketInfo.m_Uin = uin;
             *
             *      if ( CNetWorkGlobal.Instance.IsDebug )
             * Log.info("CNetWorkGlobal",  "m_SocketInfo.m_Uin set to: " + uin);
             * }*/

            //如果p2p开通

            /*
             * if (m_Ctrl.UdpClient != null) {
             *      if (m_Ctrl.UdpClient.UIN == 0 && uin != 0) {
             *              m_Ctrl.UdpClient.UIN = (uint)uin;
             *              Log.info(this, "m_Ctrl.P2PClient.UIN set to: " + uin);
             *      }
             * }*/

            if (protoList.ContainsKey(head.shMsgID))
            {
                DkRecProto proto = protoList[head.shMsgID];
                proto.respond(head, block);
                return(true);
            }
            else
            {
                Debug.LogError("[CNetWorkGlobal][Receive] Can not find registered msg id " + head.shMsgID);
                return(false);
            }
        }
 /*
  * public void OpenP2P()
  * {
  *  //need p2p?
  * m_Ctrl.InitP2P();
  * }*/
 //注册协议.
 public void registProto(DkRecProto proto)
 {
     if (protoList.ContainsKey(proto.m_head.shMsgID) == false)
     {
         if (CNetWorkGlobal.Instance.IsDebug)
         {
             Log.info("CNetWorkGlobal", "Register Message id:" + proto.m_head.shMsgID);
         }
         protoList.Add(proto.m_head.shMsgID, proto);
     }
 }
 //客户端的P2P消息处理
 public bool ReceiveP2P(proto_header head, byte[] block)
 {
     //设置p2p
     if (protoList.ContainsKey(head.shMsgID))
     {
         DkRecProto proto = protoList[head.shMsgID];
         proto.isP2P = true; //设置p2p标记
         proto.respond(head, block);
         return(true);
     }
     else
     {
         Log.info("CNetWorkGlobal", "can not find res msg id " + head.shMsgID);
         return(false);
     }
 }