diff options
author | Melanie | 2013-06-18 01:50:08 +0100 |
---|---|---|
committer | Melanie | 2013-06-18 01:50:08 +0100 |
commit | 56f4adeb60622aaec687f3a6699a03c964f59d5b (patch) | |
tree | 0ba2fe5ffd3984b41fab05b56361fda507b2a34a /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | correct method doc for llRot2Axis() (diff) | |
download | opensim-SC-56f4adeb60622aaec687f3a6699a03c964f59d5b.zip opensim-SC-56f4adeb60622aaec687f3a6699a03c964f59d5b.tar.gz opensim-SC-56f4adeb60622aaec687f3a6699a03c964f59d5b.tar.bz2 opensim-SC-56f4adeb60622aaec687f3a6699a03c964f59d5b.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
OpenSim/Services/LLLoginService/LLLoginResponse.cs
OpenSim/Services/LLLoginService/LLLoginService.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 82 |
1 files changed, 76 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9744526..d5f14bf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1664,6 +1664,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1664 | m_host.SetFaceColorAlpha(face, color, null); | 1664 | m_host.SetFaceColorAlpha(face, color, null); |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | /* | ||
1668 | public void llSetContentType(LSL_Key id, LSL_Integer type) | ||
1669 | { | ||
1670 | m_host.AddScriptLPS(1); | ||
1671 | |||
1672 | if (m_UrlModule == null) | ||
1673 | return; | ||
1674 | |||
1675 | // Make sure the content type is text/plain to start with | ||
1676 | m_UrlModule.HttpContentType(new UUID(id), "text/plain"); | ||
1677 | |||
1678 | // Is the object owner online and in the region | ||
1679 | ScenePresence agent = World.GetScenePresence(m_host.ParentGroup.OwnerID); | ||
1680 | if (agent == null || agent.IsChildAgent) | ||
1681 | return; // Fail if the owner is not in the same region | ||
1682 | |||
1683 | // Is it the embeded browser? | ||
1684 | string userAgent = m_UrlModule.GetHttpHeader(new UUID(id), "user-agent"); | ||
1685 | if (userAgent.IndexOf("SecondLife") < 0) | ||
1686 | return; // Not the embedded browser. Is this check good enough? | ||
1687 | |||
1688 | // Use the IP address of the client and check against the request | ||
1689 | // seperate logins from the same IP will allow all of them to get non-text/plain as long | ||
1690 | // as the owner is in the region. Same as SL! | ||
1691 | string logonFromIPAddress = agent.ControllingClient.RemoteEndPoint.Address.ToString(); | ||
1692 | string requestFromIPAddress = m_UrlModule.GetHttpHeader(new UUID(id), "remote_addr"); | ||
1693 | //m_log.Debug("IP from header='" + requestFromIPAddress + "' IP from endpoint='" + logonFromIPAddress + "'"); | ||
1694 | if (requestFromIPAddress == null || requestFromIPAddress.Trim() == "") | ||
1695 | return; | ||
1696 | if (logonFromIPAddress == null || logonFromIPAddress.Trim() == "") | ||
1697 | return; | ||
1698 | |||
1699 | // If the request isnt from the same IP address then the request cannot be from the owner | ||
1700 | if (!requestFromIPAddress.Trim().Equals(logonFromIPAddress.Trim())) | ||
1701 | return; | ||
1702 | |||
1703 | switch (type) | ||
1704 | { | ||
1705 | case ScriptBaseClass.CONTENT_TYPE_HTML: | ||
1706 | m_UrlModule.HttpContentType(new UUID(id), "text/html"); | ||
1707 | break; | ||
1708 | case ScriptBaseClass.CONTENT_TYPE_XML: | ||
1709 | m_UrlModule.HttpContentType(new UUID(id), "application/xml"); | ||
1710 | break; | ||
1711 | case ScriptBaseClass.CONTENT_TYPE_XHTML: | ||
1712 | m_UrlModule.HttpContentType(new UUID(id), "application/xhtml+xml"); | ||
1713 | break; | ||
1714 | case ScriptBaseClass.CONTENT_TYPE_ATOM: | ||
1715 | m_UrlModule.HttpContentType(new UUID(id), "application/atom+xml"); | ||
1716 | break; | ||
1717 | case ScriptBaseClass.CONTENT_TYPE_JSON: | ||
1718 | m_UrlModule.HttpContentType(new UUID(id), "application/json"); | ||
1719 | break; | ||
1720 | case ScriptBaseClass.CONTENT_TYPE_LLSD: | ||
1721 | m_UrlModule.HttpContentType(new UUID(id), "application/llsd+xml"); | ||
1722 | break; | ||
1723 | case ScriptBaseClass.CONTENT_TYPE_FORM: | ||
1724 | m_UrlModule.HttpContentType(new UUID(id), "application/x-www-form-urlencoded"); | ||
1725 | break; | ||
1726 | case ScriptBaseClass.CONTENT_TYPE_RSS: | ||
1727 | m_UrlModule.HttpContentType(new UUID(id), "application/rss+xml"); | ||
1728 | break; | ||
1729 | default: | ||
1730 | m_UrlModule.HttpContentType(new UUID(id), "text/plain"); | ||
1731 | break; | ||
1732 | } | ||
1733 | } | ||
1734 | */ | ||
1735 | |||
1667 | public void SetTexGen(SceneObjectPart part, int face,int style) | 1736 | public void SetTexGen(SceneObjectPart part, int face,int style) |
1668 | { | 1737 | { |
1669 | if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) | 1738 | if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) |
@@ -5117,13 +5186,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5117 | return new LSL_Rotation(x,y,z,s); | 5186 | return new LSL_Rotation(x,y,z,s); |
5118 | } | 5187 | } |
5119 | 5188 | ||
5120 | 5189 | /// <summary> | |
5121 | // Xantor 29/apr/2008 | 5190 | /// Returns the axis of rotation for a quaternion |
5122 | // converts a Quaternion to X,Y,Z axis rotations | 5191 | /// </summary> |
5192 | /// <returns></returns> | ||
5193 | /// <param name='rot'></param> | ||
5123 | public LSL_Vector llRot2Axis(LSL_Rotation rot) | 5194 | public LSL_Vector llRot2Axis(LSL_Rotation rot) |
5124 | { | 5195 | { |
5125 | m_host.AddScriptLPS(1); | 5196 | m_host.AddScriptLPS(1); |
5126 | double x, y, z; | ||
5127 | 5197 | ||
5128 | if (Math.Abs(rot.s) > 1) // normalization needed | 5198 | if (Math.Abs(rot.s) > 1) // normalization needed |
5129 | rot.Normalize(); | 5199 | rot.Normalize(); |
@@ -8238,7 +8308,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8238 | return null; | 8308 | return null; |
8239 | 8309 | ||
8240 | string ph = rules.Data[idx++].ToString(); | 8310 | string ph = rules.Data[idx++].ToString(); |
8241 | parentgrp.ScriptSetPhantomStatus(ph.Equals("1")); | 8311 | part.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1")); |
8242 | 8312 | ||
8243 | break; | 8313 | break; |
8244 | 8314 | ||
@@ -8291,7 +8361,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8291 | return null; | 8361 | return null; |
8292 | string temp = rules.Data[idx++].ToString(); | 8362 | string temp = rules.Data[idx++].ToString(); |
8293 | 8363 | ||
8294 | parentgrp.ScriptSetTemporaryStatus(temp.Equals("1")); | 8364 | part.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1")); |
8295 | 8365 | ||
8296 | break; | 8366 | break; |
8297 | 8367 | ||