/// <summary>
        /// Enqueues a 'stop thread' MapRequestState.  Causes the MapItemRequest thread to end
        /// </summary>
        private void StopThread()
        {
            MapRequestState st = new MapRequestState();

            st.agentID      = STOP_UUID;
            st.EstateID     = 0;
            st.flags        = 0;
            st.godlike      = false;
            st.itemtype     = 0;
            st.regionhandle = 0;

            requests.Enqueue(st);
        }
        /// <summary>
        /// Place a ready texture sender on the processing queue.
        /// </summary>
        /// <param name="textureSender"></param>
        private void EnqueueTextureSender(ITextureSender textureSender)
        {
            textureSender.Cancel  = false;
            textureSender.Sending = true;

            if (!m_sharedSendersQueue.Contains(textureSender))
            {
                m_sharedSendersQueue.Enqueue(textureSender);
            }
        }
Beispiel #3
0
        public void TellMessageServersAboutUser(UUID agentID, UUID sessionID, UUID RegionID,
                                                ulong regionhandle, float positionX, float positionY,
                                                float positionZ, string firstname, string lastname)
        {
            PresenceNotification notification = new PresenceNotification();

            notification.request      = NotificationRequest.Login;
            notification.agentID      = agentID;
            notification.sessionID    = sessionID;
            notification.RegionID     = RegionID;
            notification.regionhandle = regionhandle;
            notification.positionX    = positionX;
            notification.positionY    = positionY;
            notification.positionZ    = positionZ;
            notification.firstname    = firstname;
            notification.lastname     = lastname;

            m_NotifyQueue.Enqueue(notification);
        }
Beispiel #4
0
        public void RequestMesh(ODEPhysRepData repData)
        {
            repData.mesh = null;

            if (repData.meshState == MeshState.needAsset)
            {
                PrimitiveBaseShape pbs = repData.pbs;

                // check if we got outdated

                if (!pbs.SculptEntry || pbs.SculptTexture == UUID.Zero)
                {
                    repData.meshState = MeshState.noNeed;
                    return;
                }

                repData.assetID   = pbs.SculptTexture;
                repData.meshState = MeshState.loadingAsset;

                repData.comand = meshWorkerCmnds.getmesh;
                workQueue.Enqueue(repData);
            }
        }
        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            string uri = MapServer(id) + "/assets/" + id;

            AssetBase asset = null;

            if (m_Cache != null)
            {
                if (!m_Cache.Get(id, out asset))
                {
                    return(false);
                }
            }

            if (asset == null || asset.Data == null || asset.Data.Length == 0)
            {
                lock (m_AssetHandlers)
                {
                    AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); });

                    List <AssetRetrievedEx> handlers;
                    if (m_AssetHandlers.TryGetValue(id, out handlers))
                    {
                        // Someone else is already loading this asset. It will notify our handler when done.
                        handlers.Add(handlerEx);
                        return(true);
                    }

                    handlers = new List <AssetRetrievedEx>();
                    handlers.Add(handlerEx);

                    m_AssetHandlers.Add(id, handlers);

                    QueuedAssetRequest request = new QueuedAssetRequest();
                    request.id  = id;
                    request.uri = uri;
                    m_requestQueue.Enqueue(request);
                }
            }
            else
            {
                handler(id, sender, asset);
            }

            return(true);
        }
Beispiel #6
0
        /* STANDARD QUEUE MANIPULATION INTERFACES */

        public void Enqueue(LLQueItem item)
        {
            if (!m_enabled)
            {
                return;
            }
            // We could micro lock, but that will tend to actually
            // probably be worse than just synchronizing on SendQueue

            if (item == null)
            {
                SendQueue.Enqueue(item);
                return;
            }

            if (item.Incoming)
            {
                SendQueue.PriorityEnqueue(item);
                return;
            }

            if (item.Sequence != 0)
            {
                contents.Add(item.Sequence);
            }

            lock (this)
            {
                switch (item.throttleType & ThrottleOutPacketType.TypeMask)
                {
                case ThrottleOutPacketType.Resend:
                    ThrottleCheck(ref ResendThrottle, ref ResendOutgoingPacketQueue, item);
                    break;

                case ThrottleOutPacketType.Texture:
                    ThrottleCheck(ref TextureThrottle, ref TextureOutgoingPacketQueue, item);
                    break;

                case ThrottleOutPacketType.Task:
                    if ((item.throttleType & ThrottleOutPacketType.LowPriority) != 0)
                    {
                        ThrottleCheck(ref TaskThrottle, ref TaskLowpriorityPacketQueue, item);
                    }
                    else
                    {
                        ThrottleCheck(ref TaskThrottle, ref TaskOutgoingPacketQueue, item);
                    }
                    break;

                case ThrottleOutPacketType.Land:
                    ThrottleCheck(ref LandThrottle, ref LandOutgoingPacketQueue, item);
                    break;

                case ThrottleOutPacketType.Asset:
                    ThrottleCheck(ref AssetThrottle, ref AssetOutgoingPacketQueue, item);
                    break;

                case ThrottleOutPacketType.Cloud:
                    ThrottleCheck(ref CloudThrottle, ref CloudOutgoingPacketQueue, item);
                    break;

                case ThrottleOutPacketType.Wind:
                    ThrottleCheck(ref WindThrottle, ref WindOutgoingPacketQueue, item);
                    break;

                default:
                    // Acknowledgements and other such stuff should go directly to the blocking Queue
                    // Throttling them may and likely 'will' be problematic
                    SendQueue.PriorityEnqueue(item);
                    break;
                }
            }
        }