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 | |
parent | Merge branch 'master' into careminster (diff) | |
parent | correct method doc for llRot2Axis() (diff) | |
download | opensim-SC_OLD-56f4adeb60622aaec687f3a6699a03c964f59d5b.zip opensim-SC_OLD-56f4adeb60622aaec687f3a6699a03c964f59d5b.tar.gz opensim-SC_OLD-56f4adeb60622aaec687f3a6699a03c964f59d5b.tar.bz2 opensim-SC_OLD-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')
4 files changed, 93 insertions, 15 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 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index daf89e5..2260ec8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -340,6 +340,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
340 | void llSetCameraParams(LSL_List rules); | 340 | void llSetCameraParams(LSL_List rules); |
341 | void llSetClickAction(int action); | 341 | void llSetClickAction(int action); |
342 | void llSetColor(LSL_Vector color, int face); | 342 | void llSetColor(LSL_Vector color, int face); |
343 | void llSetContentType(LSL_Key id, LSL_Integer type); | ||
343 | void llSetDamage(double damage); | 344 | void llSetDamage(double damage); |
344 | void llSetForce(LSL_Vector force, int local); | 345 | void llSetForce(LSL_Vector force, int local); |
345 | void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local); | 346 | void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local); |
@@ -434,6 +435,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
434 | void llSetKeyframedMotion(LSL_List frames, LSL_List options); | 435 | void llSetKeyframedMotion(LSL_List frames, LSL_List options); |
435 | LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); | 436 | LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); |
436 | LSL_List llGetPhysicsMaterial(); | 437 | LSL_List llGetPhysicsMaterial(); |
437 | void llSetContentType(LSL_Key id, LSL_Integer content_type); | ||
438 | } | 438 | } |
439 | } | 439 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 6efa73f..15b21ac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -361,6 +361,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
361 | public const int HTTP_CUSTOM_HEADER = 5; | 361 | public const int HTTP_CUSTOM_HEADER = 5; |
362 | public const int HTTP_PRAGMA_NO_CACHE = 6; | 362 | public const int HTTP_PRAGMA_NO_CACHE = 6; |
363 | 363 | ||
364 | // llSetContentType | ||
365 | public const int CONTENT_TYPE_TEXT = 0; //text/plain | ||
366 | public const int CONTENT_TYPE_HTML = 1; //text/html | ||
367 | public const int CONTENT_TYPE_XML = 2; //application/xml | ||
368 | public const int CONTENT_TYPE_XHTML = 3; //application/xhtml+xml | ||
369 | public const int CONTENT_TYPE_ATOM = 4; //application/atom+xml | ||
370 | public const int CONTENT_TYPE_JSON = 5; //application/json | ||
371 | public const int CONTENT_TYPE_LLSD = 6; //application/llsd+xml | ||
372 | public const int CONTENT_TYPE_FORM = 7; //application/x-www-form-urlencoded | ||
373 | public const int CONTENT_TYPE_RSS = 8; //application/rss+xml | ||
374 | |||
364 | public const int PRIM_MATERIAL = 2; | 375 | public const int PRIM_MATERIAL = 2; |
365 | public const int PRIM_PHYSICS = 3; | 376 | public const int PRIM_PHYSICS = 3; |
366 | public const int PRIM_TEMP_ON_REZ = 4; | 377 | public const int PRIM_TEMP_ON_REZ = 4; |
@@ -772,8 +783,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
772 | /// process message parameter as regex | 783 | /// process message parameter as regex |
773 | /// </summary> | 784 | /// </summary> |
774 | public const int OS_LISTEN_REGEX_MESSAGE = 0x2; | 785 | public const int OS_LISTEN_REGEX_MESSAGE = 0x2; |
775 | |||
776 | public const int CONTENT_TYPE_TEXT = 0; | ||
777 | public const int CONTENT_TYPE_HTML = 1; | ||
778 | } | 786 | } |
779 | } | 787 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 6f3677c..b58686b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1535,6 +1535,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1535 | m_LSL_Functions.llSetColor(color, face); | 1535 | m_LSL_Functions.llSetColor(color, face); |
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | public void llSetContentType(LSL_Key id, LSL_Integer type) | ||
1539 | { | ||
1540 | m_LSL_Functions.llSetContentType(id, type); | ||
1541 | } | ||
1542 | |||
1538 | public void llSetDamage(double damage) | 1543 | public void llSetDamage(double damage) |
1539 | { | 1544 | { |
1540 | m_LSL_Functions.llSetDamage(damage); | 1545 | m_LSL_Functions.llSetDamage(damage); |
@@ -2014,10 +2019,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
2014 | { | 2019 | { |
2015 | return m_LSL_Functions.llGetPhysicsMaterial(); | 2020 | return m_LSL_Functions.llGetPhysicsMaterial(); |
2016 | } | 2021 | } |
2017 | |||
2018 | public void llSetContentType(LSL_Key id, LSL_Integer content_type) | ||
2019 | { | ||
2020 | m_LSL_Functions.llSetContentType(id, content_type); | ||
2021 | } | ||
2022 | } | 2022 | } |
2023 | } | 2023 | } |