Beispiel #1
0
        //
        // Methods
        //

        protected virtual void RegisterServerHandlers( )
        {
            if (null != Name)
            {
                _server.RegisterChannel(Name, this);
            }

            _server.NamesComplete += HandleNamesComplete;
            _server.WhoComplete   += HandleWhoComplete;

            _server.EventManager.BulkSubscribe(_targetedEvents);
        }
Beispiel #2
0
        // Verb events

        private void HandleJoin(object sender, MessageEventArgs ev)
        {
            Debug.Print("Channel.HandleJoin: ev.Message={0}", ev.Message);
            if (!string.IsNullOrEmpty(_name) && !_name.Equals(ev.Message.Target, StringComparison.Ordinal))
            {
                Debug.Print("Channel.HandleJoin: changing name from '{0}' to '{1}'", _name, ev.Message.Target);
                _server.UnregisterChannel(_name);
                Name = ev.Message.Target;
                _server.RegisterChannel(_name, this);
            }

            _protocolHandler.SendToServer("WHO {0}", _name);
        }