Formatting cleanup, minor refactoring, svn properties.

0.6.0-stable
Jeff Ames 2008-06-04 09:59:27 +00:00
parent 0a2d399cad
commit 4ec4e16c80
59 changed files with 851 additions and 834 deletions

View File

@ -137,6 +137,7 @@ namespace OpenSim.Framework
}
}
}
[Obsolete("Using Obsolete to drive development is invalid. Obsolete presumes that something new has already been created to replace this.")]
public uint[] GetAllCircuits(LLUUID agentId)
{

View File

@ -224,14 +224,14 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw);
LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw);
LSL_Types.Quaternion a = new LSL_Types.Quaternion();
//This multiplication doesnt compile, yet. a = a1 * a2 * a3;
//This multiplication doesn't compile, yet. a = a1 * a2 * a3;
LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax*bw*cw + aw*by*cz,
aw*by*cw - ax*bw*cz, aw*bw*cz + ax*by*cw,
aw*bw*cw - ax*by*cz);
LSL_Types.Quaternion c = new LSL_Types.Quaternion();
//This addition doesnt compile yet c = a + b;
//This addition doesn't compile yet c = a + b;
LSL_Types.Quaternion d = new LSL_Types.Quaternion();
//This addition doesnt compile yet d = a - b;
//This addition doesn't compile yet d = a - b;
if ((Math.Abs(c.X) > err && Math.Abs(d.X) > err) ||
(Math.Abs(c.Y) > err && Math.Abs(d.Y) > err) ||
(Math.Abs(c.Z) > err && Math.Abs(d.Z) > err) ||

View File

@ -647,7 +647,7 @@ namespace OpenSim.Region.Communications.OGS1
try
{
ch = new TcpChannel((int)NetworkServersInfo.RemotingListenerPort);
ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this.
ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesn't support this.
}
catch (Exception ex)
{

View File

@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes
Vector3 normalpart = ipoint - vAbsolutePosition;
returnresult.normal = normalpart / normalpart.Length;
// It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesnt.
// It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesn't.
// I can write a function to do it.. but I like the fact that this one is Static.
LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z);

View File

@ -165,7 +165,7 @@ namespace OpenSim.Region.Physics.Meshing
for (int i = 0; i < workingMiddle.vertices.Count; i++)
{
int iNext = (i + 1);
int iNext = i + 1;
if (workingMiddle.vertices[i] == null) // Can't make a simplex here
{
@ -200,7 +200,7 @@ namespace OpenSim.Region.Physics.Meshing
iLastNull = 0;
for (int i = 0; i < workingPlus.vertices.Count; i++)
{
int iNext = (i + 1);
int iNext = i + 1;
if (workingPlus.vertices[i] == null) // Can't make a simplex here
{
@ -261,7 +261,7 @@ namespace OpenSim.Region.Physics.Meshing
float twistTotal = twistTop - twistBot;
// if the profile has a lot of twist, add more layers otherwise the layers may overlap
// and the resulting mesh may be quite inaccurate. This method is arbitrary and doesnt
// and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't
// accurately match the viewer
if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 1.5f) steps *= 2;
if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 3.0f) steps *= 2;
@ -292,7 +292,6 @@ namespace OpenSim.Region.Physics.Meshing
System.Console.WriteLine("Extruder: PathScaleX: " + pathScaleX.ToString() + " pathScaleY: " + pathScaleY.ToString());
#endif
bool done = false;
do // loop through the length of the path and add the layers
{
@ -319,12 +318,16 @@ namespace OpenSim.Region.Physics.Meshing
// apply the taper to the profile before any rotations
if (xProfileScale != 1.0f || yProfileScale != 1.0f)
{
foreach (Vertex v in newLayer.vertices)
{
if (v != null)
{
v.X *= xProfileScale;
v.Y *= yProfileScale;
}
}
}
float radiusScale;
@ -332,8 +335,8 @@ namespace OpenSim.Region.Physics.Meshing
radiusScale = 1.0f - radius * percentOfPath;
else if (radius < 0.001f)
radiusScale = 1.0f + radius * (1.0f - percentOfPath);
else radiusScale = 1.0f;
else
radiusScale = 1.0f;
#if SPAM
System.Console.WriteLine("Extruder: angle: " + angle.ToString() + " percentOfPath: " + percentOfPath.ToString()
@ -379,10 +382,12 @@ namespace OpenSim.Region.Physics.Meshing
}
if (angle == startAngle) // the first layer, invert normals
{
foreach (Triangle t in newLayer.triangles)
{
t.invertNormal();
}
}
result.Append(newLayer);
@ -397,7 +402,9 @@ namespace OpenSim.Region.Physics.Meshing
int iNext = (i + 1);
if (lastLayer.vertices[i] == null) // cant make a simplex here
{
iLastNull = i + 1;
}
else
{
if (i == count - 1) // End of list
@ -413,17 +420,17 @@ namespace OpenSim.Region.Physics.Meshing
}
lastLayer = newLayer;
// calc the angle for the next interation of the loop
if (angle >= endAngle)
{
done = true;
}
else
{
angle = stepSize * ++step;
if (angle > endAngle)
angle = endAngle;
}
} while (!done); // loop until all the layers in the path are completed
// scale the mesh to the desired size

View File

@ -249,12 +249,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
#region Check llRemoteData channels
#endregion
#region Check llListeners
#endregion
/// <summary>

View File

@ -62,7 +62,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
if (!part.ContainsScripts())
return;
}
public void RemoveObjectEvent(uint localID, string eventName, LLUUID id)

View File

@ -69,7 +69,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
private object SenseRepeatListLock = new object();
public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID,
string name, LLUUID keyID, int type, double range, double arc, double sec, SceneObjectPart host)
string name, LLUUID keyID, int type, double range,
double arc, double sec, SceneObjectPart host)
{
Console.WriteLine("SetSensorEvent");
@ -386,6 +387,5 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
idx += 6;
}
}
}
}

View File

@ -284,7 +284,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
enumCompileType l = DefaultCompileLanguage;
if (Script.StartsWith("//c#", true, CultureInfo.InvariantCulture))
l = enumCompileType.cs;
if (Script.StartsWith("//vb", true, CultureInfo.InvariantCulture))
@ -334,7 +333,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// End of insert
switch (l)
{
case enumCompileType.cs:
@ -368,8 +366,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private static string CreateCSCompilerScript(string compileScript)
{
compileScript = String.Empty +
"using OpenSim.Region.ScriptEngine.XEngine.Script; using System.Collections.Generic;\r\n" +
String.Empty + "namespace SecondLife { " +
@ -499,7 +495,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
}
//
// NO ERRORS, BUT NO COMPILED FILE
//

View File

@ -130,7 +130,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
#endif
// Found
ev.Invoke(m_Script, args);
}
}
}

View File

@ -300,7 +300,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return angle;
}
// Old implementation of llRot2Euler, now normalized
public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r)
@ -322,7 +321,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Vector3(0.0, -Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
}
// Xantor's newer llEuler2Rot() *try the second* inverted quaternions (-x,-y,-z,w) as LL seems to like
// New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler.
@ -363,7 +361,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Quaternion(x, y, z, s);
}
public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
{
m_host.AddScriptLPS(1);
@ -388,6 +385,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.AddScriptLPS(1);
return (new LSL_Types.Vector3(0, 0, 1) * r);
}
public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
{
//A and B should both be normalized
@ -401,6 +399,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2));
}
public void llWhisper(int channelID, string text)
{
m_host.AddScriptLPS(1);
@ -437,7 +436,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return;
}
if (text.Length > 1023)
text = text.Substring(0, 1023);
@ -520,7 +518,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (SensedObject == null)
return String.Empty;
return SensedObject.Name;
}
public string llDetectedName(int number)
@ -575,7 +572,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// sensed object is not an avatar
// so get the owner of the sensed object
SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID);
if (SOP != null) { return SOP.ObjectOwner.ToString(); }
if (SOP != null)
{
return SOP.ObjectOwner.ToString();
}
}
else
{
@ -583,9 +583,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return SensedUUID.ToString();
}
return String.Empty;
}
public LSL_Types.LSLInteger llDetectedType(int number)
@ -599,14 +597,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID SensedUUID = uuidDetectedKey(number);
LSL_Types.Vector3 ZeroVector = new LSL_Types.Vector3(0, 0, 0);
if (World.GetScenePresence(SensedUUID) != null) mask |= 0x01; // actor
if (World.GetScenePresence(SensedUUID) != null)
mask |= 0x01; // actor
if (SensedObject.Velocity.Equals(ZeroVector))
mask |= 0x04; // passive non-moving
else
mask |= 0x02; // active moving
if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ...
return mask;
if (SensedObject is IScript)
mask |= 0x08; // Scripted. It COULD have one hidden ...
return mask;
}
public LSL_Types.Vector3 llDetectedPos(int number)
@ -702,8 +704,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.ScriptSetPhysicsStatus(true);
else
m_host.ScriptSetPhysicsStatus(false);
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM)
{
if (value == 1)
@ -711,27 +713,32 @@ namespace OpenSim.Region.ScriptEngine.XEngine
else
m_host.ScriptSetPhantomStatus(false);
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS)
{
m_host.AddFlag(LLObject.ObjectFlags.CastShadows);
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X)
{
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X;
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y)
{
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y;
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z)
{
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z;
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB)
{
NotImplemented("llSetStatus - STATUS_BLOCK_GRAB");
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE)
{
if (value == 1)
@ -739,18 +746,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
else
m_host.SetDieAtEdge(false);
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE)
{
NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE");
}
if ((status & BuiltIn_Commands_BaseClass.STATUS_SANDBOX) == BuiltIn_Commands_BaseClass.STATUS_SANDBOX)
{
NotImplemented("llSetStatus - STATUS_SANDBOX");
}
if (statusrotationaxis != 0)
{
m_host.SetAxisRotation(statusrotationaxis, value);
}
}
@ -766,23 +775,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return 1;
}
return 0;
case BuiltIn_Commands_BaseClass.STATUS_PHANTOM:
if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom)
{
return 1;
}
return 0;
case BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS:
if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows)
{
return 1;
}
return 0;
case BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB:
NotImplemented("llGetStatus - STATUS_BLOCK_GRAB");
return 0;
case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE:
case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE:
if (m_host.GetDieAtEdge())
return 1;
else
@ -791,15 +803,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE:
NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
return 0;
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_X:
NotImplemented("llGetStatus - STATUS_ROTATE_X");
return 0;
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y:
NotImplemented("llGetStatus - STATUS_ROTATE_Y");
return 0;
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z:
NotImplemented("llGetStatus - STATUS_ROTATE_Z");
return 0;
case BuiltIn_Commands_BaseClass.STATUS_SANDBOX:
NotImplemented("llGetStatus - STATUS_SANDBOX");
return 0;
@ -3329,8 +3345,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
result.Add(src.Substring(start,length).Trim());
start += length+1;
length = 0;
} else
}
else
{
length++;
}
break;
default:
length++;
@ -3341,7 +3360,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
result.Add(src.Substring(start,length).Trim());
return result;
}
/// <summary>
@ -5294,7 +5312,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
// not present at all
active[j] = false;
} else
}
else
{
// present and correct
if (offset[j] < offset[best])
@ -5325,12 +5344,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (best < seplen)
{
beginning = offset[best] + ((string)separray[best]).Length;
} else
}
else
{
beginning = offset[best] + ((string)spcarray[best - seplen]).Length;
tokens.Add(spcarray[best - seplen]);
}
}
// This an awkward an not very intuitive boundary case. If the
@ -5562,7 +5581,6 @@ return LLUUID.Zero.ToString();
public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
{
LSL_Types.list pref = null;
m_host.AddScriptLPS(1);
@ -6356,6 +6374,7 @@ return LLUUID.Zero.ToString();
idx++;
continue;
}
if (input[idx]== "}")
{
level--;
@ -6469,6 +6488,5 @@ return LLUUID.Zero.ToString();
m_Notecards.Remove(key);
}
}
}
}

View File

@ -394,7 +394,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
m_DomainScripts[appDomain].Add(itemID);
XScriptInstance instance = new XScriptInstance(this,localID,
part.UUID, itemID, assetID, assembly,
m_AppDomains[appDomain]);
@ -478,8 +477,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
if (File.Exists(m_Assemblies[assetID]))
File.Delete(m_Assemblies[assetID]);
if (File.Exists(m_Assemblies[assetID]+".state"))
File.Delete(m_Assemblies[assetID]+".state");
if (File.Exists(m_Assemblies[assetID]+".mdb"))
File.Delete(m_Assemblies[assetID]+".mdb");
}
@ -1139,7 +1140,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
catch(Exception)
{
return;
}
}
}