private void CheckPassword(string requestPassword)
        {
            if (requestPassword == settingsPassword)
            {
                infoRequest = new LdpClientInfoRequestHandler();

                authResponse = packetFactory.SetAuthResponse(true);
                responsePacket = packetFactory.BuildPacket(authResponse);
                serverHandler.GetSenderChannel.Send(responsePacket);
                LdpLog.Info("Auth successfull.");
                serverHandler.GetListenerChannel.RemoveListener(this);
            }
            else
            {
                authResponse = packetFactory.SetAuthResponse(false);
                responsePacket = packetFactory.BuildPacket(authResponse);
                serverHandler.GetSenderChannel.Send(responsePacket);
                LdpLog.Info("Auth failed: wrong password.");
                serverHandler.GetListenerChannel.RemoveListener(this);
            }
        }
Esempio n. 2
0
        private void CheckPassword(string requestPassword)
        {
            if (requestPassword == settingsPassword)
            {
                infoRequest = new LdpClientInfoRequestHandler();

                authResponse   = packetFactory.SetAuthResponse(true);
                responsePacket = packetFactory.BuildPacket(authResponse);
                serverHandler.GetSenderChannel.Send(responsePacket);
                LdpLog.Info("Auth successfull.");
                serverHandler.GetListenerChannel.RemoveListener(this);
            }
            else
            {
                authResponse   = packetFactory.SetAuthResponse(false);
                responsePacket = packetFactory.BuildPacket(authResponse);
                serverHandler.GetSenderChannel.Send(responsePacket);
                LdpLog.Info("Auth failed: wrong password.");
                serverHandler.GetListenerChannel.RemoveListener(this);
            }
        }