コード例 #1
0
ファイル: Bot.cs プロジェクト: hackerlank/abbot-svn
 void OnReadLineHandler(object sender, Irc.ReadLineEventArgs e)
 {
     if (OnReadLine != null)
     {
         OnReadLine((Network)sender, e);
     }
 }
コード例 #2
0
ファイル: IrcConnection.cs プロジェクト: hackerlank/abbot-svn
        private void _SimpleParser(object sender, ReadLineEventArgs args)
        {
            string rawline = args.Line;

            string[] rawlineex   = rawline.Split(new char[] { ' ' });
            string   messagecode = "";

            if (rawline[0] == ':')
            {
                messagecode = rawlineex[1];
                try {
                    ReplyCode replycode = (ReplyCode)int.Parse(messagecode);
                    switch (replycode)
                    {
                    case ReplyCode.Welcome:
                        _IsRegistered = true;
#if LOG4NET
                        Logger.Connection.Info("logged in");
#endif
                        break;
                    }
                } catch (FormatException) {
                    // nothing
                }
            }
            else
            {
                messagecode = rawlineex[0];
                switch (messagecode)
                {
                case "ERROR":
                    IsConnectionError = true;
                    break;
                }
            }
        }
コード例 #3
0
        private void _SimpleParser(object sender, ReadLineEventArgs args)
        {
            string   rawline = args.Line;
            string[] rawlineex = rawline.Split(new char[] {' '});
            string   messagecode = "";

            if (rawline[0] == ':') {
                messagecode = rawlineex[1];
                try {
                    ReplyCode replycode = (ReplyCode)int.Parse(messagecode);
                    switch(replycode) {
                        case ReplyCode.Welcome:
                            _IsRegistered = true;
            #if LOG4NET
                            Logger.Connection.Info("logged in");
            #endif
                        break;
                    }
                } catch (FormatException) {
                    // nothing
                }
            } else {
                messagecode = rawlineex[0];
                switch(messagecode) {
                    case "ERROR":
                        IsConnectionError = true;
                    break;
                }
            }
        }
コード例 #4
0
 private void _Worker(object sender, ReadLineEventArgs e)
 {
     // lets see if we have events or internal messagehandler for it
     _HandleEvents(MessageParser(e.Line));
 }