aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs19
4 files changed, 37 insertions, 27 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 39e1a27..2b8155f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -977,7 +977,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
977 977
978 public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) 978 public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
979 { 979 {
980 CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); 980 CheckThreatLevel(ThreatLevel.None, "osDrawPolygon");
981 981
982 m_host.AddScriptLPS(1); 982 m_host.AddScriptLPS(1);
983 983
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1248 return String.Empty; 1248 return String.Empty;
1249 } 1249 }
1250 1250
1251 public void osSetWindParam(string plugin, string param, float value) 1251 public void osSetWindParam(string plugin, string param, LSL_Float value)
1252 { 1252 {
1253 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); 1253 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
1254 m_host.AddScriptLPS(1); 1254 m_host.AddScriptLPS(1);
@@ -1258,13 +1258,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1258 { 1258 {
1259 try 1259 try
1260 { 1260 {
1261 module.WindParamSet(plugin, param, value); 1261 module.WindParamSet(plugin, param, (float)value);
1262 } 1262 }
1263 catch (Exception) { } 1263 catch (Exception) { }
1264 } 1264 }
1265 } 1265 }
1266 1266
1267 public float osGetWindParam(string plugin, string param) 1267 public LSL_Float osGetWindParam(string plugin, string param)
1268 { 1268 {
1269 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); 1269 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
1270 m_host.AddScriptLPS(1); 1270 m_host.AddScriptLPS(1);
@@ -1416,7 +1416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1416 { 1416 {
1417 // What actually is the difference to the LL function? 1417 // What actually is the difference to the LL function?
1418 // 1418 //
1419 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); 1419 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress");
1420 1420
1421 m_host.AddScriptLPS(1); 1421 m_host.AddScriptLPS(1);
1422 1422
@@ -2222,12 +2222,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2222 return (int)pws; 2222 return (int)pws;
2223 } 2223 }
2224 2224
2225 public void osSetSpeed(string UUID, float SpeedModifier) 2225 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
2226 { 2226 {
2227 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 2227 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
2228 m_host.AddScriptLPS(1); 2228 m_host.AddScriptLPS(1);
2229 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 2229 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
2230 avatar.SpeedModifier = SpeedModifier; 2230 avatar.SpeedModifier = (float)SpeedModifier;
2231 } 2231 }
2232 2232
2233 public void osKickAvatar(string FirstName,string SurName,string alert) 2233 public void osKickAvatar(string FirstName,string SurName,string alert)
@@ -2308,14 +2308,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2308 { 2308 {
2309 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 2309 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
2310 m_host.AddScriptLPS(1); 2310 m_host.AddScriptLPS(1);
2311 InitLSL();
2311 2312
2312 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); 2313 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
2313 } 2314 }
2314 2315
2315 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) 2316 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
2316 { 2317 {
2317 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 2318 CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
2318 m_host.AddScriptLPS(1); 2319 m_host.AddScriptLPS(1);
2320 InitLSL();
2319 2321
2320 m_LSL_Api.SetPrimitiveParamsEx(prim, rules); 2322 m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
2321 } 2323 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index c08ad3b..5a809e6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -129,8 +129,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
129 129
130 // Wind Module Functions 130 // Wind Module Functions
131 string osWindActiveModelPluginName(); 131 string osWindActiveModelPluginName();
132 void osSetWindParam(string plugin, string param, float value); 132 void osSetWindParam(string plugin, string param, LSL_Float value);
133 float osGetWindParam(string plugin, string param); 133 LSL_Float osGetWindParam(string plugin, string param);
134 134
135 // Parcel commands 135 // Parcel commands
136 void osParcelJoin(vector pos1, vector pos2); 136 void osParcelJoin(vector pos1, vector pos2);
@@ -180,7 +180,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
180 180
181 int osGetSimulatorMemory(); 181 int osGetSimulatorMemory();
182 void osKickAvatar(string FirstName,string SurName,string alert); 182 void osKickAvatar(string FirstName,string SurName,string alert);
183 void osSetSpeed(string UUID, float SpeedModifier); 183 void osSetSpeed(string UUID, LSL_Float SpeedModifier);
184 void osCauseHealing(string avatar, double healing); 184 void osCauseHealing(string avatar, double healing);
185 void osCauseDamage(string avatar, double damage); 185 void osCauseDamage(string avatar, double damage);
186 LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); 186 LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index e3ea556..7c59098 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -106,16 +106,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
106 return m_OSSL_Functions.osWindActiveModelPluginName(); 106 return m_OSSL_Functions.osWindActiveModelPluginName();
107 } 107 }
108 108
109// Not yet plugged in as available OSSL functions, so commented out 109 public void osSetWindParam(string plugin, string param, LSL_Float value)
110// void osSetWindParam(string plugin, string param, float value) 110 {
111// { 111 m_OSSL_Functions.osSetWindParam(plugin, param, value);
112// m_OSSL_Functions.osSetWindParam(plugin, param, value); 112 }
113// } 113
114// 114 public LSL_Float osGetWindParam(string plugin, string param)
115// float osGetWindParam(string plugin, string param) 115 {
116// { 116 return m_OSSL_Functions.osGetWindParam(plugin, param);
117// return m_OSSL_Functions.osGetWindParam(plugin, param); 117 }
118// }
119 118
120 public void osParcelJoin(vector pos1, vector pos2) 119 public void osParcelJoin(vector pos1, vector pos2)
121 { 120 {
@@ -714,7 +713,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
714 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); 713 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
715 } 714 }
716 715
717 public void osSetSpeed(string UUID, float SpeedModifier) 716 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
718 { 717 {
719 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); 718 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
720 } 719 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 49d6abe..734d4d5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -106,6 +106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
106 // Get some config 106 // Get some config
107 WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", false); 107 WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", false);
108 CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true); 108 CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true);
109 bool DeleteScriptsOnStartup = m_scriptEngine.Config.GetBoolean("DeleteScriptsOnStartup", true);
109 110
110 // Get file prefix from scriptengine name and make it file system safe: 111 // Get file prefix from scriptengine name and make it file system safe:
111 FilePrefix = "CommonCompiler"; 112 FilePrefix = "CommonCompiler";
@@ -114,11 +115,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
114 FilePrefix = FilePrefix.Replace(c, '_'); 115 FilePrefix = FilePrefix.Replace(c, '_');
115 } 116 }
116 117
117 // First time we start? Delete old files
118 if (in_startup) 118 if (in_startup)
119 { 119 {
120 in_startup = false; 120 in_startup = false;
121 DeleteOldFiles(); 121 CreateScriptsDirectory();
122
123 // First time we start? Delete old files
124 if (DeleteScriptsOnStartup)
125 DeleteOldFiles();
122 } 126 }
123 127
124 // Map name and enum type of our supported languages 128 // Map name and enum type of our supported languages
@@ -187,11 +191,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
187 } 191 }
188 192
189 /// <summary> 193 /// <summary>
190 /// Delete old script files 194 /// Create the directory where compiled scripts are stored.
191 /// </summary> 195 /// </summary>
192 private void DeleteOldFiles() 196 private void CreateScriptsDirectory()
193 { 197 {
194 // CREATE FOLDER IF IT DOESNT EXIST
195 if (!Directory.Exists(ScriptEnginesPath)) 198 if (!Directory.Exists(ScriptEnginesPath))
196 { 199 {
197 try 200 try
@@ -218,7 +221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
218 m_scriptEngine.World.RegionInfo.RegionID.ToString()) + "\": " + ex.ToString()); 221 m_scriptEngine.World.RegionInfo.RegionID.ToString()) + "\": " + ex.ToString());
219 } 222 }
220 } 223 }
224 }
221 225
226 /// <summary>
227 /// Delete old script files
228 /// </summary>
229 private void DeleteOldFiles()
230 {
222 foreach (string file in Directory.GetFiles(Path.Combine(ScriptEnginesPath, 231 foreach (string file in Directory.GetFiles(Path.Combine(ScriptEnginesPath,
223 m_scriptEngine.World.RegionInfo.RegionID.ToString()), FilePrefix + "_compiled*")) 232 m_scriptEngine.World.RegionInfo.RegionID.ToString()), FilePrefix + "_compiled*"))
224 { 233 {