Merge branch 'master' into vehicles

This commit is contained in:
Melanie
2009-10-01 14:08:15 +01:00
307 changed files with 3296 additions and 5638 deletions

View File

@@ -225,7 +225,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
m_log.ErrorFormat(
"[{0}]: Event queue thread terminating with exception. PLEASE REBOOT YOUR SIM - SCRIPT EVENTS WILL NOT WORK UNTIL YOU DO. Exception is {1}",
ScriptEngineName, e);
ScriptEngineName, e);
}
}

View File

@@ -418,7 +418,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{
InstanceData id = m_ScriptManager.GetScript(localID, itemID);
if (id == null)
return;
return;
if (!id.Disabled)
id.Running = true;
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{
InstanceData id = m_ScriptManager.GetScript(localID, itemID);
if (id == null)
return;
return;
id.Running = false;
}
@@ -442,7 +442,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
InstanceData id = m_ScriptManager.GetScript(localID, itemID);
if (id == null)
return;
return;
IEventQueue eq = World.RequestModuleInterface<IEventQueue>();
if (eq == null)

View File

@@ -520,13 +520,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
ExeStage = 5; // ;^) Ewe Loon, for debuging
}
catch (Exception e) // ;^) Ewe Loon, From here down tis fix
{
{
if ((ExeStage == 3)&&(qParams.Length>0))
detparms.Remove(id);
SceneObjectPart ob = m_scriptEngine.World.GetSceneObjectPart(localID);
m_log.InfoFormat("[Script Error] ,{0},{1},@{2},{3},{4},{5}", ob.Name , FunctionName, ExeStage, e.Message, qParams.Length, detparms.Count);
if (ExeStage != 2) throw e;
}
}
}
public uint GetLocalID(UUID itemID)

View File

@@ -50,6 +50,9 @@ using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using AssetLandmark = OpenSim.Framework.AssetLandmark;
@@ -2010,10 +2013,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
}
else
q = part.ParentGroup.GroupRotation; // Likely never get here but just in case
q = part.ParentGroup.Rotation; // Likely never get here but just in case
}
else
q = part.ParentGroup.GroupRotation; // just the group rotation
q = part.ParentGroup.Rotation; // just the group rotation
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
}
q = part.GetWorldRotation();
@@ -5002,6 +5005,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (end > src.Length)
end = src.Length;
if (stride == 0)
stride = 1;
// There may be one or two ranges to be considered
if (start != end)
@@ -5028,9 +5034,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// A negative stride reverses the direction of the
// scan producing an inverted list as a result.
if (stride == 0)
stride = 1;
if (stride > 0)
{
for (int i = 0; i < src.Length; i += stride)
@@ -5054,7 +5057,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
else
{
result.Add(src.Data[start]);
if (start%stride == 0)
{
result.Add(src.Data[start]);
}
}
return result;
@@ -5232,12 +5238,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
List<SimpleRegionInfo> neighbors = World.CommsManager.GridService.RequestNeighbours(World.RegionInfo.RegionLocX, World.RegionInfo.RegionLocY);
List<GridRegion> neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID);
uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x;
uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y;
foreach (SimpleRegionInfo sri in neighbors)
foreach (GridRegion sri in neighbors)
{
if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY)
return 0;
@@ -7178,10 +7184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
else
q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case
q = m_host.ParentGroup.Rotation; // Likely never get here but just in case
}
else
q = m_host.ParentGroup.GroupRotation; // just the group rotation
q = m_host.ParentGroup.Rotation; // just the group rotation
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
}
@@ -8184,7 +8190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string reply = String.Empty;
RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator);
GridRegion info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator);
switch (data)
{
@@ -8211,7 +8217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ConditionalScriptSleep(1000);
return UUID.Zero.ToString();
}
int access = info.RegionSettings.Maturity;
int access = info.Maturity;
if (access == 0)
reply = "PG";
else if (access == 1)

View File

@@ -48,6 +48,8 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using System.Text.RegularExpressions;
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
@@ -599,17 +601,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (regionName.Contains(".") && regionName.Contains(":"))
{
// Try to link the region
RegionInfo regInfo = HGHyperlink.TryLinkRegion(World,
presence.ControllingClient,
regionName);
// Get the region name
if (regInfo != null)
IHyperlinkService hyperService = World.RequestModuleInterface<IHyperlinkService>();
if (hyperService != null)
{
regionName = regInfo.RegionName;
}
else
{
// Might need to ping the client here in case of failure??
GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient,
regionName);
// Get the region name
if (regInfo != null)
{
regionName = regInfo.RegionName;
}
else
{
// Might need to ping the client here in case of failure??
}
}
}
presence.ControllingClient.SendTeleportLocationStart();

View File

@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osWindActiveModelPluginName();
}
// Not yet plugged in as available OSSL functions, so commented out
// Not yet plugged in as available OSSL functions, so commented out
// void osWindParamSet(string plugin, string param, float value)
// {
// m_OSSL_Functions.osWindParamSet(plugin, param, value);
@@ -329,7 +329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public string osGetSimulatorVersion()
{
return m_OSSL_Functions.osGetSimulatorVersion();
return m_OSSL_Functions.osGetSimulatorVersion();
}
public Hashtable osParseJSON(string JSON)

View File

@@ -546,11 +546,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
bool retried = false;
do
{
lock (CScodeProvider)
{
results = CScodeProvider.CompileAssemblyFromSource(
parameters, Script);
}
lock (CScodeProvider)
{
results = CScodeProvider.CompileAssemblyFromSource(
parameters, Script);
}
// Deal with an occasional segv in the compiler.
// Rarely, if ever, occurs twice in succession.
// Line # == 0 and no file name are indications that
@@ -573,20 +573,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
{
complete = true;
}
}
while(!complete);
} while (!complete);
break;
case enumCompileType.js:
results = JScodeProvider.CompileAssemblyFromSource(
parameters, Script);
parameters, Script);
break;
case enumCompileType.yp:
results = YPcodeProvider.CompileAssemblyFromSource(
parameters, Script);
parameters, Script);
break;
default:
throw new Exception("Compiler is not able to recongnize "+
"language type \"" + lang.ToString() + "\"");
"language type \"" + lang.ToString() + "\"");
}
// Check result
@@ -602,12 +601,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
{
foreach (CompilerError CompErr in results.Errors)
{
string severity = "Error";
if (CompErr.IsWarning)
{
severity = "Warning";
}
string severity = CompErr.IsWarning ? "Warning" : "Error";
KeyValuePair<int, int> lslPos;
@@ -615,18 +609,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
if (severity == "Error")
{
lslPos = FindErrorPosition(CompErr.Line, CompErr.Column);
string text = CompErr.ErrorText;
lslPos = FindErrorPosition(CompErr.Line, CompErr.Column);
string text = CompErr.ErrorText;
// Use LSL type names
if (lang == enumCompileType.lsl)
text = ReplaceTypes(CompErr.ErrorText);
// Use LSL type names
if (lang == enumCompileType.lsl)
text = ReplaceTypes(CompErr.ErrorText);
// The Second Life viewer's script editor begins
// countingn lines and columns at 0, so we subtract 1.
errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
lslPos.Key - 1, lslPos.Value - 1,
CompErr.ErrorNumber, text, severity);
// The Second Life viewer's script editor begins
// countingn lines and columns at 0, so we subtract 1.
errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
lslPos.Key - 1, lslPos.Value - 1,
CompErr.ErrorNumber, text, severity);
hadErrors = true;
}
}

View File

@@ -218,16 +218,14 @@ namespace OpenSim.Region.ScriptEngine.Shared
}
}
Position = new LSL_Types.Vector3(part.AbsolutePosition.X,
part.AbsolutePosition.Y,
part.AbsolutePosition.Z);
Vector3 absPos = part.AbsolutePosition;
Position = new LSL_Types.Vector3(absPos.X, absPos.Y, absPos.Z);
Quaternion wr = part.ParentGroup.GroupRotation;
Quaternion wr = part.ParentGroup.Rotation;
Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W);
Velocity = new LSL_Types.Vector3(part.Velocity.X,
part.Velocity.Y,
part.Velocity.Z);
Vector3 vel = part.Velocity;
Velocity = new LSL_Types.Vector3(vel.X, vel.Y, vel.Z);
}
}

View File

@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
"SecondLife.Script");
//ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
// lease.Register(this);
}
catch (Exception)
@@ -430,7 +430,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
permsMask = part.TaskInventory[m_ItemID].PermsMask;
}
}
if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
{
@@ -630,7 +630,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
/// <summary>
/// Process the next event queued for this script
/// </summary>
/// <returns></returns>
/// <returns></returns>
public object EventProcessor()
{
lock (m_Script)
@@ -925,7 +925,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
public override string ToString()
{
return String.Format("{0} {1} on {2}", m_ScriptName, m_ItemID, m_PrimName);
return String.Format("{0} {1} on {2}", m_ScriptName, m_ItemID, m_PrimName);
}
string FormatException(Exception e)

View File

@@ -554,7 +554,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// We must look for the part outside the m_Scripts lock because GetSceneObjectPart later triggers the
// m_parts lock on SOG. At the same time, a scene object that is being deleted will take the m_parts lock
// and then later on try to take the m_scripts lock in this class when it calls OnRemoveScript()
// and then later on try to take the m_scripts lock in this class when it calls OnRemoveScript()
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
if (part == null)
{
@@ -562,7 +562,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_ScriptErrorMessage += "SceneObjectPart unavailable. Script NOT started.\n";
m_ScriptFailCount++;
return false;
}
}
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
if (item == null)
@@ -692,7 +692,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
AppDomain.CreateDomain(
m_Scene.RegionInfo.RegionID.ToString(),
evidence, appSetup);
/*
/*
PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
@@ -925,7 +925,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new XWorkItem(m_ThreadPool.QueueWorkItem(
new WorkItemCallback(this.ProcessEventHandler),
parms));
}
}
/// <summary>
/// Process a previously posted script event.