private void OnReceive(HostMask prefix, string command, string[] args) { if (Received != null) { IrcEventArgs e = new IrcEventArgs(prefix, command, args); Received.Invoke(this, e); if (e.Handled) { return; } } switch (command) { case "NICK": OnNick(prefix, args); break; case "PING": OnPing(args); break; case "001": OnWelcome(args); break; case "002": OnYourHost(args); break; case "003": OnCreated(args); break; case "004": OnMyInfo(args); break; } }
public IrcEventArgs(HostMask prefix, string command, string[] args) { Prefix = prefix; Command = command; Args = args; Handled = false; }
private void OnNick(HostMask prefix, string[] args) { string oldNick = prefix.Nickname; string newNick = args[0]; if (oldNick.ToLower() == Nickname.ToLower()) Nickname = newNick; Echo("{0} is now known as {1}", oldNick, newNick); }
private void OnNick(HostMask prefix, string[] args) { string oldNick = prefix.Nickname; string newNick = args[0]; if (oldNick.ToLower() == Nickname.ToLower()) { Nickname = newNick; } Echo("{0} is now known as {1}", oldNick, newNick); }
private void OnReceive(HostMask prefix, string command, string[] args) { if (Received != null) { IrcEventArgs e = new IrcEventArgs(prefix, command, args); Received.Invoke(this, e); if (e.Handled) return; } switch (command) { case "NICK": OnNick(prefix, args); break; case "PING": OnPing(args); break; case "001": OnWelcome(args); break; case "002": OnYourHost(args); break; case "003": OnCreated(args); break; case "004": OnMyInfo(args); break; } }