Formatting cleanup.

0.6.0-stable
Jeff Ames 2008-09-13 22:07:07 +00:00
parent 54e1988d85
commit b4141f9e56
5 changed files with 135 additions and 128 deletions

View File

@ -205,7 +205,7 @@ namespace OpenSim.Data.SQLite
public void StoreRegionSettings(RegionSettings rs)
{
lock(ds)
lock (ds)
{
DataTable regionsettings = ds.Tables["regionsettings"];

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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);

View File

@ -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
// 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
{
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);
}
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;
// 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
string tokenValue="";
i++; // move to next char
// just loop through until the next quote mark storing the string
while(JSON[i]!='"')
{
tokenValue+=JSON[i++];
}
// 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;
}
// 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,82 +670,82 @@ namespace OpenSim.Region.ScriptEngine.Common
// just ignore
break;
case '[': // array start
ArrayList currentArray = new ArrayList();
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);
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);
}
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;
//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
// 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="";
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++];
}
// 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
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 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;
}