コード例 #1
0
        private string SetEnvironmentSettings(string request, string path, string param,
                              UUID agentID, Caps caps)
        {
            LLSDEnvironmentSetResponse setResponse = new LLSDEnvironmentSetResponse();

            m_log.WarnFormat("[{0}]: Environment POST handler for agentID {1}", Name, agentID);
            setResponse.regionID = regionID;
            setResponse.success = false;

            if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false))
            {
                setResponse.fail_reason = "Insufficient estate permissions, settings has not been saved.";
                return LLSDHelpers.SerializeLLSDReply(setResponse);
            }

            try
            {
                m_scene.StorageManager.DataStore.StoreRegionEnvironmentString(regionID, request);
                setResponse.success = true;

                m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}",
                    Name, agentID, caps.RegionName);
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[{0}]: Environment settings has not been saved for region {1}, Exception: {2} - {3}",
                    Name, caps.RegionName, e.Message, e.StackTrace);

                setResponse.success = false;
                setResponse.fail_reason = String.Format("Environment Set for region {0} has failed, settings has not been saved.", caps.RegionName);
            }

            string response = LLSDHelpers.SerializeLLSDReply(setResponse);
            return response;
        }
コード例 #2
0
ファイル: EnvironmentModule.cs プロジェクト: kf6kjg/halcyon
        private string SetEnvironmentSettings(string request, UUID agentID)
        {
            LLSDEnvironmentSetResponse setResponse = new LLSDEnvironmentSetResponse();

            m_log.WarnFormat("[{0}]: Environment POST handler for agentID {1}", Name, agentID);
            setResponse.regionID = regionID;
            setResponse.success = false;

            if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false))
            {
                setResponse.fail_reason = "Insufficient estate permissions, settings has not been saved.";
                return LLSDHelpers.SerializeLLSDReply(setResponse);
            }

            try
            {
                m_scene.StorageManager.DataStore.StoreRegionEnvironmentString(regionID, request);
                setResponse.success = true;
                environString = request;
                m_log.InfoFormat("[{0}]: Environment settings updated by user {1}", Name, agentID);
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[{0}]: Environment settings not been saved for user {1}, Exception: {2} - {3}",
                    Name, agentID, e.Message, e.StackTrace);

                setResponse.success = false;
                setResponse.fail_reason = String.Format("Environment settings for '{0}' could not be saved.", m_scene.RegionInfo.RegionName);
            }

            return LLSDHelpers.SerializeLLSDReply(setResponse);
        }