Пример #1
0
        private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
        {
            m_log.DebugFormat("[CAMERA-ONLY MODE]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
            if (m_Helper.ShouldSend(agentID) && m_Helper.UserLevel(agentID) <= m_UserLevel)
            {
                OSDMap extrasMap;
                if (features.ContainsKey("OpenSimExtras"))
                {
                    extrasMap = (OSDMap)features["OpenSimExtras"];
                }
                else
                {
                    extrasMap = new OSDMap();
                    features["OpenSimExtras"] = extrasMap;
                }
                extrasMap["camera-only-mode"] = OSDMap.FromString("true");
                m_log.DebugFormat("[CAMERA-ONLY MODE]: Sent in {0}", m_scene.RegionInfo.RegionName);

                // Detaching attachments doesn't work for HG visitors,
                // so I'm giving that up.
                //Util.FireAndForget(delegate { DetachAttachments(agentID); });
            }
            else
            {
                m_log.DebugFormat("[CAMERA-ONLY MODE]: NOT Sending camera-only-mode in {0}", m_scene.RegionInfo.RegionName);
            }
        }
Пример #2
0
        private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
        {
            if (!m_Enabled)
            {
                return;
            }

            m_log.DebugFormat("[CAMERA-ONLY MODE]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
            if (m_Helper.UserLevel(agentID) <= m_UserLevel)
            {
                OSDMap extrasMap;
                if (features.ContainsKey("OpenSimExtras"))
                {
                    extrasMap = (OSDMap)features["OpenSimExtras"];
                }
                else
                {
                    extrasMap = new OSDMap();
                    features["OpenSimExtras"] = extrasMap;
                }
                extrasMap["camera-only-mode"] = OSDMap.FromString("true");
                m_log.DebugFormat("[CAMERA-ONLY MODE]: Sent in {0}", m_scene.RegionInfo.RegionName);
            }
            else
            {
                m_log.DebugFormat("[CAMERA-ONLY MODE]: NOT Sending camera-only-mode in {0}", m_scene.RegionInfo.RegionName);
            }
        }
Пример #3
0
        private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
        {
            m_log.DebugFormat("[SPECIAL UI]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName);
            if (m_Helper.UserLevel(agentID) <= m_UserLevel)
            {
                OSDMap extrasMap;
                OSDMap specialUI = new OSDMap();
                using (StreamReader s = new StreamReader(Path.Combine(VIEWER_SUPPORT_DIR, "panel_toolbar.xml")))
                {
                    if (features.ContainsKey("OpenSimExtras"))
                    {
                        extrasMap = (OSDMap)features["OpenSimExtras"];
                    }
                    else
                    {
                        extrasMap = new OSDMap();
                        features["OpenSimExtras"] = extrasMap;
                    }

                    specialUI["toolbar"]    = OSDMap.FromString(s.ReadToEnd());
                    extrasMap["special-ui"] = specialUI;
                }
                m_log.DebugFormat("[SPECIAL UI]: Sending panel_toolbar.xml in {0}", m_scene.RegionInfo.RegionName);

                if (Directory.Exists(Path.Combine(VIEWER_SUPPORT_DIR, "Floaters")))
                {
                    OSDMap floaters = new OSDMap();
                    uint   n        = 0;
                    foreach (String name in Directory.GetFiles(Path.Combine(VIEWER_SUPPORT_DIR, "Floaters"), "*.xml"))
                    {
                        using (StreamReader s = new StreamReader(name))
                        {
                            string simple_name = Path.GetFileNameWithoutExtension(name);
                            OSDMap floater     = new OSDMap();
                            floaters[simple_name] = OSDMap.FromString(s.ReadToEnd());
                            n++;
                        }
                    }
                    specialUI["floaters"] = floaters;
                    m_log.DebugFormat("[SPECIAL UI]: Sending {0} floaters", n);
                }
            }
            else
            {
                m_log.DebugFormat("[SPECIAL UI]: NOT Sending panel_toolbar.xml in {0}", m_scene.RegionInfo.RegionName);
            }
        }