Exemplo n.º 1
0
 private void OnRegister(MOBAClient client, string account, string password)
 {
     //无效检测
     if (account == null || password == null)
     {
         return;
     }
     //重复检测
     if (accountCache.Has(account))
     {
         Send(client, OperationCode.AccountCode, OpAccount.Register, -1, "账号已存在");
         return;
     }
     accountCache.Add(account, password);
     Send(client, OperationCode.AccountCode, OpAccount.Register, 0, "注册成功");
 }
Exemplo n.º 2
0
        /// <summary>
        /// 注册处理
        /// </summary>
        /// <param name="acc"></param>
        /// <param name="pwd"></param>
        private void onRegister(MobaClient client, string acc, string pwd)
        {
            //无效检测
            if (string.IsNullOrEmpty(acc) ||
                string.IsNullOrEmpty(pwd))
            {
                return;
            }
            //重复检测
            if (cache.Has(acc))
            {
                Send(client, OpCode.AccountCode, OpAccount.Register, -1, "账号重复");
                return;
            }

            cache.Add(acc, pwd);
            Send(client, OpCode.AccountCode, OpAccount.Register, 0, "注册成功");
        }
Exemplo n.º 3
0
 /// <summary>
 /// 注册处理
 /// </summary>
 /// <param name="acc"></param>
 /// <param name="pwd"></param>
 private void OnRegister(MobaClient client, string acc, string pwd)
 {
     MobaApplication.LogInfo("aa");
     //无效检测
     if (acc == null || pwd == null)
     {
         return;
     }
     //重复检测
     if (cache.Has(acc))
     {
         this.Send(client, OpCode.AccountCode, OpAccount.Register, -1, "账号重复");
         return;
     }
     //添加账号
     cache.Add(acc, pwd);
     this.Send(client, OpCode.AccountCode, OpAccount.Register, 0, "注册成功");
 }
Exemplo n.º 4
0
        /// <summary>
        /// 注册处理
        /// </summary>
        /// <param name="acc"></param>
        /// <param name="pwd"></param>
        private void OnRegister(MobaClient client, string acc, string pwd)
        {
            //无效检查
            if (acc == null || pwd == null)
            {
                return;
            }

            if (cache.Has(acc))
            {
                this.Send(client, OpCode.AccountCode, OpAccount.Register, -1, "账号重复");
                return;
            }

            //添加账号
            cache.Add(acc, pwd);
            this.Send(client, OpCode.AccountCode, OpAccount.Register, 0, "注册成功");
        }