Ejemplo n.º 1
0
        public NetState( Socket socket, MessagePump messagePump )
        {
            m_Socket = socket;
            m_Buffer = new ByteQueue();
            m_Seeded = false;
            m_Running = false;
            m_RecvBuffer = m_ReceiveBufferPool.AquireBuffer();
            m_MessagePump = messagePump;
            m_Gumps = new GumpCollection();
            m_HuePickers = new HuePickerCollection();
            m_Menus = new MenuCollection();
            m_Trades = new ArrayList();

            m_SendQueue = new SendQueue();

            m_NextCheckActivity = DateTime.Now + TimeSpan.FromMinutes( 0.5 );

            m_Instances.Add( this );

            try{ m_Address = ((IPEndPoint)m_Socket.RemoteEndPoint).Address; m_ToString = m_Address.ToString(); }
            catch{ m_Address = IPAddress.None; m_ToString = "(error)"; }

            m_Super = Core.Config.LoginConfig.IsSuperClient(m_ToString);

            if ( m_CreatedCallback != null )
                m_CreatedCallback( this );
        }
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal HuePickerCollectionEnumerator(HuePickerCollection collection)
 {
     _index = -1;
     _collection = collection;
 }
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal HuePickerCollectionEnumerator(HuePickerCollection collection)
 {
     _index      = -1;
     _collection = collection;
 }
Ejemplo n.º 4
0
		public void AddHuePicker( HuePicker huePicker )
		{
			if ( m_HuePickers == null )
				m_HuePickers = new HuePickerCollection();

			if ( m_HuePickers.Count >= m_HuePickerCap )
			{
				log.WarnFormat("Client: {0}: Exceeded hue picker cap, disconnecting...",
							   this);
				Dispose();
			}
			else
			{
				m_HuePickers.Add( huePicker );
			}
		}