diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 71 |
1 files changed, 62 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index eba6e75..145c058 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -345,6 +345,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | internal void OSSLDeprecated(string function, string replacement) | ||
349 | { | ||
350 | OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement)); | ||
351 | } | ||
352 | |||
348 | protected void ScriptSleep(int delay) | 353 | protected void ScriptSleep(int delay) |
349 | { | 354 | { |
350 | delay = (int)((float)delay * m_ScriptDelayFactor); | 355 | delay = (int)((float)delay * m_ScriptDelayFactor); |
@@ -356,13 +361,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
356 | // | 361 | // |
357 | // OpenSim functions | 362 | // OpenSim functions |
358 | // | 363 | // |
364 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) | ||
365 | { | ||
366 | CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight"); | ||
367 | return SetTerrainHeight(x, y, val); | ||
368 | } | ||
359 | public LSL_Integer osTerrainSetHeight(int x, int y, double val) | 369 | public LSL_Integer osTerrainSetHeight(int x, int y, double val) |
360 | { | 370 | { |
361 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); | 371 | CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); |
362 | 372 | OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight"); | |
373 | return SetTerrainHeight(x, y, val); | ||
374 | } | ||
375 | private LSL_Integer SetTerrainHeight(int x, int y, double val) | ||
376 | { | ||
363 | m_host.AddScriptLPS(1); | 377 | m_host.AddScriptLPS(1); |
364 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) | 378 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) |
365 | OSSLError("osTerrainSetHeight: Coordinate out of bounds"); | 379 | OSSLError("osSetTerrainHeight: Coordinate out of bounds"); |
366 | 380 | ||
367 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) | 381 | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) |
368 | { | 382 | { |
@@ -375,13 +389,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
375 | } | 389 | } |
376 | } | 390 | } |
377 | 391 | ||
392 | public LSL_Float osGetTerrainHeight(int x, int y) | ||
393 | { | ||
394 | CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight"); | ||
395 | return GetTerrainHeight(x, y); | ||
396 | } | ||
378 | public LSL_Float osTerrainGetHeight(int x, int y) | 397 | public LSL_Float osTerrainGetHeight(int x, int y) |
379 | { | 398 | { |
380 | CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); | 399 | CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); |
381 | 400 | OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight"); | |
401 | return GetTerrainHeight(x, y); | ||
402 | } | ||
403 | private LSL_Float GetTerrainHeight(int x, int y) | ||
404 | { | ||
382 | m_host.AddScriptLPS(1); | 405 | m_host.AddScriptLPS(1); |
383 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) | 406 | if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) |
384 | OSSLError("osTerrainGetHeight: Coordinate out of bounds"); | 407 | OSSLError("osGetTerrainHeight: Coordinate out of bounds"); |
385 | 408 | ||
386 | return World.Heightmap[x, y]; | 409 | return World.Heightmap[x, y]; |
387 | } | 410 | } |
@@ -1008,9 +1031,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1008 | return drawList; | 1031 | return drawList; |
1009 | } | 1032 | } |
1010 | 1033 | ||
1034 | public string osSetPenColor(string drawList, string color) | ||
1035 | { | ||
1036 | CheckThreatLevel(ThreatLevel.None, "osSetPenColor"); | ||
1037 | |||
1038 | m_host.AddScriptLPS(1); | ||
1039 | drawList += "PenColor " + color + "; "; | ||
1040 | return drawList; | ||
1041 | } | ||
1042 | // Deprecated | ||
1011 | public string osSetPenColour(string drawList, string colour) | 1043 | public string osSetPenColour(string drawList, string colour) |
1012 | { | 1044 | { |
1013 | CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); | 1045 | CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); |
1046 | OSSLDeprecated("osSetPenColour", "osSetPenColor"); | ||
1014 | 1047 | ||
1015 | m_host.AddScriptLPS(1); | 1048 | m_host.AddScriptLPS(1); |
1016 | drawList += "PenColour " + colour + "; "; | 1049 | drawList += "PenColour " + colour + "; "; |
@@ -1019,7 +1052,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1019 | 1052 | ||
1020 | public string osSetPenCap(string drawList, string direction, string type) | 1053 | public string osSetPenCap(string drawList, string direction, string type) |
1021 | { | 1054 | { |
1022 | CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); | 1055 | CheckThreatLevel(ThreatLevel.None, "osSetPenCap"); |
1023 | 1056 | ||
1024 | m_host.AddScriptLPS(1); | 1057 | m_host.AddScriptLPS(1); |
1025 | drawList += "PenCap " + direction + "," + type + "; "; | 1058 | drawList += "PenCap " + direction + "," + type + "; "; |
@@ -1164,6 +1197,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1164 | public double osSunGetParam(string param) | 1197 | public double osSunGetParam(string param) |
1165 | { | 1198 | { |
1166 | CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); | 1199 | CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); |
1200 | OSSLDeprecated("osSunGetParam", "osGetSunParam"); | ||
1201 | return GetSunParam(param); | ||
1202 | } | ||
1203 | public double osGetSunParam(string param) | ||
1204 | { | ||
1205 | CheckThreatLevel(ThreatLevel.None, "osGetSunParam"); | ||
1206 | return GetSunParam(param); | ||
1207 | } | ||
1208 | private double GetSunParam(string param) | ||
1209 | { | ||
1167 | m_host.AddScriptLPS(1); | 1210 | m_host.AddScriptLPS(1); |
1168 | 1211 | ||
1169 | double value = 0.0; | 1212 | double value = 0.0; |
@@ -1180,6 +1223,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1180 | public void osSunSetParam(string param, double value) | 1223 | public void osSunSetParam(string param, double value) |
1181 | { | 1224 | { |
1182 | CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); | 1225 | CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); |
1226 | OSSLDeprecated("osSunSetParam", "osSetSunParam"); | ||
1227 | SetSunParam(param, value); | ||
1228 | } | ||
1229 | public void osSetSunParam(string param, double value) | ||
1230 | { | ||
1231 | CheckThreatLevel(ThreatLevel.None, "osSetSunParam"); | ||
1232 | SetSunParam(param, value); | ||
1233 | } | ||
1234 | private void SetSunParam(string param, double value) | ||
1235 | { | ||
1183 | m_host.AddScriptLPS(1); | 1236 | m_host.AddScriptLPS(1); |
1184 | 1237 | ||
1185 | ISunModule module = World.RequestModuleInterface<ISunModule>(); | 1238 | ISunModule module = World.RequestModuleInterface<ISunModule>(); |
@@ -1205,9 +1258,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1205 | return String.Empty; | 1258 | return String.Empty; |
1206 | } | 1259 | } |
1207 | 1260 | ||
1208 | public void osWindParamSet(string plugin, string param, float value) | 1261 | public void osSetWindParam(string plugin, string param, float value) |
1209 | { | 1262 | { |
1210 | CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet"); | 1263 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); |
1211 | m_host.AddScriptLPS(1); | 1264 | m_host.AddScriptLPS(1); |
1212 | 1265 | ||
1213 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | 1266 | IWindModule module = World.RequestModuleInterface<IWindModule>(); |
@@ -1221,9 +1274,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1221 | } | 1274 | } |
1222 | } | 1275 | } |
1223 | 1276 | ||
1224 | public float osWindParamGet(string plugin, string param) | 1277 | public float osGetWindParam(string plugin, string param) |
1225 | { | 1278 | { |
1226 | CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet"); | 1279 | CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); |
1227 | m_host.AddScriptLPS(1); | 1280 | m_host.AddScriptLPS(1); |
1228 | 1281 | ||
1229 | IWindModule module = World.RequestModuleInterface<IWindModule>(); | 1282 | IWindModule module = World.RequestModuleInterface<IWindModule>(); |