From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 204 +++++++++---------- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 24 +-- .../AsyncCommandPlugins/Dataserver.cs | 2 +- .../Common/ScriptEngineBase/EventQueueManager.cs | 8 +- .../ScriptEngineBase/EventQueueThreadClass.cs | 2 +- .../ScriptEngine/Common/ScriptServerInterfaces.cs | 2 +- .../DotNetEngine/Compiler/LSL/Compiler.cs | 2 - .../DotNetEngine/Compiler/LSL/YP2CSConverter.cs | 2 +- .../Compiler/YieldProlog/IndexedAnswers.cs | 2 +- .../Compiler/YieldProlog/PrologException.cs | 28 +-- .../DotNetEngine/Compiler/YieldProlog/YP.cs | 74 +++---- .../ScriptEngine/DotNetEngine/ScriptManager.cs | 12 +- .../ScriptEngine/RemoteServer/EventManager.cs | 4 +- .../Shared/Api/Implementation/LSL_Api.cs | 226 ++++++++++----------- .../Api/Implementation/Plugins/Dataserver.cs | 2 +- .../Api/Implementation/Plugins/XmlRequest.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 2 +- .../Api/Runtime/YieldProlog/IndexedAnswers.cs | 2 +- .../Api/Runtime/YieldProlog/PrologException.cs | 28 +-- .../Shared/Api/Runtime/YieldProlog/YP.cs | 74 +++---- .../Region/ScriptEngine/Shared/AssemblyResolver.cs | 4 +- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 2 - .../Shared/CodeTools/LSL2CSConverter.cs | 6 +- .../Shared/CodeTools/YP2CSConverter.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 22 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 6 +- 26 files changed, 370 insertions(+), 374 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 25c0d9a..9195063 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -361,23 +361,23 @@ namespace OpenSim.Region.ScriptEngine.Common a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. */ - + /* How we arrived at this llEuler2Rot - * + * * Experiment in SL to determine conventions: * llEuler2Rot()=<1,0,0,0> * llEuler2Rot(<0,PI,0>)=<0,1,0,0> * llEuler2Rot(<0,0,PI>)=<0,0,1,0> - * + * * Important facts about Quaternions * - multiplication is non-commutative (a*b != b*a) * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication - * + * * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): * Qx = c1+i*s1 * Qy = c2+j*s2; * Qz = c3+k*s3; - * + * * Rotations applied in order (from above) Z, Y, X * Q = (Qz * Qy) * Qx * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) @@ -389,23 +389,23 @@ namespace OpenSim.Region.ScriptEngine.Common * y=j*(c1*s2*c3-s1*c2*s3) * z=k*(s1*s2*c3+c1*c2*s3) * s= c1*c2*c3-s1*s2*s3 - * + * * This implementation agrees with the functions found here: * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions * And with the results in SL. - * + * * It's also possible to calculate llEuler2Rot by direct multiplication of * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function - * from the wiki). - * Apparently in some cases this is better from a numerical precision perspective? - */ + * from the wiki). + * Apparently in some cases this is better from a numerical precision perspective? + */ public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); double x,y,z,s; - + double c1 = Math.Cos(v.x/2.0); double c2 = Math.Cos(v.y/2.0); double c3 = Math.Cos(v.z/2.0); @@ -417,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Common y = c1*s2*c3-s1*c2*s3; z = s1*s2*c3+c1*c2*s3; s = c1*c2*c3-s1*s2*s3; - + return new LSL_Types.Quaternion(x, y, z, s); } @@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Common double x,y,z,s; int f=0; // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -441,7 +441,7 @@ namespace OpenSim.Region.ScriptEngine.Common s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection + // Set f for signs detection if (fwd.y+left.x >= 0){f+=1;} if (fwd.z+up.x >= 0){f+=2;} if (left.z-up.y >= 0){f+=4;} @@ -510,7 +510,7 @@ namespace OpenSim.Region.ScriptEngine.Common x = 2 * (r.x * r.y - r.z * r.s); y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; z = 2 * (r.x * r.s + r.y * r.z); - return (new LSL_Types.Vector3(x, y, z)); + return (new LSL_Types.Vector3(x, y, z)); } public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) @@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Common z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; return (new LSL_Types.Vector3(x, y, z)); } - + public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) { //A and B should both be normalized @@ -1215,7 +1215,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// Set flexi parameters of a part. - /// + /// /// FIXME: Much of this code should probably be within the part itself. /// /// @@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// /// - private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, + private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Types.Vector3 Force) { if (part == null) @@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.Common { needs_fakedelete = true; } - part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do + part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do // work once the prim is already flexi part.Shape.FlexiSoftness = softness; part.Shape.FlexiGravity = gravity; @@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (needs_fakedelete) { if (part.ParentGroup != null) - { + { part.ParentGroup.FakeDeleteGroup(); } } @@ -1276,7 +1276,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// Set a light point on a part - /// + /// /// FIXME: Much of this code should probably be in SceneObjectGroup /// /// @@ -1781,7 +1781,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.SoundGain = volume; m_host.SoundFlags = 1; // looping m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? - + m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); } @@ -2908,13 +2908,13 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } - + // move the first object found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ScriptEngine.Common llSay(0, String.Format("Could not find object '{0}'", inventory)); throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); } - + // check if destination is an avatar if (World.GetScenePresence(destId) != null) { @@ -2993,7 +2993,7 @@ namespace OpenSim.Region.ScriptEngine.Common { LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( m_localID, m_itemID, item.AssetID.ToString()); - + LLVector3 region = new LLVector3( World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, @@ -4155,13 +4155,13 @@ namespace OpenSim.Region.ScriptEngine.Common if (LLUUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); - + if (presence != null) { return presence.ControllingClient.Name; //return presence.Name; } - + if (World.GetSceneObjectPart(key) != null) { return World.GetSceneObjectPart(key).Name; @@ -4516,7 +4516,7 @@ namespace OpenSim.Region.ScriptEngine.Common private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); - + // TODO find out about the other defaults and add them here ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -4530,7 +4530,7 @@ namespace OpenSim.Region.ScriptEngine.Common ps.PartMaxAge = 10.0f; return ps; } - + public void llParticleSystem(LSL_Types.list rules) { m_host.AddScriptLPS(1); @@ -4725,7 +4725,7 @@ namespace OpenSim.Region.ScriptEngine.Common itemList.Add(itemID); } } - + if (itemList.Count == 0) return; @@ -4973,7 +4973,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetRemoteScriptAccessPin(int pin) { m_host.AddScriptLPS(1); - + m_host.ScriptAccessPin = pin; } @@ -4983,19 +4983,19 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; LLUUID destId = LLUUID.Zero; LLUUID srcId = LLUUID.Zero; - + if (!LLUUID.TryParse(target, out destId)) { llSay(0, "Could not parse key " + target); return; } - + // target must be a different prim than the one containing the script if (m_host.UUID == destId) { return; } - + // copy the first script found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -5010,13 +5010,13 @@ namespace OpenSim.Region.ScriptEngine.Common } } } - + if (!found) { llSay(0, "Could not find script " + name); return; } - + // the rest of the permission checks are done in RezScript, so check the pin there as well World.RezScript(srcId, m_host, destId, pin, running, start_param); // this will cause the delay even if the script pin or permissions were wrong - seems ok @@ -5066,11 +5066,11 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); return Util.Md5Hash(src + ":" + nonce.ToString()); } - + private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - + if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && @@ -5128,23 +5128,23 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); shapeBlock.PathTwist = (sbyte)(200 * twist.y); - + shapeBlock.ObjectLocalID = m_host.LocalId; - + // retain pathcurve - shapeBlock.PathCurve = m_host.Shape.PathCurve; - + shapeBlock.PathCurve = m_host.Shape.PathCurve; + return shapeBlock; } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; - + if (taper_b.x < 0f) { taper_b.x = 0f; @@ -5181,25 +5181,25 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.PathShearX = (byte)(100 * topshear.x); shapeBlock.PathShearY = (byte)(100 * topshear.y); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + // profile/path swapped for a sphere shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + shapeBlock.ProfileCurve += fudge; - + shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 100; - + if (dimple.x < 0f) { dimple.x = 0f; @@ -5222,22 +5222,22 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; // profile/path swapped for a torrus, tube, ring shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + if (holesize.x < 0.05f) { holesize.x = 0.05f; @@ -5342,15 +5342,15 @@ namespace OpenSim.Region.ScriptEngine.Common skew = 0.95f; } shapeBlock.PathSkew = (sbyte)(100 * skew); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); LLUUID sculptId; - + if (!LLUUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); @@ -5360,7 +5360,7 @@ namespace OpenSim.Region.ScriptEngine.Common shapeBlock.ObjectLocalID = m_host.LocalId; shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 150; - + if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && @@ -5369,7 +5369,7 @@ namespace OpenSim.Region.ScriptEngine.Common // default type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; } - + // retain pathcurve shapeBlock.PathCurve = m_host.Shape.PathCurve; @@ -5422,7 +5422,7 @@ namespace OpenSim.Region.ScriptEngine.Common v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); SetScale(part, v); - + break; case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: if (remain < 1) @@ -5432,13 +5432,13 @@ namespace OpenSim.Region.ScriptEngine.Common SetRot(part, q); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: if (remain < 3) return; - + code = Convert.ToInt32(rules.Data[idx++]); - + remain = rules.Length - idx; float hollow; LSL_Types.Vector3 twist; @@ -5449,9 +5449,9 @@ namespace OpenSim.Region.ScriptEngine.Common float skew; LSL_Types.Vector3 holesize; LSL_Types.Vector3 profilecut; - + switch (code) - { + { case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: if (remain < 6) return; @@ -5465,7 +5465,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: if (remain < 6) return; @@ -5480,12 +5480,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: if (remain < 6) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5507,12 +5507,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5526,12 +5526,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5545,12 +5545,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5564,7 +5564,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: if (remain < 2) return; @@ -5575,7 +5575,7 @@ namespace OpenSim.Region.ScriptEngine.Common SetPrimitiveShapeParams(map, face); break; } - + break; case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: @@ -5630,7 +5630,7 @@ namespace OpenSim.Region.ScriptEngine.Common float intensity = (float)Convert.ToDouble(rules.Data[idx++]); float radius = (float)Convert.ToDouble(rules.Data[idx++]); float falloff = (float)Convert.ToDouble(rules.Data[idx++]); - + SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); break; @@ -5701,7 +5701,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - + LSL_Types.list l = new LSL_Types.list(); ScenePresence av = World.GetScenePresence(id); if (av == null) @@ -6560,7 +6560,7 @@ namespace OpenSim.Region.ScriptEngine.Common IConfigSource config = new IniConfigSource(Application.iniFilePath); if (config.Configs["LL-Functions"] == null) config.AddConfig("LL-Functions"); - + if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) { if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) @@ -6829,7 +6829,7 @@ namespace OpenSim.Region.ScriptEngine.Common //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) m_host.AddScriptLPS(1); for (int i = 0; i < commandList.Data.Length; i++) - { + { switch ((ParcelMediaCommandEnum)commandList.Data[i]) { case ParcelMediaCommandEnum.Play: @@ -6839,7 +6839,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (!agent.IsChildAgent) { agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); - } + } } break; case ParcelMediaCommandEnum.Stop: @@ -6870,7 +6870,7 @@ namespace OpenSim.Region.ScriptEngine.Common { //Set the new media URL only if the user is the owner of the land osSetParcelMediaURL(commandList.Data[i + 1].ToString()); - + List scenePresenceList = World.GetScenePresences(); LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); //Send an update of the mediaURL to all the clients that are in the parcel @@ -6881,8 +6881,8 @@ namespace OpenSim.Region.ScriptEngine.Common //Send parcel media update to the client agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); } - } - + } + } i++; } @@ -6892,7 +6892,7 @@ namespace OpenSim.Region.ScriptEngine.Common NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); break; }//end switch - + } @@ -6935,7 +6935,7 @@ namespace OpenSim.Region.ScriptEngine.Common } } return list; - + } public LSL_Types.LSLInteger llModPow(int a, int b, int c) @@ -6979,7 +6979,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -6989,7 +6989,7 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSL_Types.Vector3(); } ScenePresence presence = World.GetScenePresence(m_host.OwnerID); - if (presence != null) + if (presence != null) { LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); return pos; @@ -7111,8 +7111,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetCameraParams(LSL_Types.list rules) { m_host.AddScriptLPS(1); - - // our key in the object we are in + + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7126,10 +7126,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + SortedDictionary parameters = new SortedDictionary(); object[] data = rules.Data; for (int i = 0; i < data.Length; ++i) { @@ -7142,8 +7142,8 @@ namespace OpenSim.Region.ScriptEngine.Common case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: case BuiltIn_Commands_BaseClass.CAMERA_POSITION: LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; - parameters.Add(type + 1, (float)v.x); - parameters.Add(type + 2, (float)v.y); + parameters.Add(type + 1, (float)v.x); + parameters.Add(type + 2, (float)v.y); parameters.Add(type + 3, (float)v.z); break; default: @@ -7163,7 +7163,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - // our key in the object we are in + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7177,10 +7177,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + presence.ControllingClient.SendClearFollowCamProperties(objectID); } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e98dec6..3b317ac 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -703,7 +703,7 @@ namespace OpenSim.Region.ScriptEngine.Common // Otherwise, if we have strings, compare them alphabetically. string str1 = new string(space1); string str2 = new string(space2); - + int result; if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) @@ -1427,22 +1427,22 @@ namespace OpenSim.Region.ScriptEngine.Common bool ret = i1.value != i2.value; return ret; } - + static public LSLInteger operator +(LSLInteger i1, int i2) { return new LSLInteger(i1.value + i2); } - + static public LSLInteger operator -(LSLInteger i1, int i2) { return new LSLInteger(i1.value - i2); } - + static public LSLInteger operator *(LSLInteger i1, int i2) { return new LSLInteger(i1.value * i2); } - + static public LSLInteger operator /(LSLInteger i1, int i2) { return new LSLInteger(i1.value / i2); @@ -1452,22 +1452,22 @@ namespace OpenSim.Region.ScriptEngine.Common { return new LSLFloat((double)i1.value + f); } - + static public LSLFloat operator -(LSLInteger i1, double f) { return new LSLFloat((double)i1.value - f); } - + static public LSLFloat operator *(LSLInteger i1, double f) { return new LSLFloat((double)i1.value * f); } - + static public LSLFloat operator /(LSLInteger i1, double f) { return new LSLFloat((double)i1.value / f); } - + static public LSLInteger operator -(LSLInteger i) { return new LSLInteger(-i.value); @@ -1623,17 +1623,17 @@ namespace OpenSim.Region.ScriptEngine.Common f.value--; return f; } - + static public LSLFloat operator +(LSLFloat f, int i) { return new LSLFloat(f.value + (double)i); } - + static public LSLFloat operator -(LSLFloat f, int i) { return new LSLFloat(f.value - (double)i); } - + static public LSLFloat operator *(LSLFloat f, int i) { return new LSLFloat(f.value * (double)i); diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs index 5f86c9c..77cc7ea 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin { if (!DataserverRequests.ContainsKey(identifier)) return; - + ds=DataserverRequests[identifier]; DataserverRequests.Remove(identifier); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 79c1dde..5c57874 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// Queue containing events waiting to be executed /// public Queue eventQueue = new Queue(); - + #region " Queue structures " /// /// Queue item structure @@ -193,7 +193,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } #endregion - + #region " Shutdown all threads " ~EventQueueManager() { @@ -408,10 +408,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase // Set flag if script should be removed or not EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; - + // Abort this thread AbortThreadClass(EventQueueThread); - + // We do not need to start another, MaintenenceThread will do that for us //StartNewThreadClass(); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 255ab99..4376e00 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public class EventQueueThreadClass : iScriptEngineFunctionModule { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// How many ms to sleep if queue is empty /// diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index f04ac01..9a465f6 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs @@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common void remote_data(uint localID, LLUUID itemID); void http_response(uint localID, LLUUID itemID); } - + public interface ServerRemotingObject { RemoteEvents Events(); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 06c7387..fa3e35b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs @@ -355,8 +355,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL private static string CreateYPCompilerScript(string compileScript) { - - compileScript = String.Empty + "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs index 3f7b95e..8618d6c 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL myCode = myCode.Substring(0, cs_pointer); } myCode.Replace("//yp", "%YPCode"); - + StringWriter myCS_SW = new StringWriter(); StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs index 999208d..415c646 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { _arity = arity; } - + /// /// Append the answer to the list and update the indexes, if any. /// Elements of answer must be ground, since arguments with unbound variables make this diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs index 9a1f00d..56ed719 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. /// /// the error term of the error - /// the message term of the error. If this is a string, it is converted to an + /// the message term of the error. If this is a string, it is converted to an /// Atom so it can be used by Prolog code. /// Message, converted to a string, is use as the printable exception message. /// @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); } - public class TypeErrorInfo + public class TypeErrorInfo { public readonly Atom _Type; public readonly object _Culprit; @@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public object getProcedureName() { - if (!(_Type._name == "procedure" && + if (!(_Type._name == "procedure" && _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) return null; return ((Functor2)_Culprit)._arg1; } /// - /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. + /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. /// Otherwise return -1. /// /// diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index b69f9c4..694e733 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// /// Convert term to an int. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { throw new PrologException (new Functor2 - ("type_error", Atom.a("evaluable"), - new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), + ("type_error", Atom.a("evaluable"), + new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), "Term must be an integer"); } } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// /// Convert term to a double. This may convert an int to a double, etc. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog // Assume it is a char type like "a". term = YP.getValue(((Functor2)term)._arg1); if (term is Variable) - throw new PrologException(Atom.a("instantiation_error"), + throw new PrologException(Atom.a("instantiation_error"), "Expected a number but the argument is an unbound variable"); try @@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog if (term1TypeCode == -2) { // Variable. - // We always check for equality first because we want to be sure - // that less than returns false if the terms are equal, in + // We always check for equality first because we want to be sure + // that less than returns false if the terms are equal, in // case that the less than check really behaves like less than or equal. if ((Variable)Term1 != (Variable)Term2) // The hash code should be unique to a Variable object. @@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// Type code is -2 if term is a Variable, 0 if it is an Atom, - /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, + /// Type code is -2 if term is a Variable, 0 if it is an Atom, + /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 4 if it is Functor. /// Otherwise, type code is -1. /// This does not call YP.getValue(term). @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog "Arg 2 List has an element which is an unbound variable"); if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) throw new PrologException - (new Functor2("type_error", Atom.a("character"), listAtom), + (new Functor2("type_error", Atom.a("character"), listAtom), "Arg 2 List has an element which is not a one character atom"); charArray[i] = ((Atom)listAtom)._name[0]; } @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog int codeInt; if (!getInt(codeArray[i], out codeInt) || codeInt < 0) throw new PrologException - (new Functor1("representation_error", Atom.a("character_code")), + (new Functor1("representation_error", Atom.a("character_code")), "Element of Arg 2 List is not a character code"); charArray[i] = (char)codeInt; } @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { if (!YP.number(Number)) throw new PrologException - (new Functor2("type_error", Atom.a("number"), Number), + (new Functor2("type_error", Atom.a("number"), Number), "Arg 1 Number is not var or number"); // We just checked, so convertDouble shouldn't throw an exception. numberString = YP.doubleToString(YP.convertDouble(Number)); @@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) throw new PrologException - (new Functor2("type_error", Atom.a("character"), Char), + (new Functor2("type_error", Atom.a("character"), Char), "Arg 1 Char is not var or one-character atom"); if (Code is Variable) @@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { List clauses; if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) - return unknownPredicate(name, arguments.Length, + return unknownPredicate(name, arguments.Length, "Undefined dynamic predicate: " + name + "/" + arguments.Length); if (clauses.Count == 1) @@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// If _prologFlags["unknown"] is fail then return fail(), else if + /// If _prologFlags["unknown"] is fail then return fail(), else if /// _prologFlags["unknown"] is warning then write the message to YP.write and /// return fail(), else throw a PrologException for existence_error. . /// @@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// This is deprecated and just calls matchDynamic. This matches all clauses, + /// This is deprecated and just calls matchDynamic. This matches all clauses, /// not just the ones defined with assertFact. /// /// @@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// dynamic predicate. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable current_predicate(object NameSlashArity, Type declaringClass) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog Functor2 NameArityFunctor = NameSlashArity as Functor2; if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) throw new PrologException - (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), + (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), "Must be a name/arity predicate indicator"); object name = YP.getValue(NameArityFunctor._arg1); object arity = YP.getValue(NameArityFunctor._arg2); @@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from + /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. - /// Otherwise, compile the goal as a single clause predicate and invoke it. + /// Otherwise, compile the goal as a single clause predicate and invoke it. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable getIterator(object Goal, Type declaringClass) @@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); if (!_prologFlags.ContainsKey(((Atom)Key)._name)) throw new PrologException - (new Functor2("domain_error", Atom.a("prolog_flag"), Key), + (new Functor2("domain_error", Atom.a("prolog_flag"), Key), "Arg 1 Key is not a recognized flag"); foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) @@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; @@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog #pragma warning restore 0168 } } - + /// /// CodeListReader extends TextReader and overrides Read to read the next code from /// the CodeList which is a Prolog list of integer character codes. @@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public override int Read() { - Functor2 CodeListPair = _CodeList as Functor2; + Functor2 CodeListPair = _CodeList as Functor2; int code; if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && getInt(CodeListPair._arg1, out code))) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 42d9bf8..c94b56a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -39,13 +39,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public class ScriptManager : Common.ScriptEngineBase.ScriptManager { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) : base(scriptEngine) { base.m_scriptEngine = scriptEngine; } - private Compiler.LSL.Compiler LSLCompiler; + private Compiler.LSL.Compiler LSLCompiler; public override void Initialize() { @@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) { m_log.DebugFormat( - "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", + "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", m_scriptEngine.ScriptEngineName, localID, itemID); //IScriptHost root = host.GetRoot(); @@ -73,13 +73,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine string CompiledScriptFile = String.Empty; SceneObjectPart m_host = World.GetSceneObjectPart(localID); - + if (null == m_host) { m_log.ErrorFormat( - "[{0}]: Could not find scene object part corresponding to localID {1} to start script", + "[{0}]: Could not find scene object part corresponding to localID {1} to start script", m_scriptEngine.ScriptEngineName, localID); - + return; } diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 6924dd2..21888fa 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs @@ -53,12 +53,12 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer public EventManager(ScriptEngine _ScriptEngine) { myScriptEngine = _ScriptEngine; - + m_TCPClient = new TCPClient(); RPC = new TRPC_Remote(m_TCPClient); RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); - + myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; myScriptEngine.World.EventManager.OnRezScript += OnRezScript; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9604828..4de207a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. */ - + /* How we arrived at this llEuler2Rot - * + * * Experiment in SL to determine conventions: * llEuler2Rot()=<1,0,0,0> * llEuler2Rot(<0,PI,0>)=<0,1,0,0> * llEuler2Rot(<0,0,PI>)=<0,0,1,0> - * + * * Important facts about Quaternions * - multiplication is non-commutative (a*b != b*a) * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication - * + * * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): * Qx = c1+i*s1 * Qy = c2+j*s2; * Qz = c3+k*s3; - * + * * Rotations applied in order (from above) Z, Y, X * Q = (Qz * Qy) * Qx * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) @@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api * y=j*(c1*s2*c3-s1*c2*s3) * z=k*(s1*s2*c3+c1*c2*s3) * s= c1*c2*c3-s1*s2*s3 - * + * * This implementation agrees with the functions found here: * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions * And with the results in SL. - * + * * It's also possible to calculate llEuler2Rot by direct multiplication of * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function - * from the wiki). - * Apparently in some cases this is better from a numerical precision perspective? - */ + * from the wiki). + * Apparently in some cases this is better from a numerical precision perspective? + */ public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); double x,y,z,s; - + double c1 = Math.Cos(v.x/2.0); double c2 = Math.Cos(v.y/2.0); double c3 = Math.Cos(v.z/2.0); @@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api y = c1*s2*c3-s1*c2*s3; z = s1*s2*c3+c1*c2*s3; s = c1*c2*c3-s1*s2*s3; - + return new LSL_Types.Quaternion(x, y, z, s); } @@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api double x, y, z, s; int f = 0; // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection + // Set f for signs detection if (fwd.y + left.x >= 0) { f += 1; } if (fwd.z + up.x >= 0) { f += 2; } if (left.z - up.y >= 0) { f += 4; } @@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - - public void SetGlow(SceneObjectPart part, int face, float glow) - { + + public void SetGlow(SceneObjectPart part, int face, float glow) + { LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) { @@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tex.FaceTextures[face].Glow = glow; part.UpdateTexture(tex); return; - } + } else if (face == -1) { for (uint i = 0; i < 32; i++) @@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - + public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) { - + Shininess sval = new Shininess(); - + switch (shiny) { - case 0: + case 0: sval = Shininess.None; break; case 1: @@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api sval = Shininess.None; break; } - + LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) { @@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tex.FaceTextures[face].Shiny = sval; tex.FaceTextures[face].Bump = bump; part.UpdateTexture(tex); - return; - } + return; + } else if (face == -1) { for (uint i = 0; i < 32; i++) @@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - - public void SetFullBright(SceneObjectPart part, int face, bool bright) + + public void SetFullBright(SceneObjectPart part, int face, bool bright) { LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) @@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (tex.FaceTextures[i] != null) { tex.FaceTextures[i].Fullbright = bright; - } + } } tex.DefaultTexture.Fullbright = bright; part.UpdateTexture(tex); return; } } - + public double llGetAlpha(int face) { m_host.AddScriptLPS(1); @@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Set flexi parameters of a part. - /// + /// /// FIXME: Much of this code should probably be within the part itself. /// /// @@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - /// + /// private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Types.Vector3 Force) { @@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Set a light point on a part - /// + /// /// FIXME: Much of this code should probably be in SceneObjectGroup /// /// @@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - /// + /// private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) { if (part == null) @@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool found = false; LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } - + // move the first object found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); - + // TODO find out about the other defaults and add them here ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ps.PartMaxAge = 10.0f; return ps; } - + public void llParticleSystem(LSL_Types.list rules) { m_host.AddScriptLPS(1); @@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api itemList.Add(itemID); } } - + if (itemList.Count == 0) return; @@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); return Util.Md5Hash(src + ":" + nonce.ToString()); } - + private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - + if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && @@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); shapeBlock.PathTwist = (sbyte)(200 * twist.y); - + shapeBlock.ObjectLocalID = m_host.LocalId; - + // retain pathcurve - shapeBlock.PathCurve = m_host.Shape.PathCurve; - + shapeBlock.PathCurve = m_host.Shape.PathCurve; + return shapeBlock; } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; - + if (taper_b.x < 0f) { taper_b.x = 0f; @@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.PathShearX = (byte)(100 * topshear.x); shapeBlock.PathShearY = (byte)(100 * topshear.y); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + // profile/path swapped for a sphere shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + shapeBlock.ProfileCurve += fudge; - + shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 100; - + if (dimple.x < 0f) { dimple.x = 0f; @@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; // profile/path swapped for a torrus, tube, ring shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + if (holesize.x < 0.05f) { holesize.x = 0.05f; @@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api skew = 0.95f; } shapeBlock.PathSkew = (sbyte)(100 * skew); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); LLUUID sculptId; - + if (!LLUUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); @@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api shapeBlock.ObjectLocalID = m_host.LocalId; shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 150; - + if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && @@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // default type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; } - + // retain pathcurve shapeBlock.PathCurve = m_host.Shape.PathCurve; @@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) { m_host.AddScriptLPS(1); - + if (m_host.ParentGroup == null) return; @@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetRot(part, q); break; - + case (int)ScriptBaseClass.PRIM_TYPE: if (remain < 3) return; - + code = Convert.ToInt32(rules.Data[idx++]); - + remain = rules.Length - idx; float hollow; LSL_Types.Vector3 twist; @@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api float skew; LSL_Types.Vector3 holesize; LSL_Types.Vector3 profilecut; - + switch (code) - { + { case (int)ScriptBaseClass.PRIM_TYPE_BOX: if (remain < 6) return; @@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); break; - + case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: if (remain < 6) return; @@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); break; - + case (int)ScriptBaseClass.PRIM_TYPE_PRISM: if (remain < 6) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); break; - + case (int)ScriptBaseClass.PRIM_TYPE_TORUS: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; - + case (int)ScriptBaseClass.PRIM_TYPE_TUBE: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; - + case (int)ScriptBaseClass.PRIM_TYPE_RING: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; - + case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: if (remain < 2) return; @@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetPrimitiveShapeParams(map, face); break; } - + break; case (int)ScriptBaseClass.PRIM_TEXTURE: @@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; face = Convert.ToInt32(rules.Data[idx++]); float glow = (float)Convert.ToDouble(rules.Data[idx++]); - + SetGlow(part, face, glow); - + break; case (int)ScriptBaseClass.PRIM_BUMP_SHINY: if (remain < 3) - return; + return; face = Convert.ToInt32(rules.Data[idx++]); int shiny = Convert.ToInt32(rules.Data[idx++]); Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); - + SetShiny(part, face, shiny, bump); - + break; case (int)ScriptBaseClass.PRIM_FULLBRIGHT: if (remain < 2) return; - face = Convert.ToInt32(rules.Data[idx++]); + face = Convert.ToInt32(rules.Data[idx++]); string bv = rules.Data[idx++].ToString(); bool st; if (bv.Equals("1")) st = true; else st = false; - + SetFullBright(part, face , st); break; case (int)ScriptBaseClass.PRIM_MATERIAL: @@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_PHANTOM: if (remain < 1) return; - + string ph = rules.Data[idx++].ToString(); bool phantom; - + if (ph.Equals("1")) phantom = true; else phantom = false; - + part.ScriptSetPhantomStatus(phantom); part.ScheduleFullUpdate(); break; case (int)ScriptBaseClass.PRIM_PHYSICS: if (remain < 1) - return; + return; string phy = rules.Data[idx++].ToString(); bool physics; - + if (phy.Equals("1")) physics = true; else physics = false; - + m_host.ScriptSetPhysicsStatus(physics); part.ScheduleFullUpdate(); break; @@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - + LSL_Types.list l = new LSL_Types.list(); ScenePresence av = World.GetScenePresence(id); if (av == null) @@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) m_host.AddScriptLPS(1); for (int i = 0; i < commandList.Data.Length; i++) - { + { switch ((ParcelMediaCommandEnum)commandList.Data[i]) { case ParcelMediaCommandEnum.Play: @@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!agent.IsChildAgent) { agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); - } + } } break; case ParcelMediaCommandEnum.Stop: @@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { //Set the new media URL only if the user is the owner of the land osSetParcelMediaURL(commandList.Data[i + 1].ToString()); - + List scenePresenceList = World.GetScenePresences(); LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); //Send an update of the mediaURL to all the clients that are in the parcel @@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //Send parcel media update to the client agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); } - } - + } + } i++; } @@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); break; }//end switch - + } @@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } return list; - + } public LSL_Types.LSLInteger llModPow(int a, int b, int c) @@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetCameraParams(LSL_Types.list rules) { m_host.AddScriptLPS(1); - - // our key in the object we are in + + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + SortedDictionary parameters = new SortedDictionary(); object[] data = rules.Data; for (int i = 0; i < data.Length; ++i) { @@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.CAMERA_FOCUS_OFFSET: case ScriptBaseClass.CAMERA_POSITION: LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; - parameters.Add(type + 1, (float)v.x); - parameters.Add(type + 2, (float)v.y); + parameters.Add(type + 1, (float)v.x); + parameters.Add(type + 2, (float)v.y); parameters.Add(type + 3, (float)v.z); break; default: @@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - // our key in the object we are in + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + presence.ControllingClient.SendClearFollowCamProperties(objectID); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 6c88ae86..52d277e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs @@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins { if (!DataserverRequests.ContainsKey(identifier)) return; - + ds=DataserverRequests[identifier]; DataserverRequests.Remove(identifier); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 89bf51c..3f3cf39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins new LSL_Types.LSLInteger(rInfo.GetIntValue()), new LSL_Types.LSLString(rInfo.GetStrVal()) }; - + foreach (AsyncCommandManager m in m_CmdManager.Managers) { if (m.m_ScriptEngine.PostScriptEvent( diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 5b32cde..c28aa9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return; MethodInfo mi = inits[api]; - + Object[] args = new Object[1]; args[0] = data; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs index 681b2f2..d6a339b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { _arity = arity; } - + /// /// Append the answer to the list and update the indexes, if any. /// Elements of answer must be ground, since arguments with unbound variables make this diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs index a2fe7ec..9f5ae3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. /// /// the error term of the error - /// the message term of the error. If this is a string, it is converted to an + /// the message term of the error. If this is a string, it is converted to an /// Atom so it can be used by Prolog code. /// Message, converted to a string, is use as the printable exception message. /// @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); } - public class TypeErrorInfo + public class TypeErrorInfo { public readonly Atom _Type; public readonly object _Culprit; @@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public object getProcedureName() { - if (!(_Type._name == "procedure" && + if (!(_Type._name == "procedure" && _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) return null; return ((Functor2)_Culprit)._arg1; } /// - /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. + /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. /// Otherwise return -1. /// /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 97c9087..2e90d74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs @@ -1,20 +1,20 @@ /* * Copyright (C) 2007-2008, Jeff Thompson - * + * * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without + * + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software + * * Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// /// Convert term to an int. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { throw new PrologException (new Functor2 - ("type_error", Atom.a("evaluable"), - new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), + ("type_error", Atom.a("evaluable"), + new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), "Term must be an integer"); } } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// /// Convert term to a double. This may convert an int to a double, etc. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog // Assume it is a char type like "a". term = YP.getValue(((Functor2)term)._arg1); if (term is Variable) - throw new PrologException(Atom.a("instantiation_error"), + throw new PrologException(Atom.a("instantiation_error"), "Expected a number but the argument is an unbound variable"); try @@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (term1TypeCode == -2) { // Variable. - // We always check for equality first because we want to be sure - // that less than returns false if the terms are equal, in + // We always check for equality first because we want to be sure + // that less than returns false if the terms are equal, in // case that the less than check really behaves like less than or equal. if ((Variable)Term1 != (Variable)Term2) // The hash code should be unique to a Variable object. @@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// Type code is -2 if term is a Variable, 0 if it is an Atom, - /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, + /// Type code is -2 if term is a Variable, 0 if it is an Atom, + /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 4 if it is Functor. /// Otherwise, type code is -1. /// This does not call YP.getValue(term). @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog "Arg 2 List has an element which is an unbound variable"); if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) throw new PrologException - (new Functor2("type_error", Atom.a("character"), listAtom), + (new Functor2("type_error", Atom.a("character"), listAtom), "Arg 2 List has an element which is not a one character atom"); charArray[i] = ((Atom)listAtom)._name[0]; } @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog int codeInt; if (!getInt(codeArray[i], out codeInt) || codeInt < 0) throw new PrologException - (new Functor1("representation_error", Atom.a("character_code")), + (new Functor1("representation_error", Atom.a("character_code")), "Element of Arg 2 List is not a character code"); charArray[i] = (char)codeInt; } @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { if (!YP.number(Number)) throw new PrologException - (new Functor2("type_error", Atom.a("number"), Number), + (new Functor2("type_error", Atom.a("number"), Number), "Arg 1 Number is not var or number"); // We just checked, so convertDouble shouldn't throw an exception. numberString = YP.doubleToString(YP.convertDouble(Number)); @@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) throw new PrologException - (new Functor2("type_error", Atom.a("character"), Char), + (new Functor2("type_error", Atom.a("character"), Char), "Arg 1 Char is not var or one-character atom"); if (Code is Variable) @@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { List clauses; if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) - return unknownPredicate(name, arguments.Length, + return unknownPredicate(name, arguments.Length, "Undefined dynamic predicate: " + name + "/" + arguments.Length); if (clauses.Count == 1) @@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// If _prologFlags["unknown"] is fail then return fail(), else if + /// If _prologFlags["unknown"] is fail then return fail(), else if /// _prologFlags["unknown"] is warning then write the message to YP.write and /// return fail(), else throw a PrologException for existence_error. . /// @@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// This is deprecated and just calls matchDynamic. This matches all clauses, + /// This is deprecated and just calls matchDynamic. This matches all clauses, /// not just the ones defined with assertFact. /// /// @@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// dynamic predicate. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable current_predicate(object NameSlashArity, Type declaringClass) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Functor2 NameArityFunctor = NameSlashArity as Functor2; if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) throw new PrologException - (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), + (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), "Must be a name/arity predicate indicator"); object name = YP.getValue(NameArityFunctor._arg1); object arity = YP.getValue(NameArityFunctor._arg2); @@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from + /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. - /// Otherwise, compile the goal as a single clause predicate and invoke it. + /// Otherwise, compile the goal as a single clause predicate and invoke it. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable getIterator(object Goal, Type declaringClass) @@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); if (!_prologFlags.ContainsKey(((Atom)Key)._name)) throw new PrologException - (new Functor2("domain_error", Atom.a("prolog_flag"), Key), + (new Functor2("domain_error", Atom.a("prolog_flag"), Key), "Arg 1 Key is not a recognized flag"); foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) @@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; @@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog #pragma warning restore 0168 } } - + /// /// CodeListReader extends TextReader and overrides Read to read the next code from /// the CodeList which is a Prolog list of integer character codes. @@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public override int Read() { - Functor2 CodeListPair = _CodeList as Functor2; + Functor2 CodeListPair = _CodeList as Functor2; int code; if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && getInt(CodeListPair._arg1, out code))) diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index f9b160d..0f79019 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs @@ -54,11 +54,11 @@ namespace OpenSim.Region.ScriptEngine.Shared { string path = Path.Combine(Directory.GetCurrentDirectory(), Path.Combine(s, assemblyName))+".dll"; - + if (File.Exists(path)) return Assembly.LoadFrom(path); } - + return null; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 4962023..db90f3e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -412,8 +412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools private static string CreateYPCompilerScript(string compileScript) { - - compileScript = String.Empty + "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 57e8776..45f92e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs @@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools string quote = String.Empty; bool last_was_escape = false; int quote_replaced_count = 0; - + string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); - + string removecomments = conelinecomments.Replace(removefwnoncomments, ""); removecomments = cstylecomments.Replace(removecomments, ""); string[] localscript = removecomments.Split('"'); @@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // checks for alpha.alpha way of referring to objects in C# // ignores alpha.x alpha.y, alpha.z for refering to vector components Match SecurityM; - + // BROKEN: this check is very wrong. It block's any url in strings. SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 831b918..22b3742 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools myCode = myCode.Substring(0, cs_pointer); } myCode.Replace("//yp", "%YPCode"); - + StringWriter myCS_SW = new StringWriter(); StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8326e16..5497e2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1335,22 +1335,22 @@ namespace OpenSim.Region.ScriptEngine.Shared bool ret = i1.value != i2.value; return ret; } - + static public LSLInteger operator +(LSLInteger i1, int i2) { return new LSLInteger(i1.value + i2); } - + static public LSLInteger operator -(LSLInteger i1, int i2) { return new LSLInteger(i1.value - i2); } - + static public LSLInteger operator *(LSLInteger i1, int i2) { return new LSLInteger(i1.value * i2); } - + static public LSLInteger operator /(LSLInteger i1, int i2) { return new LSLInteger(i1.value / i2); @@ -1360,22 +1360,22 @@ namespace OpenSim.Region.ScriptEngine.Shared { return new LSLFloat((double)i1.value + f); } - + static public LSLFloat operator -(LSLInteger i1, double f) { return new LSLFloat((double)i1.value - f); } - + static public LSLFloat operator *(LSLInteger i1, double f) { return new LSLFloat((double)i1.value * f); } - + static public LSLFloat operator /(LSLInteger i1, double f) { return new LSLFloat((double)i1.value / f); } - + static public LSLInteger operator -(LSLInteger i) { return new LSLInteger(-i.value); @@ -1536,17 +1536,17 @@ namespace OpenSim.Region.ScriptEngine.Shared f.value--; return f; } - + static public LSLFloat operator +(LSLFloat f, int i) { return new LSLFloat(f.value + (double)i); } - + static public LSLFloat operator -(LSLFloat f, int i) { return new LSLFloat(f.value - (double)i); } - + static public LSLFloat operator *(LSLFloat f, int i) { return new LSLFloat(f.value * (double)i); diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index cdba1ac..c528c02 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -363,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new WorkItemCallback( this.DoOnRezScriptQueue), new Object[0]); } - else + else { m_CurrentCompile = null; } @@ -394,7 +394,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new WorkItemCallback( this.DoOnRezScriptQueue), new Object[0]); } - else + else { m_CurrentCompile = null; } @@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), m_ItemID.ToString() + ".state"); - + try { File.Delete(savedState); -- cgit v1.1