public void RfcWhowas(string[] nicknames, string count, Priority priority) { this.WriteLine(Rfc2812.Whowas(nicknames, count), priority); }
public void RfcJoin(string channel) => WriteLine(Rfc2812.Join(channel));
public void RfcJoin(string[] channels) => WriteLine(Rfc2812.Join(channels));
public void RfcPrivmsg(string destination, string message, Priority priority) => WriteLine(Rfc2812.Privmsg(destination, message), priority);
public void RfcNotice(string destination, string message, Priority priority) => WriteLine(Rfc2812.Notice(destination, message), priority);
public void RfcUser(string username, int usermode, string realname, Priority priority) => WriteLine(Rfc2812.User(username, usermode, realname), priority);
public void RfcOper(string name, string password, Priority priority) => WriteLine(Rfc2812.Oper(name, password), priority);
public void RfcPing(string server, Priority priority) { this.WriteLine(Rfc2812.Ping(server), priority); }
public void RfcPing(string server, string server2) { this.WriteLine(Rfc2812.Ping(server, server2)); }
public void RfcKill(string nickname, string comment, Priority priority) { this.WriteLine(Rfc2812.Kill(nickname, comment), priority); }
public void RfcKill(string nickname, string comment) { this.WriteLine(Rfc2812.Kill(nickname, comment)); }
public void RfcWhowas(string[] nicknames, string count, string target) { this.WriteLine(Rfc2812.Whowas(nicknames, count, target)); }
public void Deop(string channel, string nickname) { this.WriteLine(Rfc2812.Mode(channel, "-o " + nickname)); }
public void RfcWhowas(string nickname, string count, string target, Priority priority) { this.WriteLine(Rfc2812.Whowas(nickname, count, target), priority); }
public void RfcPass(string password, Priority priority) => WriteLine(Rfc2812.Pass(password), priority);
public void RfcPong(string server) { this.WriteLine(Rfc2812.Pong(server)); }
public void RfcPass(string password) => WriteLine(Rfc2812.Pass(password));
public void RfcPong(string server, string server2, Priority priority) { this.WriteLine(Rfc2812.Pong(server, server2), priority); }
public void RfcUser(string username, int usermode, string realname) => WriteLine(Rfc2812.User(username, usermode, realname));
private void _Worker() { #if LOG4NET Logger.Socket.Debug("IdleWorkerThread started"); #endif try { while (_Connection.IsConnected) { Thread.Sleep(_Connection._IdleWorkerInterval); // only send active pings if we are registered if (!_Connection.IsRegistered) { continue; } DateTime now = DateTime.Now; int last_ping_sent = (int)(now - _Connection._LastPingSent).TotalSeconds; int last_pong_rcvd = (int)(now - _Connection._LastPongReceived).TotalSeconds; // determins if the resoponse time is ok if (last_ping_sent < _Connection._PingTimeout) { if (_Connection._LastPingSent > _Connection._LastPongReceived) { // there is a pending ping request, we have to wait continue; } // determines if it need to send another ping yet if (last_pong_rcvd > _Connection._PingInterval) { _Connection.WriteLine(Rfc2812.Ping(_Connection.Address), Priority.Critical); _Connection._LastPingSent = now; //_Connection._LastPongReceived = now; } // else connection is fine, just continue } else { if (_Connection.IsDisconnecting) { break; } #if LOG4NET Logger.Socket.Warn("ping timeout, connection lost"); #endif // only flag this as connection error if we are not // cleanly disconnecting _Connection.IsConnectionError = true; break; } } } catch (ThreadAbortException) { Thread.ResetAbort(); #if LOG4NET Logger.Socket.Debug("IdleWorkerThread aborted"); #endif } catch (Exception ex) { #if LOG4NET Logger.Socket.Error(ex); #endif } }
public void RfcOper(string name, string password) => WriteLine(Rfc2812.Oper(name, password));
/// <summary> /// Give or take a user's privilege in a channel. /// </summary> /// <param name="modechg">The mode change (e.g. +o) to perform on the user.</param> /// <param name="channel">The channel in which to perform the privilege change.</param> /// <param name="nickname">The nickname of the user whose privilege is being changed.</param> public void ChangeChannelPrivilege(string modechg, string channel, string nickname) => WriteLine(Rfc2812.Mode(channel, modechg + " " + nickname));
public void RfcPrivmsg(string destination, string message) => WriteLine(Rfc2812.Privmsg(destination, message));
/// <summary> /// Fetch a list of entries of a mask-format channel mode. /// </summary> /// <param name="modetype">The type of the mask-format mode (e.g. +b) to fetch.</param> /// <param name="channel">The channel whose mode to fetch.</param> public void ListChannelMasks(string modetype, string channel) => WriteLine(Rfc2812.Mode(channel, modetype));
public void RfcNotice(string destination, string message) => WriteLine(Rfc2812.Notice(destination, message));
/// <summary> /// Fetch a list of entries of a mask-format channel mode. /// </summary> /// <param name="modetype">The type of the mask-format mode (e.g. +b) to fetch.</param> /// <param name="channel">The channel whose mode to fetch.</param> /// <param name="priority">The priority with which the mode-setting message should be sent.</param> public void ListChannelMasks(string modetype, string channel, Priority priority) => WriteLine(Rfc2812.Mode(channel, modetype), priority);
public void RfcJoin(string[] channels, Priority priority) => WriteLine(Rfc2812.Join(channels), priority);
/// <summary> /// Add or remove an entry to/from a mask-format channel mode. /// </summary> /// <param name="modetype">The type of the mask-format mode (e.g. +b) whose entries to modify.</param> /// <param name="channel">The channel whose mode to edit.</param> /// <param name="hostmask">The hostmask of the entry to add/remove.</param> public void ModifyChannelMasks(string modetype, string channel, string hostmask) => WriteLine(Rfc2812.Mode(channel, modetype + " " + hostmask));
public void RfcJoin(string channel, string key, Priority priority) => WriteLine(Rfc2812.Join(channel, key), priority);
public void RfcWhowas(string nickname, string count) { this.WriteLine(Rfc2812.Whowas(nickname, count)); }