aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie2010-12-12 01:20:46 +0000
committerMelanie2010-12-12 01:20:46 +0000
commit8aa63093b118f257eff87c003e668249c34f5162 (patch)
treea5ea5448482d899729c29079ed0dab8394bb9be4 /OpenSim/Region/ScriptEngine
parentFix border fence for physicals. Fix llRotLookAt() for Vehicles. (diff)
parentRevert "Another stab at mantis #5256" (diff)
downloadopensim-SC_OLD-8aa63093b118f257eff87c003e668249c34f5162.zip
opensim-SC_OLD-8aa63093b118f257eff87c003e668249c34f5162.tar.gz
opensim-SC_OLD-8aa63093b118f257eff87c003e668249c34f5162.tar.bz2
opensim-SC_OLD-8aa63093b118f257eff87c003e668249c34f5162.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs71
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs19
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs33
3 files changed, 103 insertions, 20 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>();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 961987d..064df35 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -67,8 +67,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
67 string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, 67 string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
68 bool blend, int disp, int timer, int alpha, int face); 68 bool blend, int disp, int timer, int alpha, int face);
69 69
70 LSL_Float osTerrainGetHeight(int x, int y); 70 LSL_Float osGetTerrainHeight(int x, int y);
71 LSL_Integer osTerrainSetHeight(int x, int y, double val); 71 LSL_Float osTerrainGetHeight(int x, int y); // Deprecated
72 LSL_Integer osSetTerrainHeight(int x, int y, double val);
73 LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated
72 void osTerrainFlush(); 74 void osTerrainFlush();
73 75
74 int osRegionRestart(double seconds); 76 int osRegionRestart(double seconds);
@@ -107,7 +109,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
107 string osSetFontName(string drawList, string fontName); 109 string osSetFontName(string drawList, string fontName);
108 string osSetFontSize(string drawList, int fontSize); 110 string osSetFontSize(string drawList, int fontSize);
109 string osSetPenSize(string drawList, int penSize); 111 string osSetPenSize(string drawList, int penSize);
110 string osSetPenColour(string drawList, string colour); 112 string osSetPenColor(string drawList, string color);
113 string osSetPenColour(string drawList, string colour); // Deprecated
111 string osSetPenCap(string drawList, string direction, string type); 114 string osSetPenCap(string drawList, string direction, string type);
112 string osDrawImage(string drawList, int width, int height, string imageUrl); 115 string osDrawImage(string drawList, int width, int height, string imageUrl);
113 vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize); 116 vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
@@ -119,13 +122,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
119 void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour); 122 void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
120 void osSetEstateSunSettings(bool sunFixed, double sunHour); 123 void osSetEstateSunSettings(bool sunFixed, double sunHour);
121 double osGetCurrentSunHour(); 124 double osGetCurrentSunHour();
122 double osSunGetParam(string param); 125 double osGetSunParam(string param);
123 void osSunSetParam(string param, double value); 126 double osSunGetParam(string param); // Deprecated
127 void osSetSunParam(string param, double value);
128 void osSunSetParam(string param, double value); // Deprecated
124 129
125 // Wind Module Functions 130 // Wind Module Functions
126 string osWindActiveModelPluginName(); 131 string osWindActiveModelPluginName();
127 void osWindParamSet(string plugin, string param, float value); 132 void osSetWindParam(string plugin, string param, float value);
128 float osWindParamGet(string plugin, string param); 133 float osGetWindParam(string plugin, string param);
129 134
130 // Parcel commands 135 // Parcel commands
131 void osParcelJoin(vector pos1, vector pos2); 136 void osParcelJoin(vector pos1, vector pos2);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index f3142e6..70d489e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -81,11 +81,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
81 return m_OSSL_Functions.osGetCurrentSunHour(); 81 return m_OSSL_Functions.osGetCurrentSunHour();
82 } 82 }
83 83
84 public double osGetSunParam(string param)
85 {
86 return m_OSSL_Functions.osGetSunParam(param);
87 }
88 // Deprecated
84 public double osSunGetParam(string param) 89 public double osSunGetParam(string param)
85 { 90 {
86 return m_OSSL_Functions.osSunGetParam(param); 91 return m_OSSL_Functions.osSunGetParam(param);
87 } 92 }
88 93
94 public void osSetSunParam(string param, double value)
95 {
96 m_OSSL_Functions.osSetSunParam(param, value);
97 }
98 // Deprecated
89 public void osSunSetParam(string param, double value) 99 public void osSunSetParam(string param, double value)
90 { 100 {
91 m_OSSL_Functions.osSunSetParam(param, value); 101 m_OSSL_Functions.osSunSetParam(param, value);
@@ -97,14 +107,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
97 } 107 }
98 108
99// Not yet plugged in as available OSSL functions, so commented out 109// Not yet plugged in as available OSSL functions, so commented out
100// void osWindParamSet(string plugin, string param, float value) 110// void osSetWindParam(string plugin, string param, float value)
101// { 111// {
102// m_OSSL_Functions.osWindParamSet(plugin, param, value); 112// m_OSSL_Functions.osSetWindParam(plugin, param, value);
103// } 113// }
104// 114//
105// float osWindParamGet(string plugin, string param) 115// float osGetWindParam(string plugin, string param)
106// { 116// {
107// return m_OSSL_Functions.osWindParamGet(plugin, param); 117// return m_OSSL_Functions.osGetWindParam(plugin, param);
108// } 118// }
109 119
110 public void osParcelJoin(vector pos1, vector pos2) 120 public void osParcelJoin(vector pos1, vector pos2)
@@ -165,11 +175,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
165 blend, disp, timer, alpha, face); 175 blend, disp, timer, alpha, face);
166 } 176 }
167 177
178 public LSL_Float osGetTerrainHeight(int x, int y)
179 {
180 return m_OSSL_Functions.osGetTerrainHeight(x, y);
181 }
182 // Deprecated
168 public LSL_Float osTerrainGetHeight(int x, int y) 183 public LSL_Float osTerrainGetHeight(int x, int y)
169 { 184 {
170 return m_OSSL_Functions.osTerrainGetHeight(x, y); 185 return m_OSSL_Functions.osTerrainGetHeight(x, y);
171 } 186 }
172 187
188 public LSL_Integer osSetTerrainHeight(int x, int y, double val)
189 {
190 return m_OSSL_Functions.osSetTerrainHeight(x, y, val);
191 }
192 // Deprecated
173 public LSL_Integer osTerrainSetHeight(int x, int y, double val) 193 public LSL_Integer osTerrainSetHeight(int x, int y, double val)
174 { 194 {
175 return m_OSSL_Functions.osTerrainSetHeight(x, y, val); 195 return m_OSSL_Functions.osTerrainSetHeight(x, y, val);
@@ -333,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
333 return m_OSSL_Functions.osSetPenCap(drawList, direction, type); 353 return m_OSSL_Functions.osSetPenCap(drawList, direction, type);
334 } 354 }
335 355
356 public string osSetPenColor(string drawList, string color)
357 {
358 return m_OSSL_Functions.osSetPenColor(drawList, color);
359 }
360 // Deprecated
336 public string osSetPenColour(string drawList, string colour) 361 public string osSetPenColour(string drawList, string colour)
337 { 362 {
338 return m_OSSL_Functions.osSetPenColour(drawList, colour); 363 return m_OSSL_Functions.osSetPenColour(drawList, colour);