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(); }
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); }
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); } }