Example #1
0
        public LdpAuthResponse SetAuthResponse(bool authResult)
        {
            var response = LdpAuthResponse.CreateBuilder();

            response.IsSuccess = authResult;
            return(response.Build());
        }
 public LdpPacket BuildPacket(LdpAuthResponse response)
 {
     var packet = LdpPacket.CreateBuilder();
     packet.Type = PacketType.AUTH_RESPONSE;
     packet.AuthResponse = response;
     return packet.Build();
 }
Example #3
0
        public LdpPacket BuildPacket(LdpAuthResponse response)
        {
            var packet = LdpPacket.CreateBuilder();

            packet.Type         = PacketType.AUTH_RESPONSE;
            packet.AuthResponse = response;
            return(packet.Build());
        }
 public void Dispose()
 {
     authResponse = null;
     responsePacket = null;
     serverHandler = null;
     userSettings = null;
     packetFactory = null;
     GC.SuppressFinalize(this);
 }
Example #5
0
 public void Dispose()
 {
     authResponse   = null;
     responsePacket = null;
     serverHandler  = null;
     userSettings   = null;
     packetFactory  = null;
     GC.SuppressFinalize(this);
 }
        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);
            }
        }
Example #7
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);
            }
        }