public void RegisterAccount(REQ_RegisterAccount account)
        {
            Log.Info("客户请求注册账号,来自IP:{0},注册UserID:{1}", tcpSession.RemoteIPEndPoint, account.UserID);

            if (account.RegisterAccountType == RegisterAccountType.StandardAccount)
            {
                bool result = false;
                try
                {
                    result = _userService.InsertStandardAccount(
                        new SP_InsertStandardAccount_Params(account.UserID, account.PasswordHash,
                                                            account.DisplayName, DateTime.Now.AddDays(TcpServer.LoginGiveUseTime), (int)Role.NormalUser));
                    if (result == false)
                    {
                        goto RegisterFailed;
                    }
                    else
                    {
                        Log.Info("客户请求注册账号成功,来自IP:{0},注册UserID:{1}", tcpSession.RemoteIPEndPoint, account.UserID);
                        PopMessageBox("注册成功!");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    goto RegisterFailed;
                }

RegisterFailed:
                Log.Error("客户请求注册账号失败,来自IP:{0},注册UserID:{1}", tcpSession.RemoteIPEndPoint, account.UserID);
                PopMessageBox("注册失败!");
            }
            // 预留QQ账户
        }
Esempio n. 2
0
        public void RegisterAccount(string userID, string passwordHash, string displayName)
        {
            REQ_RegisterAccount req = new REQ_RegisterAccount()
            {
                UserID              = userID,
                PasswordHash        = passwordHash,
                DisplayName         = displayName,
                RegisterAccountType = RegisterAccountType.StandardAccount
            };

            this.Send(req);
        }