예제 #1
0
        public async static void ForgotPwdClientRequest(int _fromClient, Packet _packet)
        {
            try
            {
                // Getting the parameter from Client Packet ForgotPassword Request Pwd Change
                int    _clientIdCheck = _packet.ReadInt();
                string _username      = _packet.ReadString();

                if (_fromClient == _clientIdCheck)
                {
                    // Check in DB if Email is Right to improve Random Forget Password Requests
                    await SignInClients.ClientForgotPwdRequest(_username, _fromClient);
                }
            }
            catch (Exception e)
            {
                NlogClass.target.WriteAsyncLogEvent(new AsyncLogEventInfo(new LogEventInfo(LogLevel.Error, "ForgotPwdClientRequest", "Client Username : "******" | Read the Packet failed | Exception : " + e), NlogClass.exceptions.Add));
            }
        }
예제 #2
0
        public async static void GetForgotPwd(int _fromClient, Packet _packet)
        {
            try
            {
                // Getting the parameter from Client Packet ForgotPassword Request Pwd Change
                int    _clientIdCheck = _packet.ReadInt();
                string _username      = _packet.ReadString();
                string _code          = _packet.ReadString();
                string _newPwd        = _packet.ReadString();

                if (_fromClient == _clientIdCheck)
                {
                    await SignInClients.ResetPwdForgot(_username, _code, _fromClient, _newPwd);
                }
            }
            catch (Exception e)
            {
                NlogClass.target.WriteAsyncLogEvent(new AsyncLogEventInfo(new LogEventInfo(LogLevel.Error, "GetForgotPwd", "Client Username : "******" | Read the Packet failed | Exception : " + e), NlogClass.exceptions.Add));
            }
        }
예제 #3
0
 public async void SignInToCognito(string _username, string _password)
 {
     //Console.WriteLine("SignUpToCognito Return :"+_signUpReturn);
     if (SecurityCheck.CheckUserPattern(_username))
     {
         if (SecurityCheck.CheckPasswordPattern(_password))
         {
             // This will SET a UserCognito with Valid Tokens on my Client.
             // And send the tokens to the Client who has Sign In
             //Server.clients[_fromClient].player.
             myUser = new CognitoUser(_username, Constants.CLIENTAPP_ID, Server.cognitoManagerServer.userPool, Server.cognitoManagerServer.provider, Constants.NeokySecret);
             await SignInClients.SignInClientToCognito(_username, _password, id);
         }
         else
         {
             ServerSend.AuthenticationStatus(id, Constants.AUTHENTIFICATION_FORMAT_PASSWORD_KO);
         }
     }
     else
     {
         ServerSend.AuthenticationStatus(id, Constants.AUTHENTIFICATION_FORMAT_USERNAME_KO);
     }
 }