aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs50
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs38
-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
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs31
7 files changed, 100 insertions, 70 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ce7d97c..fd6d64c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5050,7 +5050,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5050 } 5050 }
5051 } 5051 }
5052 5052
5053 result.Add(src.Substring(start,length).Trim()); 5053 result.Add(new LSL_String(src.Substring(start,length).Trim()));
5054 5054
5055 return result; 5055 return result;
5056 } 5056 }
@@ -6900,7 +6900,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6900 // retain pathcurve 6900 // retain pathcurve
6901 shapeBlock.PathCurve = part.Shape.PathCurve; 6901 shapeBlock.PathCurve = part.Shape.PathCurve;
6902 6902
6903 part.Shape.SetSculptData((byte)type, sculptId); 6903 part.Shape.SetSculptProperties((byte)type, sculptId);
6904 part.Shape.SculptEntry = true; 6904 part.Shape.SculptEntry = true;
6905 part.UpdateShape(shapeBlock); 6905 part.UpdateShape(shapeBlock);
6906 } 6906 }
@@ -7391,7 +7391,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7391 UUID[] anims; 7391 UUID[] anims;
7392 anims = av.Animator.GetAnimationArray(); 7392 anims = av.Animator.GetAnimationArray();
7393 foreach (UUID foo in anims) 7393 foreach (UUID foo in anims)
7394 l.Add(foo.ToString()); 7394 l.Add(new LSL_Key(foo.ToString()));
7395 return l; 7395 return l;
7396 } 7396 }
7397 7397
@@ -7926,17 +7926,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7926 7926
7927 case (int)ScriptBaseClass.PRIM_TEXT: 7927 case (int)ScriptBaseClass.PRIM_TEXT:
7928 Color4 textColor = part.GetTextColor(); 7928 Color4 textColor = part.GetTextColor();
7929 res.Add(part.Text); 7929 res.Add(new LSL_String(part.Text));
7930 res.Add(new LSL_Vector(textColor.R, 7930 res.Add(new LSL_Vector(textColor.R,
7931 textColor.G, 7931 textColor.G,
7932 textColor.B)); 7932 textColor.B));
7933 res.Add(new LSL_Float(textColor.A)); 7933 res.Add(new LSL_Float(textColor.A));
7934 break; 7934 break;
7935 case (int)ScriptBaseClass.PRIM_NAME: 7935 case (int)ScriptBaseClass.PRIM_NAME:
7936 res.Add(part.Name); 7936 res.Add(new LSL_String(part.Name));
7937 break; 7937 break;
7938 case (int)ScriptBaseClass.PRIM_DESC: 7938 case (int)ScriptBaseClass.PRIM_DESC:
7939 res.Add(part.Description); 7939 res.Add(new LSL_String(part.Description));
7940 break; 7940 break;
7941 case (int)ScriptBaseClass.PRIM_ROT_LOCAL: 7941 case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
7942 res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W)); 7942 res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W));
@@ -9895,8 +9895,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9895 { 9895 {
9896 foreach (KeyValuePair<UUID, int> detectedParams in land.GetLandObjectOwners()) 9896 foreach (KeyValuePair<UUID, int> detectedParams in land.GetLandObjectOwners())
9897 { 9897 {
9898 ret.Add(detectedParams.Key.ToString()); 9898 ret.Add(new LSL_String(detectedParams.Key.ToString()));
9899 ret.Add(detectedParams.Value); 9899 ret.Add(new LSL_Integer(detectedParams.Value));
9900 } 9900 }
9901 } 9901 }
9902 ScriptSleep(2000); 9902 ScriptSleep(2000);
@@ -9946,25 +9946,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9946 switch (o.ToString()) 9946 switch (o.ToString())
9947 { 9947 {
9948 case "0": 9948 case "0":
9949 ret = ret + new LSL_List(land.Name); 9949 ret.Add(new LSL_String(land.Name));
9950 break; 9950 break;
9951 case "1": 9951 case "1":
9952 ret = ret + new LSL_List(land.Description); 9952 ret.Add(new LSL_String(land.Description));
9953 break; 9953 break;
9954 case "2": 9954 case "2":
9955 ret = ret + new LSL_List(land.OwnerID.ToString()); 9955 ret.Add(new LSL_Key(land.OwnerID.ToString()));
9956 break; 9956 break;
9957 case "3": 9957 case "3":
9958 ret = ret + new LSL_List(land.GroupID.ToString()); 9958 ret.Add(new LSL_Key(land.GroupID.ToString()));
9959 break; 9959 break;
9960 case "4": 9960 case "4":
9961 ret = ret + new LSL_List(land.Area); 9961 ret.Add(new LSL_Integer(land.Area));
9962 break; 9962 break;
9963 case "5": 9963 case "5":
9964 ret = ret + new LSL_List(land.GlobalID); 9964 ret.Add(new LSL_Key(land.GlobalID.ToString()));
9965 break; 9965 break;
9966 default: 9966 default:
9967 ret = ret + new LSL_List(0); 9967 ret.Add(new LSL_Integer(0));
9968 break; 9968 break;
9969 } 9969 }
9970 } 9970 }
@@ -9996,10 +9996,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9996 switch (o.ToString()) 9996 switch (o.ToString())
9997 { 9997 {
9998 case "1": 9998 case "1":
9999 ret.Add(av.Firstname + " " + av.Lastname); 9999 ret.Add(new LSL_String(av.Firstname + " " + av.Lastname));
10000 break; 10000 break;
10001 case "2": 10001 case "2":
10002 ret.Add(""); 10002 ret.Add(new LSL_String(""));
10003 break; 10003 break;
10004 case "3": 10004 case "3":
10005 ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z)); 10005 ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
@@ -10011,13 +10011,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10011 ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z)); 10011 ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z));
10012 break; 10012 break;
10013 case "6": 10013 case "6":
10014 ret.Add(id); 10014 ret.Add(new LSL_String(id));
10015 break; 10015 break;
10016 case "7": 10016 case "7":
10017 ret.Add(UUID.Zero.ToString()); 10017 ret.Add(new LSL_String(UUID.Zero.ToString()));
10018 break; 10018 break;
10019 case "8": 10019 case "8":
10020 ret.Add(UUID.Zero.ToString()); 10020 ret.Add(new LSL_String(UUID.Zero.ToString()));
10021 break; 10021 break;
10022 } 10022 }
10023 } 10023 }
@@ -10031,10 +10031,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10031 switch (o.ToString()) 10031 switch (o.ToString())
10032 { 10032 {
10033 case "1": 10033 case "1":
10034 ret.Add(obj.Name); 10034 ret.Add(new LSL_String(obj.Name));
10035 break; 10035 break;
10036 case "2": 10036 case "2":
10037 ret.Add(obj.Description); 10037 ret.Add(new LSL_String(obj.Description));
10038 break; 10038 break;
10039 case "3": 10039 case "3":
10040 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); 10040 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
@@ -10046,13 +10046,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10046 ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z)); 10046 ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z));
10047 break; 10047 break;
10048 case "6": 10048 case "6":
10049 ret.Add(obj.OwnerID.ToString()); 10049 ret.Add(new LSL_String(obj.OwnerID.ToString()));
10050 break; 10050 break;
10051 case "7": 10051 case "7":
10052 ret.Add(obj.GroupID.ToString()); 10052 ret.Add(new LSL_String(obj.GroupID.ToString()));
10053 break; 10053 break;
10054 case "8": 10054 case "8":
10055 ret.Add(obj.CreatorID.ToString()); 10055 ret.Add(new LSL_String(obj.CreatorID.ToString()));
10056 break; 10056 break;
10057 } 10057 }
10058 } 10058 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index 645566e..80daf5b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -130,7 +130,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
130 int idx = 0; 130 int idx = 0;
131 while (idx < rules.Length) 131 while (idx < rules.Length)
132 { 132 {
133 uint rule = (uint)rules.GetLSLIntegerItem(idx); 133 LSL_Integer ruleInt = rules.GetLSLIntegerItem(idx);
134 uint rule = (uint)ruleInt;
134 LSL_List toadd = new LSL_List(); 135 LSL_List toadd = new LSL_List();
135 136
136 switch (rule) 137 switch (rule)
@@ -247,7 +248,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
247 248
248 if (toadd.Length > 0) 249 if (toadd.Length > 0)
249 { 250 {
250 values.Add(rule); 251 values.Add(ruleInt);
251 values.Add(toadd.Data[0]); 252 values.Add(toadd.Data[0]);
252 } 253 }
253 idx++; 254 idx++;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 64931d0..b710229 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -38,7 +38,6 @@ using OpenSim;
38using OpenSim.Framework; 38using OpenSim.Framework;
39 39
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Region.CoreModules.Avatar.NPC;
42using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
44using OpenSim.Region.ScriptEngine.Shared; 43using OpenSim.Region.ScriptEngine.Shared;
@@ -812,7 +811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
812 World.ForEachScenePresence(delegate(ScenePresence sp) 811 World.ForEachScenePresence(delegate(ScenePresence sp)
813 { 812 {
814 if (!sp.IsChildAgent) 813 if (!sp.IsChildAgent)
815 result.Add(sp.Name); 814 result.Add(new LSL_String(sp.Name));
816 }); 815 });
817 return result; 816 return result;
818 } 817 }
@@ -970,7 +969,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
970 969
971 public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) 970 public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
972 { 971 {
973 CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); 972 CheckThreatLevel(ThreatLevel.None, "osDrawPolygon");
974 973
975 m_host.AddScriptLPS(1); 974 m_host.AddScriptLPS(1);
976 975
@@ -1241,7 +1240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1241 return String.Empty; 1240 return String.Empty;
1242 } 1241 }
1243 1242
1244 public void osSetWindParam(string plugin, string param, float value) 1243 public void osSetWindParam(string plugin, string param, LSL_Float value)
1245 { 1244 {
1246 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); 1245 CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
1247 m_host.AddScriptLPS(1); 1246 m_host.AddScriptLPS(1);
@@ -1251,13 +1250,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1251 { 1250 {
1252 try 1251 try
1253 { 1252 {
1254 module.WindParamSet(plugin, param, value); 1253 module.WindParamSet(plugin, param, (float)value);
1255 } 1254 }
1256 catch (Exception) { } 1255 catch (Exception) { }
1257 } 1256 }
1258 } 1257 }
1259 1258
1260 public float osGetWindParam(string plugin, string param) 1259 public LSL_Float osGetWindParam(string plugin, string param)
1261 { 1260 {
1262 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); 1261 CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
1263 m_host.AddScriptLPS(1); 1262 m_host.AddScriptLPS(1);
@@ -1409,7 +1408,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1409 { 1408 {
1410 // What actually is the difference to the LL function? 1409 // What actually is the difference to the LL function?
1411 // 1410 //
1412 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); 1411 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress");
1413 1412
1414 m_host.AddScriptLPS(1); 1413 m_host.AddScriptLPS(1);
1415 1414
@@ -1910,8 +1909,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1910 }; 1909 };
1911 1910
1912 return NotecardCache.GetLines(assetID); 1911 return NotecardCache.GetLines(assetID);
1913
1914
1915 } 1912 }
1916 1913
1917 public string osAvatarName2Key(string firstname, string lastname) 1914 public string osAvatarName2Key(string firstname, string lastname)
@@ -2025,16 +2022,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2025 // Find matches beginning at start position 2022 // Find matches beginning at start position
2026 Regex matcher = new Regex(pattern); 2023 Regex matcher = new Regex(pattern);
2027 Match match = matcher.Match(src, start); 2024 Match match = matcher.Match(src, start);
2028 if (match.Success) 2025 while (match.Success)
2029 { 2026 {
2030 foreach (System.Text.RegularExpressions.Group g in match.Groups) 2027 foreach (System.Text.RegularExpressions.Group g in match.Groups)
2031 { 2028 {
2032 if (g.Success) 2029 if (g.Success)
2033 { 2030 {
2034 result.Add(g.Value); 2031 result.Add(new LSL_String(g.Value));
2035 result.Add(g.Index); 2032 result.Add(new LSL_Integer(g.Index));
2036 } 2033 }
2037 } 2034 }
2035
2036 match = match.NextMatch();
2038 } 2037 }
2039 2038
2040 return result; 2039 return result;
@@ -2209,12 +2208,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2209 return (int)pws; 2208 return (int)pws;
2210 } 2209 }
2211 2210
2212 public void osSetSpeed(string UUID, float SpeedModifier) 2211 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
2213 { 2212 {
2214 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 2213 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
2215 m_host.AddScriptLPS(1); 2214 m_host.AddScriptLPS(1);
2216 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 2215 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
2217 avatar.SpeedModifier = SpeedModifier; 2216 avatar.SpeedModifier = (float)SpeedModifier;
2218 } 2217 }
2219 2218
2220 public void osKickAvatar(string FirstName,string SurName,string alert) 2219 public void osKickAvatar(string FirstName,string SurName,string alert)
@@ -2295,14 +2294,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2295 { 2294 {
2296 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 2295 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
2297 m_host.AddScriptLPS(1); 2296 m_host.AddScriptLPS(1);
2297 InitLSL();
2298 2298
2299 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); 2299 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
2300 } 2300 }
2301 2301
2302 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) 2302 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
2303 { 2303 {
2304 CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); 2304 CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
2305 m_host.AddScriptLPS(1); 2305 m_host.AddScriptLPS(1);
2306 InitLSL();
2306 2307
2307 m_LSL_Api.SetPrimitiveParamsEx(prim, rules); 2308 m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
2308 } 2309 }
@@ -2364,9 +2365,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2364 { 2365 {
2365 if (avatar.IsChildAgent == false) 2366 if (avatar.IsChildAgent == false)
2366 { 2367 {
2367 result.Add(avatar.UUID); 2368 result.Add(new LSL_String(avatar.UUID.ToString()));
2368 result.Add(avatar.AbsolutePosition); 2369 OpenMetaverse.Vector3 ap = avatar.AbsolutePosition;
2369 result.Add(avatar.Name); 2370 result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z));
2371 result.Add(new LSL_String(avatar.Name));
2370 } 2372 }
2371 } 2373 }
2372 }); 2374 });
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 63007c6..19352f0 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 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 461b473..d848b2a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1379,7 +1379,9 @@ namespace OpenSim.Region.ScriptEngine.Shared
1379 public struct LSLString 1379 public struct LSLString
1380 { 1380 {
1381 public string m_string; 1381 public string m_string;
1382
1382 #region Constructors 1383 #region Constructors
1384
1383 public LSLString(string s) 1385 public LSLString(string s)
1384 { 1386 {
1385 m_string = s; 1387 m_string = s;
@@ -1387,22 +1389,24 @@ namespace OpenSim.Region.ScriptEngine.Shared
1387 1389
1388 public LSLString(double d) 1390 public LSLString(double d)
1389 { 1391 {
1390 string s=String.Format(Culture.FormatProvider, "{0:0.000000}", d); 1392 string s = String.Format(Culture.FormatProvider, "{0:0.000000}", d);
1391 m_string=s; 1393 m_string = s;
1392 } 1394 }
1393 1395
1394 public LSLString(LSLFloat f) 1396 public LSLString(LSLFloat f)
1395 { 1397 {
1396 string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value); 1398 string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value);
1397 m_string=s; 1399 m_string = s;
1398 } 1400 }
1399 1401
1400 public LSLString(LSLInteger i) 1402 public LSLString(int i)
1401 { 1403 {
1402 string s = String.Format("{0}", i); 1404 string s = String.Format("{0}", i);
1403 m_string = s; 1405 m_string = s;
1404 } 1406 }
1405 1407
1408 public LSLString(LSLInteger i) : this(i.value) {}
1409
1406 #endregion 1410 #endregion
1407 1411
1408 #region Operators 1412 #region Operators
@@ -1469,6 +1473,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
1469 { 1473 {
1470 return new LSLString(d); 1474 return new LSLString(d);
1471 } 1475 }
1476
1477 static public explicit operator LSLString(int i)
1478 {
1479 return new LSLString(i);
1480 }
1472 1481
1473 public static explicit operator LSLString(LSLFloat f) 1482 public static explicit operator LSLString(LSLFloat f)
1474 { 1483 {
@@ -1742,7 +1751,17 @@ namespace OpenSim.Region.ScriptEngine.Shared
1742 public override bool Equals(Object o) 1751 public override bool Equals(Object o)
1743 { 1752 {
1744 if (!(o is LSLInteger)) 1753 if (!(o is LSLInteger))
1745 return false; 1754 {
1755 if (o is int)
1756 {
1757 return value == (int)o;
1758 }
1759 else
1760 {
1761 return false;
1762 }
1763 }
1764
1746 return value == ((LSLInteger)o).value; 1765 return value == ((LSLInteger)o).value;
1747 } 1766 }
1748 1767