Esempio n. 1
0
        private void PresenceRemoveHandler(object sender, PresenceArgs e)
        {
            if (e.Presence is LLAgent)
            {
                // Remove all capabilities associated with this client
                if (m_httpServer != null)
                {
                    this.Scene.Capabilities.RemoveCapabilities(e.Presence.ID);
                }

                // Remove the UDP client reference
                LLAgent agent = (LLAgent)e.Presence;
                if (m_clients.Remove(agent.ID, agent.RemoteEndPoint))
                {
                    m_log.Debug("Removed client reference from the LLUDP server");
                }
            }
            else
            {
                m_log.Warn("PresenceRemoveHandler called for non-LLAgent: " + e.Presence);
            }
        }
Esempio n. 2
0
        private void PresenceAddHandler(object sender, PresenceArgs e)
        {
            Vector3 terrainScale = new Vector3(16f, 16f, 1f);

            for (int y = 0; y < 16; y++)
            {
                for (int x = 0; x < 16; x++)
                {
                    // TODO: Generate event IDs based on the index of the terrain block to allow event compression
                    m_scene.CreateInterestListEventFor(e.Presence, new InterestListEvent(
                        CreateTerrainEventID(x, y),
                        TERRAIN,
                        new Vector3(x * 16 + 8, y * 16 + 8, 0.0f),
                        terrainScale,
                        new int[] { x, y })
                    );
                }
            }
        }
Esempio n. 3
0
        private void PresenceAddHandler(object sender, PresenceArgs e)
        {
            m_scheduler.FireAndForget(
                delegate(object o)
                {
                    // The default search distance (in every direction) for child agent connections
                    const float NEIGHBOR_SEARCH_MARGIN = 256.0f;

                    // HACK: Attempted fix for the viewer hanging indefinitely at login. It seems like
                    // a client race condition when establishing neighbor connections too quickly
                    System.Threading.Thread.Sleep(1000 * 5);

                    if (e.Presence is LLAgent && !e.Presence.IsChildPresence)
                    {
                        LLAgent agent = (LLAgent)e.Presence;

                        // Fetch nearby neighbors for the new presence
                        // TODO: We should be doing this later, based off draw distance
                        Vector3d globalPosition = e.Presence.Scene.MinPosition + new Vector3d(e.Presence.ScenePosition);
                        SceneInfo[] nearNeighbors = m_scene.GetNeighborsNear(globalPosition, e.Presence.InterestRadius + NEIGHBOR_SEARCH_MARGIN);

                        // Iterate over all of the given neighbors and send each a rez_avatar/request to create a child agent
                        for (int i = 0; i < nearNeighbors.Length; i++)
                        {
                            SendRezAvatarRequest(agent, nearNeighbors[i], true);
                        }
                    }
                },
                null
            );
        }
Esempio n. 4
0
 private void PresenceAddHandler(object sender, PresenceArgs e)
 {
     // When an LLUDP agent logs in, send them current animation data for every presence in the sim
     if (e.Presence is LLAgent)
     {
         m_scene.ForEachPresence(
             delegate(IScenePresence presence)
             {
                 m_scene.CreateInterestListEventFor(e.Presence, new InterestListEvent(UUID.Combine(presence.ID, ANIMATION_EVENT_ID), AVATAR_ANIMATION,
                     presence.ScenePosition, presence.Scale, presence));
             }
         );
     }
 }
Esempio n. 5
0
        private void PresenceAddHandler(object sender, PresenceArgs e)
        {
            m_scene.ForEachPresence(
                delegate(IScenePresence presence)
                {
                    InterestListEvent eventData = new InterestListEvent
                    (
                        UUID.Combine(presence.ID, APPEARANCE_EVENT_ID),
                        AVATAR_APPEARANCE,
                        presence.ScenePosition,
                        presence.Scale,
                        presence
                    );

                    m_scene.CreateInterestListEventFor(e.Presence, eventData);
                }
            );
        }
Esempio n. 6
0
        private void PresenceRemoveHandler(object sender, PresenceArgs e)
        {
            if (e.Presence is LLAgent)
            {
                // Remove all capabilities associated with this client
                if (m_httpServer != null)
                    this.Scene.Capabilities.RemoveCapabilities(e.Presence.ID);

                // Remove the UDP client reference
                LLAgent agent = (LLAgent)e.Presence;
                if (m_clients.Remove(agent.ID, agent.RemoteEndPoint))
                    m_log.Debug("Removed client reference from the LLUDP server");
            }
            else
            {
                m_log.Warn("PresenceRemoveHandler called for non-LLAgent: " + e.Presence);
            }
        }
Esempio n. 7
0
 private void PresenceAddHandler(object sender, PresenceArgs e)
 {
     SendParcelOverlay(e.Presence);
 }
Esempio n. 8
0
 private void PresenceAddHandler(object sender, PresenceArgs e)
 {
     IScenePresence newPresence = e.Presence;
     if (e.Presence is LLAgent)
     {
         LLAgent agent = (LLAgent)e.Presence;
         m_scene.ForEachEntity(
             delegate(ISceneEntity entity)
             {
                 if (entity.ID != agent.ID)
                     SendEntityTo(agent, entity);
             }
         );
     }
 }
Esempio n. 9
0
        void m_scene_OnPresenceRemove(object sender, PresenceArgs e)
        {
            IRCUser user = m_users.Find(delegate(IRCUser u) { return u.Name == e.Presence.Name.Replace(' ', '_'); });

            IRCChannel channel = GetChannelByName(m_defaultChannel);

            if (channel != null)
                SendToChannel(channel, user, IRCMessageType.Part, null);

            RemoveUser(user);
        }
Esempio n. 10
0
        void m_scene_OnPresenceAdd(object sender, PresenceArgs e)
        {
            string name = e.Presence.Name.Replace(' ', '_');
            IRCUser user = new IRCUser(m_scene, name, e.Presence.ID);
            user.Name = name;
            user.UserName = "******";
            user.IRCRealName = "";
            user.HostName = "simian";
            user.Presence = e.Presence;

            lock (m_users)
            {
                if (!m_users.Contains(user))
                    m_users.Add(user);
            }

            JoinUserToChannel(user, m_defaultChannel);
        }
Esempio n. 11
0
 private void PresenceAddHandler(object sender, PresenceArgs e)
 {
     SendParcelOverlay(e.Presence);
 }
Esempio n. 12
0
 private void PresenceRemoveHandler(object sender, PresenceArgs e)
 {
     // Mark the time this presence was last connected to the scene. This is used in the
     // object update sending loop to determine if we should send a cache check or the full
     // object update
     lock (m_recentAvatars)
         m_recentAvatars[e.Presence.ID] = DateTime.UtcNow;
 }