Пример #1
0
        //
        // Event handlers
        //

        // Handler object events

        private void HandleNamesComplete(object sender, NamesCompleteEventArgs ev)
        {
            Debug.Print("Channel.HandleNamesComplete: channel={0} nicks={1}", _name, string.Join(",", ev.NickNames));
            Users     = new Collection <User>( );
            UserFlags = new Dictionary <User, string>( );

            var flagList = string.IsNullOrEmpty(_server.Information.ChannelModes.StatusSigils) ? "@+" : _server.Information.ChannelModes.StatusSigils;

            foreach (var item in ev.NickNames)
            {
                var flags = string.Empty;
                for (var i = 0; i < item.Length; i++)
                {
                    if (flagList.IndexOf(item[i]) > -1)
                    {
                        flags += item[i];
                    }
                    else
                    {
                        var channelMember = new NickUserHost(item.Substring(i));
                        var user          = _server.LookUpOrRegisterUser(channelMember);
                        _users.Add(user);
                        _userFlags.Add(user, flags);
                        break;
                    }
                }
            }
        }
Пример #2
0
        //
        // Event handlers
        //

        // Handler object events

        private void HandleNamesComplete(object sender, NamesCompleteEventArgs ev)
        {
            Debug.Print("Channel.HandleNamesComplete: typeof(sender)={0} sender={1} channel={2} nicks={3}", sender.GetType( ), sender, Name, string.Join(",", ev.NickNames));
            if (null == Users)
            {
                Users = new Collection <User>( );
            }
            else
            {
                Users.Clear( );
            }
            if (null == UserFlags)
            {
                UserFlags = new Dictionary <User, string>( );
            }
            else
            {
                UserFlags.Clear( );
            }

            var flagList = string.IsNullOrEmpty(Server.Information.ChannelModes.StatusSigils) ? "@+" : Server.Information.ChannelModes.StatusSigils;

            foreach (var item in ev.NickNames)
            {
                var flags = string.Empty;
                for (var i = 0; i < item.Length; i++)
                {
                    if (flagList.IndexOf(item[i]) > -1)
                    {
                        flags += item[i];
                    }
                    else
                    {
                        var channelMember = new NickUserHost(item.Substring(i));
                        var user          = Server.LookUpUser(channelMember.NickName) ?? new User {
                            NickUserHost    = channelMember,
                            ProtocolHandler = ProtocolHandler,
                            Server          = Server,
                        };
                        Users.Add(user);
                        UserFlags.Add(user, flags);
                        break;
                    }
                }
            }
        }
Пример #3
0
 // NamesHandler
 private void HandleNamesComplete( object sender, NamesCompleteEventArgs ev )
 {
     Debug.Print( "Server.HandleNamesComplete" );
     _protocolHandler.EndCapture( "Server.HandleRplNamReply running NamesHandler" );
     OnNamesComplete( ev.NickNames );
 }
 private void Server_NamesComplete( object sender, NamesCompleteEventArgs ev )
 {
     Debug.Print( "ServerPanel.Server_NamesComplete" );
 }
Пример #5
0
 // NamesHandler
 private void HandleNamesComplete( object sender, NamesCompleteEventArgs ev )
 {
     Debug.Print( "Server.HandleNamesComplete" );
     _protocolHandler.RestoreHandlers( );
     OnNamesComplete( ev.NickNames );
 }
Пример #6
0
        //
        // Event handlers
        //
        // Handler object events
        private void HandleNamesComplete( object sender, NamesCompleteEventArgs ev )
        {
            Debug.Print( "Channel.HandleNamesComplete: typeof(sender)={0} sender={1} channel={2} nicks={3}", sender.GetType( ), sender, Name, string.Join( ",", ev.NickNames ) );
            if ( null == Users ) {
                Users = new Collection<User>( );
            } else {
                Users.Clear( );
            }
            if ( null == UserFlags ) {
                UserFlags = new Dictionary<User, string>( );
            } else {
                UserFlags.Clear( );
            }

            var flagList = string.IsNullOrEmpty( Server.Information.ChannelModes.StatusSigils ) ? "@+" : Server.Information.ChannelModes.StatusSigils;
            foreach ( var item in ev.NickNames ) {
                var flags = string.Empty;
                for ( var i = 0; i < item.Length; i++ ) {
                    if ( flagList.IndexOf( item[ i ] ) > -1 ) {
                        flags += item[ i ];
                    } else {
                        var channelMember = new NickUserHost( item.Substring( i ) );
                        var user = Server.LookUpUser( channelMember.NickName ) ?? new User {
                            NickUserHost = channelMember,
                            ProtocolHandler = ProtocolHandler,
                            Server = Server,
                        };
                        Users.Add( user );
                        UserFlags.Add( user, flags );
                        break;
                    }
                }
            }
        }
Пример #7
0
        // NamesHandler

        private void HandleNamesComplete(object sender, NamesCompleteEventArgs ev)
        {
            Debug.Print("Server.HandleNamesComplete");
            _protocolHandler.RestoreHandlers( );
            OnNamesComplete(ev.NickNames);
        }
Пример #8
0
        // NamesHandler

        private void HandleNamesComplete(object sender, NamesCompleteEventArgs ev)
        {
            Debug.Print("Server.HandleNamesComplete");
            _protocolHandler.EndCapture("Server.HandleRplNamReply running NamesHandler");
            OnNamesComplete(ev.NickNames);
        }