public static void Handle(MessageHandlerArgs args)
        {
            var matches = _ipPattern.Match(args.Line);

            _log.Debug("Handling reply for RPL_YOURHOST event");
            for (var i = 0; i < matches.Groups.Count; i++)
            {
                _log.Debug($"Match group { i } = '{ matches.Groups[ i ].Value }'");
                switch (i)
                {
                case 1:
                    _log.Debug($"Setting ServerName to { matches.Groups[ 1 ].Value }");
                    args.Irc.ServerInfo.ServerName = matches.Groups[1].Value;
                    break;

                case 3:
                    _log.Debug($"Setting IpAddress to { matches.Groups[ 3 ].Value }");
                    args.Irc.ServerInfo.IpAddress = matches.Groups[3].Value;
                    break;

                case 5:
                    _log.Debug($"Setting Port to { matches.Groups[ 5 ].Value }");
                    args.Irc.ServerInfo.Port = int.Parse(matches.Groups[5].Value);
                    break;

                case 6:
                    _log.Debug($"Setting to IrcVersion to { matches.Groups[ 6 ].Value }");
                    args.Irc.ServerInfo.IrcVersion = matches.Groups[6].Value;
                    break;

                default:
                    break;
                }
            }
            MessageHandlerDelegates.RPL_YOURHOSTDelegate?.Invoke(args);
        }
Esempio n. 2
0
 public static void Handle(MessageHandlerArgs args)
 {
     args.Irc.Messenger.QueueCritical($"JOIN { args.Irc.Channel }");
     MessageHandlerDelegates.RPL_WELCOMEDelegate?.Invoke(args);
 }
 public static void Handle( MessageHandlerArgs args )
 {
     MessageHandlerDelegates.ERR_NICKLOCKEDDelegate?.Invoke( args );
     if( MessageHandlerDelegates.ERR_NICKLOCKEDDelegate == null )
         _log.Warning( "There is no message handler for this kind of message!" );
 }