From 0dd3281caf09090e86036d67a34939b0e31c1b16 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Tue, 21 Jun 2011 12:43:44 +0300
Subject: Optionally, don't delete previously compiled scripts on startup
---
.../Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
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
// Get some config
WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", false);
CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true);
+ bool DeleteScriptsOnStartup = m_scriptEngine.Config.GetBoolean("DeleteScriptsOnStartup", true);
// Get file prefix from scriptengine name and make it file system safe:
FilePrefix = "CommonCompiler";
@@ -114,11 +115,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
FilePrefix = FilePrefix.Replace(c, '_');
}
- // First time we start? Delete old files
if (in_startup)
{
in_startup = false;
- DeleteOldFiles();
+ CreateScriptsDirectory();
+
+ // First time we start? Delete old files
+ if (DeleteScriptsOnStartup)
+ DeleteOldFiles();
}
// Map name and enum type of our supported languages
@@ -187,11 +191,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
}
///
- /// Delete old script files
+ /// Create the directory where compiled scripts are stored.
///
- private void DeleteOldFiles()
+ private void CreateScriptsDirectory()
{
- // CREATE FOLDER IF IT DOESNT EXIST
if (!Directory.Exists(ScriptEnginesPath))
{
try
@@ -218,7 +221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
m_scriptEngine.World.RegionInfo.RegionID.ToString()) + "\": " + ex.ToString());
}
}
+ }
+ ///
+ /// Delete old script files
+ ///
+ private void DeleteOldFiles()
+ {
foreach (string file in Directory.GetFiles(Path.Combine(ScriptEnginesPath,
m_scriptEngine.World.RegionInfo.RegionID.ToString()), FilePrefix + "_compiled*"))
{
--
cgit v1.1
From 882d5c82b308a95c4897893d2b8e6b816f827d31 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Fri, 24 Jun 2011 19:40:21 +0900
Subject: [PATCH 1/2] Fixed the function names of some OSSL functions shown as
threat-level check error message
Signed-off-by: BlueWall
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 64931d0..201fef4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -970,7 +970,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
{
- CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon");
+ CheckThreatLevel(ThreatLevel.None, "osDrawPolygon");
m_host.AddScriptLPS(1);
@@ -1409,7 +1409,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
// What actually is the difference to the LL function?
//
- CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL");
+ CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress");
m_host.AddScriptLPS(1);
@@ -2301,7 +2301,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
{
- CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
+ CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
m_host.AddScriptLPS(1);
m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
--
cgit v1.1
From ffa790d69d4e9b1b50470f84b0ad198098dc2736 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Mon, 27 Jun 2011 19:30:42 +0900
Subject: [PATCH] Get osGetWindParam() and osSetWindParam() accessible
Signed-off-by: BlueWall
---
.../Shared/Api/Implementation/OSSL_Api.cs | 6 +++---
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 ++--
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 19 +++++++++----------
3 files changed, 14 insertions(+), 15 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 201fef4..f32ecca 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1241,7 +1241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return String.Empty;
}
- public void osSetWindParam(string plugin, string param, float value)
+ public void osSetWindParam(string plugin, string param, LSL_Float value)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
m_host.AddScriptLPS(1);
@@ -1251,13 +1251,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
try
{
- module.WindParamSet(plugin, param, value);
+ module.WindParamSet(plugin, param, (float)value);
}
catch (Exception) { }
}
}
- public float osGetWindParam(string plugin, string param)
+ public LSL_Float osGetWindParam(string plugin, string param)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 63007c6..7227b40 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
// Wind Module Functions
string osWindActiveModelPluginName();
- void osSetWindParam(string plugin, string param, float value);
- float osGetWindParam(string plugin, string param);
+ void osSetWindParam(string plugin, string param, LSL_Float value);
+ LSL_Float osGetWindParam(string plugin, string param);
// Parcel commands
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 e3ea556..f5bdc68 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
return m_OSSL_Functions.osWindActiveModelPluginName();
}
-// Not yet plugged in as available OSSL functions, so commented out
-// void osSetWindParam(string plugin, string param, float value)
-// {
-// m_OSSL_Functions.osSetWindParam(plugin, param, value);
-// }
-//
-// float osGetWindParam(string plugin, string param)
-// {
-// return m_OSSL_Functions.osGetWindParam(plugin, param);
-// }
+ public void osSetWindParam(string plugin, string param, LSL_Float value)
+ {
+ m_OSSL_Functions.osSetWindParam(plugin, param, value);
+ }
+
+ public LSL_Float osGetWindParam(string plugin, string param)
+ {
+ return m_OSSL_Functions.osGetWindParam(plugin, param);
+ }
public void osParcelJoin(vector pos1, vector pos2)
{
--
cgit v1.1
From 80010f89085af9517e26af01dfe7cbc99788aa31 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Tue, 28 Jun 2011 22:21:53 +0900
Subject: [PATCH] osSetSpeed() will accept float number
Signed-off-by: BlueWall
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++--
OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 +-
OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index f32ecca..b098f09 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2209,12 +2209,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return (int)pws;
}
- public void osSetSpeed(string UUID, float SpeedModifier)
+ public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
m_host.AddScriptLPS(1);
ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
- avatar.SpeedModifier = SpeedModifier;
+ avatar.SpeedModifier = (float)SpeedModifier;
}
public void osKickAvatar(string FirstName,string SurName,string alert)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 7227b40..19352f0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -180,7 +180,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
int osGetSimulatorMemory();
void osKickAvatar(string FirstName,string SurName,string alert);
- void osSetSpeed(string UUID, float SpeedModifier);
+ void osSetSpeed(string UUID, LSL_Float SpeedModifier);
void osCauseHealing(string avatar, double healing);
void osCauseDamage(string avatar, double damage);
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 f5bdc68..7c59098 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -713,7 +713,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
}
- public void osSetSpeed(string UUID, float SpeedModifier)
+ public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
}
--
cgit v1.1
From ee92f22f2ab9a1f2926ac3a9d4e1b9c26945d898 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Sat, 25 Jun 2011 11:13:55 +0900
Subject: [PATCH 2/2] [FIX] osGetPrimitiveParams() and osSetPrimitiveParams()
crashes throwing System.NullReferenceException
Signed-off-by: BlueWall
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b098f09..963727d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2295,6 +2295,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
m_host.AddScriptLPS(1);
+ InitLSL();
return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
}
@@ -2303,6 +2304,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
m_host.AddScriptLPS(1);
+ InitLSL();
m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
}
--
cgit v1.1
From 513d63455ed7cf1a7a859e9e8abaeff7e7c7ad4f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 2 Jul 2011 01:01:40 +0100
Subject: Create a very basic initial test which just creates an 'npc' and
tests that the scene presence exists
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 963727d..1bc4534 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;
using OpenSim.Framework;
using OpenSim.Framework.Console;
-using OpenSim.Region.CoreModules.Avatar.NPC;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Shared;
--
cgit v1.1
From d79c6c8820e7219afa3f01a0910a794bcdbb307d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 9 Jul 2011 00:42:48 +0100
Subject: Rename SetSculptData() to SetSculptProperties(), since this is what
it does (setting SculptData is done through the property)
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ce7d97c..22f8ddb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6900,7 +6900,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// retain pathcurve
shapeBlock.PathCurve = part.Shape.PathCurve;
- part.Shape.SetSculptData((byte)type, sculptId);
+ part.Shape.SetSculptProperties((byte)type, sculptId);
part.Shape.SculptEntry = true;
part.UpdateShape(shapeBlock);
}
--
cgit v1.1
From e7abf834d1b51353ec90f424b87487bbeb391582 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Mon, 4 Jul 2011 22:45:21 +0900
Subject: Instance-types-in-list fix for LSL/OSSL functions. This will fix
llListFindList() which always returns -1 when you compare with the list from
those functions.
*llCSV2List
*llGetAnimationList
*llGetLinkPrimitiveParams
*llGetObjectDetails
*llGetParcelDetails
*llGetParcelPrimOwners
*llGetPrimitiveParams
*GetLinkPrimitiveParamsEx
*osGetAgents
*osMatchString
*osGetLinkPrimitiveParams
*osGetPrimitiveParams
*osGetAvatarList
---
.../Shared/Api/Implementation/LSL_Api.cs | 48 +++++++++++-----------
.../Shared/Api/Implementation/OSSL_Api.cs | 13 +++---
2 files changed, 31 insertions(+), 30 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 22f8ddb..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
}
}
- result.Add(src.Substring(start,length).Trim());
+ result.Add(new LSL_String(src.Substring(start,length).Trim()));
return result;
}
@@ -7391,7 +7391,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID[] anims;
anims = av.Animator.GetAnimationArray();
foreach (UUID foo in anims)
- l.Add(foo.ToString());
+ l.Add(new LSL_Key(foo.ToString()));
return l;
}
@@ -7926,17 +7926,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_TEXT:
Color4 textColor = part.GetTextColor();
- res.Add(part.Text);
+ res.Add(new LSL_String(part.Text));
res.Add(new LSL_Vector(textColor.R,
textColor.G,
textColor.B));
res.Add(new LSL_Float(textColor.A));
break;
case (int)ScriptBaseClass.PRIM_NAME:
- res.Add(part.Name);
+ res.Add(new LSL_String(part.Name));
break;
case (int)ScriptBaseClass.PRIM_DESC:
- res.Add(part.Description);
+ res.Add(new LSL_String(part.Description));
break;
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
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
{
foreach (KeyValuePair detectedParams in land.GetLandObjectOwners())
{
- ret.Add(detectedParams.Key.ToString());
- ret.Add(detectedParams.Value);
+ ret.Add(new LSL_String(detectedParams.Key.ToString()));
+ ret.Add(new LSL_Integer(detectedParams.Value));
}
}
ScriptSleep(2000);
@@ -9946,25 +9946,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
switch (o.ToString())
{
case "0":
- ret = ret + new LSL_List(land.Name);
+ ret.Add(new LSL_String(land.Name));
break;
case "1":
- ret = ret + new LSL_List(land.Description);
+ ret.Add(new LSL_String(land.Description));
break;
case "2":
- ret = ret + new LSL_List(land.OwnerID.ToString());
+ ret.Add(new LSL_Key(land.OwnerID.ToString()));
break;
case "3":
- ret = ret + new LSL_List(land.GroupID.ToString());
+ ret.Add(new LSL_Key(land.GroupID.ToString()));
break;
case "4":
- ret = ret + new LSL_List(land.Area);
+ ret.Add(new LSL_Integer(land.Area));
break;
case "5":
- ret = ret + new LSL_List(land.GlobalID);
+ ret.Add(new LSL_Key(land.GlobalID.ToString()));
break;
default:
- ret = ret + new LSL_List(0);
+ ret.Add(new LSL_Integer(0));
break;
}
}
@@ -9996,10 +9996,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
switch (o.ToString())
{
case "1":
- ret.Add(av.Firstname + " " + av.Lastname);
+ ret.Add(new LSL_String(av.Firstname + " " + av.Lastname));
break;
case "2":
- ret.Add("");
+ ret.Add(new LSL_String(""));
break;
case "3":
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
ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z));
break;
case "6":
- ret.Add(id);
+ ret.Add(new LSL_String(id));
break;
case "7":
- ret.Add(UUID.Zero.ToString());
+ ret.Add(new LSL_String(UUID.Zero.ToString()));
break;
case "8":
- ret.Add(UUID.Zero.ToString());
+ ret.Add(new LSL_String(UUID.Zero.ToString()));
break;
}
}
@@ -10031,10 +10031,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
switch (o.ToString())
{
case "1":
- ret.Add(obj.Name);
+ ret.Add(new LSL_String(obj.Name));
break;
case "2":
- ret.Add(obj.Description);
+ ret.Add(new LSL_String(obj.Description));
break;
case "3":
ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
@@ -10046,13 +10046,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z));
break;
case "6":
- ret.Add(obj.OwnerID.ToString());
+ ret.Add(new LSL_String(obj.OwnerID.ToString()));
break;
case "7":
- ret.Add(obj.GroupID.ToString());
+ ret.Add(new LSL_String(obj.GroupID.ToString()));
break;
case "8":
- ret.Add(obj.CreatorID.ToString());
+ ret.Add(new LSL_String(obj.CreatorID.ToString()));
break;
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 1bc4534..b3f90e2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -811,7 +811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
World.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!sp.IsChildAgent)
- result.Add(sp.Name);
+ result.Add(new LSL_String(sp.Name));
});
return result;
}
@@ -2030,8 +2030,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (g.Success)
{
- result.Add(g.Value);
- result.Add(g.Index);
+ result.Add(new LSL_String(g.Value));
+ result.Add(new LSL_Integer(g.Index));
}
}
}
@@ -2365,9 +2365,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (avatar.IsChildAgent == false)
{
- result.Add(avatar.UUID);
- result.Add(avatar.AbsolutePosition);
- result.Add(avatar.Name);
+ result.Add(new LSL_String(avatar.UUID.ToString()));
+ OpenMetaverse.Vector3 ap = avatar.AbsolutePosition;
+ result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z));
+ result.Add(new LSL_String(avatar.Name));
}
}
});
--
cgit v1.1
From 04f8d0e45dae6b773e49532e4cd31ee290f9a677 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Thu, 7 Jul 2011 23:36:41 +0900
Subject: Made some LSL_Constant or LS_Constant raw int values
---
OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 461b473..0839ab4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1741,8 +1741,13 @@ namespace OpenSim.Region.ScriptEngine.Shared
public override bool Equals(Object o)
{
- if (!(o is LSLInteger))
- return false;
+ if (!(o is LSLInteger)) {
+ if(o is int) {
+ return value == (int)o;
+ } else {
+ return false;
+ }
+ }
return value == ((LSLInteger)o).value;
}
--
cgit v1.1
From b983f38e2abc4ee28a572c680ba267138064ed5c Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Thu, 7 Jul 2011 23:38:22 +0900
Subject: lsGetWindlightScene() returns raw int value, which makes unable to
compare to another value with llListFindList()
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
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
int idx = 0;
while (idx < rules.Length)
{
- uint rule = (uint)rules.GetLSLIntegerItem(idx);
+ LSL_Integer ruleInt = rules.GetLSLIntegerItem(idx);
+ uint rule = (uint)ruleInt;
LSL_List toadd = new LSL_List();
switch (rule)
@@ -247,7 +248,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (toadd.Length > 0)
{
- values.Add(rule);
+ values.Add(ruleInt);
values.Add(toadd.Data[0]);
}
idx++;
--
cgit v1.1
From 52c3671aa07c5d4c91908a8e1b15b76e96cc49c0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 9 Jul 2011 01:17:35 +0100
Subject: fix formatting issues from last patch
---
OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 0839ab4..e0a4014 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1741,13 +1741,18 @@ namespace OpenSim.Region.ScriptEngine.Shared
public override bool Equals(Object o)
{
- if (!(o is LSLInteger)) {
- if(o is int) {
+ if (!(o is LSLInteger))
+ {
+ if (o is int)
+ {
return value == (int)o;
- } else {
+ }
+ else
+ {
return false;
}
}
+
return value == ((LSLInteger)o).value;
}
--
cgit v1.1
From f680c134955b3179265ec197c935ed86b397b6ad Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 9 Jul 2011 01:24:30 +0100
Subject: Fix osMatchString() so that it reports all instance of pattern
matches, not just the first one.
This is a slight adaptation of the patch in http://opensimulator.org/mantis/view.php?id=4568 which doesn't apply directly since the underlying code was changed by earlier makopoppo patches.
Thanks makopoppo!
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b3f90e2..b710229 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1909,8 +1909,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
};
return NotecardCache.GetLines(assetID);
-
-
}
public string osAvatarName2Key(string firstname, string lastname)
@@ -2024,7 +2022,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Find matches beginning at start position
Regex matcher = new Regex(pattern);
Match match = matcher.Match(src, start);
- if (match.Success)
+ while (match.Success)
{
foreach (System.Text.RegularExpressions.Group g in match.Groups)
{
@@ -2034,6 +2032,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
result.Add(new LSL_Integer(g.Index));
}
}
+
+ match = match.NextMatch();
}
return result;
--
cgit v1.1
From df586c9d2502523395b53d48ddd7dda8832c7a08 Mon Sep 17 00:00:00 2001
From: Makopoppo
Date: Tue, 5 Jul 2011 22:19:26 +0900
Subject: Raw int numbers (ex.LSL Constants) are displayed like "1.000000" when
type cast to string
---
OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 11 +++++++++++
1 file changed, 11 insertions(+)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index e0a4014..bf66b12 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1396,6 +1396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value);
m_string=s;
}
+
+ public LSLString(int i)
+ {
+ string s = String.Format("{0}", i);
+ m_string = s;
+ }
public LSLString(LSLInteger i)
{
@@ -1469,6 +1475,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
{
return new LSLString(d);
}
+
+ static public explicit operator LSLString(int i)
+ {
+ return new LSLString(i);
+ }
public static explicit operator LSLString(LSLFloat f)
{
--
cgit v1.1
From 6963b8b046f8a236d5a6e75a0fed81103d807c21 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 9 Jul 2011 01:28:27 +0100
Subject: refactor: Get LSLString(LSLInteger i) constructor to now call
LSLString(int i) structure to remove code duplication.
---
OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/Shared')
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index bf66b12..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
public struct LSLString
{
public string m_string;
+
#region Constructors
+
public LSLString(string s)
{
m_string = s;
@@ -1387,14 +1389,14 @@ namespace OpenSim.Region.ScriptEngine.Shared
public LSLString(double d)
{
- string s=String.Format(Culture.FormatProvider, "{0:0.000000}", d);
- m_string=s;
+ string s = String.Format(Culture.FormatProvider, "{0:0.000000}", d);
+ m_string = s;
}
public LSLString(LSLFloat f)
{
string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value);
- m_string=s;
+ m_string = s;
}
public LSLString(int i)
@@ -1403,12 +1405,8 @@ namespace OpenSim.Region.ScriptEngine.Shared
m_string = s;
}
- public LSLString(LSLInteger i)
- {
- string s = String.Format("{0}", i);
- m_string = s;
- }
-
+ public LSLString(LSLInteger i) : this(i.value) {}
+
#endregion
#region Operators
--
cgit v1.1