public LocalUser(LocalUser clone) : base(clone) { Client = clone.Client; Stream = clone.Stream; Server = clone.Server; Encrypted = clone.Encrypted; Ping = clone.Ping; IsAuthenticated = clone.IsAuthenticated; if (clone.PingTimer.Change(Timeout.Infinite, Timeout.Infinite)) { clone.PingTimer.Dispose(); } PingTimer = new Timer(PingProc); PingTimer.Change(Server.Settings.PingTimeout, Server.Settings.PingTimeout); Initialize(); BeginRead(); }
public LocalUser(Server server, TcpClient client, HostMask mask, bool encrypted) : base(server, Locations.Local, mask, Authorizations.Connecting) { Server = server; Client = client; PingTimer = new Timer(PingProc); Encrypted = encrypted; if (encrypted) { IsAuthenticated = false; Stream = new SafeStream(client.GetStream(), Server.Certificates.Certificate); } else { IsAuthenticated = true; Stream = new SafeStream(client.GetStream(), null); } PingTimer = new Timer(PingProc); OnPing(); Initialize(); }