diff options
author | Snoopy Pfeffer | 2012-04-10 21:49:43 +0200 |
---|---|---|
committer | Snoopy Pfeffer | 2012-04-10 21:49:43 +0200 |
commit | 78fd487a705c91720991a7572b860567f36366c4 (patch) | |
tree | cfd82a5742b050ab3e426cad1d262ad692cf16fe /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | Add uri to various log messages when region registration fails. Upgrade some... (diff) | |
download | opensim-SC_OLD-78fd487a705c91720991a7572b860567f36366c4.zip opensim-SC_OLD-78fd487a705c91720991a7572b860567f36366c4.tar.gz opensim-SC_OLD-78fd487a705c91720991a7572b860567f36366c4.tar.bz2 opensim-SC_OLD-78fd487a705c91720991a7572b860567f36366c4.tar.xz |
New OS scripting functions osSetTerrainTexture and osSetTerrainHeight as originally proposed in SL Jira (https://jira.secondlife.com/browse/SVC-244).
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a5dcba4..339166b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3049,5 +3049,60 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3049 | 3049 | ||
3050 | return ScriptBaseClass.TRUE; | 3050 | return ScriptBaseClass.TRUE; |
3051 | } | 3051 | } |
3052 | |||
3053 | /// <summary> | ||
3054 | /// Sets terrain estate texture | ||
3055 | /// </summary> | ||
3056 | /// <param name="level"></param> | ||
3057 | /// <param name="texture"></param> | ||
3058 | /// <returns></returns> | ||
3059 | public void osSetTerrainTexture(int level, LSL_Key texture) | ||
3060 | { | ||
3061 | CheckThreatLevel(ThreatLevel.High, "osSetTerrainTexture"); | ||
3062 | |||
3063 | m_host.AddScriptLPS(1); | ||
3064 | //Check to make sure that the script's owner is the estate manager/master | ||
3065 | //World.Permissions.GenericEstatePermission( | ||
3066 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
3067 | { | ||
3068 | if (level < 0 || level > 3) | ||
3069 | return; | ||
3070 | |||
3071 | UUID textureID = new UUID(); | ||
3072 | if (!UUID.TryParse(texture, out textureID)) | ||
3073 | return; | ||
3074 | |||
3075 | // estate module is required | ||
3076 | IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); | ||
3077 | if (estate != null) | ||
3078 | estate.setEstateTerrainBaseTexture(level, textureID); | ||
3079 | } | ||
3080 | } | ||
3081 | |||
3082 | /// <summary> | ||
3083 | /// Sets terrain heights of estate | ||
3084 | /// </summary> | ||
3085 | /// <param name="corner"></param> | ||
3086 | /// <param name="low"></param> | ||
3087 | /// <param name="high"></param> | ||
3088 | /// <returns></returns> | ||
3089 | public void osSetTerrainTextureHeight(int corner, double low, double high) | ||
3090 | { | ||
3091 | CheckThreatLevel(ThreatLevel.High, "osSetTerrainTextureHeight"); | ||
3092 | |||
3093 | m_host.AddScriptLPS(1); | ||
3094 | //Check to make sure that the script's owner is the estate manager/master | ||
3095 | //World.Permissions.GenericEstatePermission( | ||
3096 | if (World.Permissions.IsGod(m_host.OwnerID)) | ||
3097 | { | ||
3098 | if (corner < 0 || corner > 3) | ||
3099 | return; | ||
3100 | |||
3101 | // estate module is required | ||
3102 | IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); | ||
3103 | if (estate != null) | ||
3104 | estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high); | ||
3105 | } | ||
3106 | } | ||
3052 | } | 3107 | } |
3053 | } \ No newline at end of file | 3108 | } \ No newline at end of file |