Ejemplo n.º 1
0
        public void AddGumpCollection(GumpCollection gumpCollection, int startX, int startY)
        {
            if (gumpCollection == null)
            {
                return;
            }

            for (int a = 0; a < gumpCollection.m_GumpObjects.Count; a++)
            {
                GumpCollectionObject gumpCollectionObject = gumpCollection.m_GumpObjects[a];

                if (gumpCollectionObject == null)
                {
                    continue;
                }

                switch (gumpCollectionObject.m_ObjectType)
                {
                case GumpCollectionObject.ObjectType.Item:
                    AddItem(startX + gumpCollectionObject.m_OffsetX, startY + gumpCollectionObject.m_OffsetY, gumpCollectionObject.m_ItemID, gumpCollectionObject.m_Hue);
                    break;

                case GumpCollectionObject.ObjectType.Image:
                    AddImage(startX + gumpCollectionObject.m_OffsetX, startY + gumpCollectionObject.m_OffsetY, gumpCollectionObject.m_ItemID, gumpCollectionObject.m_Hue);
                    break;

                case GumpCollectionObject.ObjectType.Background:
                    AddBackground(startX + gumpCollectionObject.m_OffsetX, startY + gumpCollectionObject.m_OffsetY, gumpCollectionObject.m_Width, gumpCollectionObject.m_Height, gumpCollectionObject.m_ItemID);
                    break;
                }
            }
        }
Ejemplo n.º 2
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 );
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal GumpCollectionEnumerator(GumpCollection collection)
 {
     _index      = -1;
     _collection = collection;
 }
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal GumpCollectionEnumerator(GumpCollection collection)
 {
     _index = -1;
     _collection = collection;
 }
Ejemplo n.º 5
0
		public void AddGump( Gump g )
		{
			if ( m_Gumps == null )
				m_Gumps = new GumpCollection();

			if ( m_Gumps.Count >= m_GumpCap )
			{
				log.WarnFormat("Client: {0}: Exceeded gump cap, disconnecting...",
							   this);
				Dispose();
			}
			else
			{
				m_Gumps.Add( g );
			}
		}