예제 #1
0
        /// -----------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// -----------------------------------------------------------------
        public void touch_start(uint localID, uint originalID, Vector3 offsetPos,
                                IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
        {
            m_log.DebugFormat("[EventHandlers] Touch event received");

            // Find the object UUID associated with the localID/originalID
            UUID objectID;

            if (originalID == 0)
            {
                SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
                if (part == null)
                {
                    return;
                }
                objectID = part.ParentGroup.UUID;
            }
            else
            {
                SceneObjectPart part = m_scene.GetSceneObjectPart(originalID);
                if (part == null)
                {
                    return;
                }
                objectID = part.ParentGroup.UUID;
            }

            // And grab the callbacks we need to send
            List <EventCallback> cblist = null;

            lock (m_objectRegistry)
            {
                if (!m_objectRegistry.TryGetValue(objectID, out cblist))
                {
                    return;
                }
            }

            // Send the callback
            TouchCallback touch = new RemoteControl.Messages.TouchCallback(objectID, UUID.Zero, remoteClient.AgentId, offsetPos, surfaceArgs);

            foreach (EventCallback cb in cblist)
            {
                EndPoint ep = m_dispatcher.LookupEndPoint(cb.EndPointID);
                if (ep == null)
                {
                    m_log.WarnFormat("[EventHandlers] unable to locate endpoint {0}", cb.RequestID);
                    return;
                }

                touch.RequestID = cb.RequestID;
                ep.Send(touch);
            }
        }
        /// -----------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// -----------------------------------------------------------------
        public void touch_start(uint localID, uint originalID, Vector3 offsetPos,
                IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
        {
            m_log.DebugFormat("[EventHandlers] Touch event received");

            // Find the object UUID associated with the localID/originalID
            UUID objectID;
            if (originalID == 0)
            {
                SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
                if (part == null)
                    return;
                objectID = part.ParentGroup.UUID;
            }
            else
            {
                SceneObjectPart part = m_scene.GetSceneObjectPart(originalID);
                if (part == null)
                    return;
                objectID = part.ParentGroup.UUID;
            }

            // And grab the callbacks we need to send
            List<EventCallback> cblist = null;
            lock (m_objectRegistry)
            {
                if (! m_objectRegistry.TryGetValue(objectID, out cblist))
                    return;
            }

            // Send the callback
            TouchCallback touch = new RemoteControl.Messages.TouchCallback(objectID,UUID.Zero,remoteClient.AgentId,offsetPos,surfaceArgs);
            foreach (EventCallback cb in cblist)
            {
                EndPoint ep = m_dispatcher.LookupEndPoint(cb.EndPointID);
                if (ep == null)
                {
                    m_log.WarnFormat("[EventHandlers] unable to locate endpoint {0}",cb.RequestID);
                    return;
                }

                touch.RequestID = cb.RequestID;
                ep.Send(touch);
            }
        }