From b4141f9e56a85a6df871a60921761a4848e297d1 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sat, 13 Sep 2008 22:07:07 +0000 Subject: Formatting cleanup. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 2 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 25 ++- OpenSim/Region/Physics/Meshing/PrimMesher.cs | 4 +- .../ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 230 ++++++++++----------- 4 files changed, 134 insertions(+), 127 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ee18a94..aa859db 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4793,7 +4793,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack; handlerObjectClickAction = OnObjectClickAction; - if(handlerObjectClickAction != null) + if (handlerObjectClickAction != null) { foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index b4b9f00..510f2fa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -500,16 +500,17 @@ namespace OpenSim.Region.Environment.Scenes } // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too - if(m_sitTargetAvatar != UUID.Zero) { + if (m_sitTargetAvatar != UUID.Zero) + { if (m_parentGroup != null) // TODO can there be a SOP without a SOG? { ScenePresence avatar; - if(m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar)) { + if (m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar)) + { avatar.ParentPosition = GetWorldPosition(); } } } - } } @@ -3304,27 +3305,33 @@ namespace OpenSim.Region.Environment.Scenes } } - public void SetCameraAtOffset(Vector3 v) { + public void SetCameraAtOffset(Vector3 v) + { m_cameraAtOffset = v; } - public void SetCameraEyeOffset(Vector3 v) { + public void SetCameraEyeOffset(Vector3 v) + { m_cameraEyeOffset = v; } - public void SetForceMouselook(bool force) { + public void SetForceMouselook(bool force) + { m_forceMouselook = force; } - public Vector3 GetCameraAtOffset() { + public Vector3 GetCameraAtOffset() + { return m_cameraAtOffset; } - public Vector3 GetCameraEyeOffset() { + public Vector3 GetCameraEyeOffset() + { return m_cameraEyeOffset; } - public bool GetForceMouselook() { + public bool GetForceMouselook() + { return m_forceMouselook; } diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 0e6cbad..390f3b4 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -976,8 +976,8 @@ angles24 = [ while (!done) // loop through the length of the path and add the layers { bool isEndLayer = false; - if (angle == startAngle || angle >= endAngle) - isEndLayer = true; + if (angle == startAngle || angle >= endAngle) + isEndLayer = true; Profile newLayer = profile.Clone(isEndLayer && needEndFaces); diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index efe40a3..c6ded79 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs @@ -603,64 +603,64 @@ namespace OpenSim.Region.ScriptEngine.Common { // Console.WriteLine(""+JSON[i]); - switch(JSON[i]) + switch (JSON[i]) { case '{': - // create hashtable and add it to the stack or array if we are populating one, we can have a lot of nested objects in JSON - - Hashtable currentObject = new Hashtable(); - if(objectStack.Count==0) // the stack should only be empty for the first outer object - { - - objectStack.Push(jsondata); - } - else if(objectStack.Peek().ToString()=="System.Collections.ArrayList") - { - // add it to the parent array - ((ArrayList)objectStack.Peek()).Add(currentObject); - objectStack.Push(currentObject); - } - else - { - // add it to the parent hashtable - ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject); - objectStack.Push(currentObject); - } - - // clear the key - currentKey=null; + // create hashtable and add it to the stack or array if we are populating one, we can have a lot of nested objects in JSON + + Hashtable currentObject = new Hashtable(); + if (objectStack.Count==0) // the stack should only be empty for the first outer object + { + + objectStack.Push(jsondata); + } + else if (objectStack.Peek().ToString()=="System.Collections.ArrayList") + { + // add it to the parent array + ((ArrayList)objectStack.Peek()).Add(currentObject); + objectStack.Push(currentObject); + } + else + { + // add it to the parent hashtable + ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject); + objectStack.Push(currentObject); + } + + // clear the key + currentKey=null; break; case '}': - // pop the hashtable off the stack - objectStack.Pop(); + // pop the hashtable off the stack + objectStack.Pop(); break; case '"':// string boundary - - string tokenValue=""; - i++; // move to next char - - // just loop through until the next quote mark storing the string - while(JSON[i]!='"') - { - tokenValue+=JSON[i++]; - } - - // ok we've got a string, if we've got an array on the top of the stack then we store it - if(objectStack.Peek().ToString()=="System.Collections.ArrayList") - { - ((ArrayList)objectStack.Peek()).Add(tokenValue); - } - else if(currentKey==null) // no key stored and its not an array this must be a key so store it - { - currentKey = tokenValue; - } - else - { - // we have a key so lets store this value - ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue); - // now lets clear the key, we're done with it and moving on - currentKey=null; - } + + string tokenValue=""; + i++; // move to next char + + // just loop through until the next quote mark storing the string + while (JSON[i]!='"') + { + tokenValue+=JSON[i++]; + } + + // ok we've got a string, if we've got an array on the top of the stack then we store it + if (objectStack.Peek().ToString()=="System.Collections.ArrayList") + { + ((ArrayList)objectStack.Peek()).Add(tokenValue); + } + else if (currentKey==null) // no key stored and its not an array this must be a key so store it + { + currentKey = tokenValue; + } + else + { + // we have a key so lets store this value + ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue); + // now lets clear the key, we're done with it and moving on + currentKey=null; + } break; case ':':// key : value separator @@ -670,83 +670,83 @@ namespace OpenSim.Region.ScriptEngine.Common // just ignore break; case '[': // array start - ArrayList currentArray = new ArrayList(); - - if(objectStack.Peek().ToString()=="System.Collections.ArrayList") - { - ((ArrayList)objectStack.Peek()).Add(currentArray); - } - else - { - ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray); - // clear the key - currentKey=null; - } - objectStack.Push(currentArray); + ArrayList currentArray = new ArrayList(); + + if (objectStack.Peek().ToString()=="System.Collections.ArrayList") + { + ((ArrayList)objectStack.Peek()).Add(currentArray); + } + else + { + ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray); + // clear the key + currentKey=null; + } + objectStack.Push(currentArray); break; case ',':// seperator // just ignore break; case ']'://Array end - // pop the array off the stack - objectStack.Pop(); + // pop the array off the stack + objectStack.Pop(); break; case 't': // we've found a character start not in quotes, it must be a boolean true - if(objectStack.Peek().ToString()=="System.Collections.ArrayList") - { - ((ArrayList)objectStack.Peek()).Add(true); - } - else - { - ((Hashtable)objectStack.Peek()).Add(currentKey,true); - } - - //advance the counter to the letter 'e' - i = i+3; + if (objectStack.Peek().ToString()=="System.Collections.ArrayList") + { + ((ArrayList)objectStack.Peek()).Add(true); + } + else + { + ((Hashtable)objectStack.Peek()).Add(currentKey,true); + } + + //advance the counter to the letter 'e' + i = i+3; break; case 'f': // we've found a character start not in quotes, it must be a boolean false - - if(objectStack.Peek().ToString()=="System.Collections.ArrayList") - { - ((ArrayList)objectStack.Peek()).Add(false); - } - else - { - ((Hashtable)objectStack.Peek()).Add(currentKey,false); - } - //advance the counter to the letter 'e' - i = i+4; + + if (objectStack.Peek().ToString()=="System.Collections.ArrayList") + { + ((ArrayList)objectStack.Peek()).Add(false); + } + else + { + ((Hashtable)objectStack.Peek()).Add(currentKey,false); + } + //advance the counter to the letter 'e' + i = i+4; break; default: - // ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately - // but for now we'll just do them as strings - - string numberValue=""; - - // just loop through until the next known marker quote mark storing the string - while(JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') - { - numberValue+=""+JSON[i++]; - } - - i--; // we want to process this caracter that marked the end of this string in the main loop - - // ok we've got a string, if we've got an array on the top of the stack then we store it - if(objectStack.Peek().ToString()=="System.Collections.ArrayList") - { - ((ArrayList)objectStack.Peek()).Add(numberValue); - } - else - { - // we have a key so lets store this value - ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue); - // now lets clear the key, we're done with it and moving on - currentKey=null; - } - + // ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately + // but for now we'll just do them as strings + + string numberValue=""; + + // just loop through until the next known marker quote mark storing the string + while (JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') + { + numberValue+=""+JSON[i++]; + } + + i--; // we want to process this caracter that marked the end of this string in the main loop + + // ok we've got a string, if we've got an array on the top of the stack then we store it + if (objectStack.Peek().ToString()=="System.Collections.ArrayList") + { + ((ArrayList)objectStack.Peek()).Add(numberValue); + } + else + { + // we have a key so lets store this value + ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue); + // now lets clear the key, we're done with it and moving on + currentKey=null; + } + break; } } -- cgit v1.1