Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
static void Client_Connected(object sender, EventArgs e)
{
Server server = GetServerFromSender(sender);
server.Client.LocalUser.JoinedChannel += new EventHandler<IrcChannelEventArgs>(LocalUser_JoinedChannel);
server.Client.LocalUser.NoticeReceived += new EventHandler<IrcMessageEventArgs>(LocalUser_NoticeReceived);
server.Client.ProtocolError += new EventHandler<IrcProtocolErrorEventArgs>(Client_ProtocolError);
server.Client.Disconnected += new EventHandler<EventArgs>(Client_Disconnected);
server.Client.PongReceived += new EventHandler<IrcPingOrPongReceivedEventArgs>(Client_PongReceived);
server.Client.PingReceived += new EventHandler<IrcPingOrPongReceivedEventArgs>(Client_PingReceived);
server.Client.LocalUser.ModesChanged += new EventHandler<EventArgs>(LocalUser_ModesChanged);
server.Client.Channels.Join(server.Channels.ToArray());
if (server.Password != null)
server.Client.LocalUser.SendMessage("NickServ", "identify " + server.Password);
server.Client.LocalUser.MessageReceived += new EventHandler<IrcMessageEventArgs>(LocalUser_MessageReceived);
Timer timer = new Timer(new TimerCallback((object o) =>
{
Console.WriteLine("-->PING");
server.Client.Ping("adams.freenode.net");
}), null, 10000, 10000);
}
static void LocalUser_ModesChanged(object sender, EventArgs e)
{
Console.WriteLine("Mode has changed.");
}
static void Client_PingReceived(object sender, IrcPingOrPongReceivedEventArgs e)
{
Console.WriteLine("<--PING");
}
static void Client_PongReceived(object sender, IrcPingOrPongReceivedEventArgs e)
{
Console.WriteLine("<--PONG");
}
static void Client_Disconnected(object sender, EventArgs e)
{
Console.WriteLine("DISCONNECTED");
}
static void Client_ProtocolError(object sender, IrcProtocolErrorEventArgs e)
{
Console.WriteLine("ERROR: " + e.Code.ToString() + ": " + e.Message);
}
static void LocalUser_NoticeReceived(object sender, IrcMessageEventArgs e)
{
Console.WriteLine("-" + e.Source + "-: " + e.Text);
}
static void LocalUser_JoinedChannel(object sender, IrcChannelEventArgs e)
{
e.Channel.MessageReceived += new EventHandler<IrcMessageEventArgs>(Channel_MessageReceived);
e.Channel.ModesChanged += new EventHandler<EventArgs>(Channel_ModesChanged);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.