Esempio n. 1
0
 /// <summary>
 /// 添加监听
 /// </summary>
 /// <param name="ServiceNumber"></param>
 /// <param name="ProjectName"></param>
 /// <param name="isUseCheckNumber"></param>
 /// <param name="action"></param>
 public void OnAddLisenter(string ServiceNumber, string ProjectName, bool isUseCheckNumber = true, System.Action <MTKeyStateType> action = null)
 {
     if (isUseCheckNumber)
     {
         OnConnected     = action;
         checkNumberInfo = new CheckNumberInfo()
         {
             ServiceNumber = ServiceNumber, ProjectName = ProjectName
         };
         CreatCheckNumber(checkNumberInfo);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 创建网络加密
        /// </summary>
        /// <param name="num"></param>
        /// <param name="projectName"></param>
        private void CreatCheckNumber(CheckNumberInfo checkNumberInfo)
        {
            if (encryptionManager == null)
            {
                GameObject obj = new GameObject("[CheckNumber]");
                encryptionManager = obj.AddComponent <EncryptionManager>();
            }

            if (checkNumberInfo != null && encryptionManager != null)
            {
                encryptionManager.Init(checkNumberInfo.ProjectName, checkNumberInfo.ServiceNumber);
            }
            else
            {
                checkNumberInfo = new CheckNumberInfo();
                Debug.Log(checkNumberInfo.ProjectName + " 222: " + checkNumberInfo.ServiceNumber);
                encryptionManager.Init(checkNumberInfo.ProjectName, checkNumberInfo.ServiceNumber);
            }
        }