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) public void StoreRegionSettings(RegionSettings rs)
{ {
lock(ds) lock (ds)
{ {
DataTable regionsettings = ds.Tables["regionsettings"]; DataTable regionsettings = ds.Tables["regionsettings"];

View File

@ -4793,7 +4793,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack; ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack;
handlerObjectClickAction = OnObjectClickAction; handlerObjectClickAction = OnObjectClickAction;
if(handlerObjectClickAction != null) if (handlerObjectClickAction != null)
{ {
foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) 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 // 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? if (m_parentGroup != null) // TODO can there be a SOP without a SOG?
{ {
ScenePresence avatar; ScenePresence avatar;
if(m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar)) { if (m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar))
{
avatar.ParentPosition = GetWorldPosition(); 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; m_cameraAtOffset = v;
} }
public void SetCameraEyeOffset(Vector3 v) { public void SetCameraEyeOffset(Vector3 v)
{
m_cameraEyeOffset = v; m_cameraEyeOffset = v;
} }
public void SetForceMouselook(bool force) { public void SetForceMouselook(bool force)
{
m_forceMouselook = force; m_forceMouselook = force;
} }
public Vector3 GetCameraAtOffset() { public Vector3 GetCameraAtOffset()
{
return m_cameraAtOffset; return m_cameraAtOffset;
} }
public Vector3 GetCameraEyeOffset() { public Vector3 GetCameraEyeOffset()
{
return m_cameraEyeOffset; return m_cameraEyeOffset;
} }
public bool GetForceMouselook() { public bool GetForceMouselook()
{
return m_forceMouselook; return m_forceMouselook;
} }

View File

@ -976,8 +976,8 @@ angles24 = [
while (!done) // loop through the length of the path and add the layers while (!done) // loop through the length of the path and add the layers
{ {
bool isEndLayer = false; bool isEndLayer = false;
if (angle == startAngle || angle >= endAngle) if (angle == startAngle || angle >= endAngle)
isEndLayer = true; isEndLayer = true;
Profile newLayer = profile.Clone(isEndLayer && needEndFaces); Profile newLayer = profile.Clone(isEndLayer && needEndFaces);

View File

@ -603,64 +603,64 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
// Console.WriteLine(""+JSON[i]); // Console.WriteLine(""+JSON[i]);
switch(JSON[i]) switch (JSON[i])
{ {
case '{': 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(); Hashtable currentObject = new Hashtable();
if(objectStack.Count==0) // the stack should only be empty for the first outer object if (objectStack.Count==0) // the stack should only be empty for the first outer object
{ {
objectStack.Push(jsondata); objectStack.Push(jsondata);
} }
else if(objectStack.Peek().ToString()=="System.Collections.ArrayList") else if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
{ {
// add it to the parent array // add it to the parent array
((ArrayList)objectStack.Peek()).Add(currentObject); ((ArrayList)objectStack.Peek()).Add(currentObject);
objectStack.Push(currentObject); objectStack.Push(currentObject);
} }
else else
{ {
// add it to the parent hashtable // add it to the parent hashtable
((Hashtable)objectStack.Peek()).Add(currentKey,currentObject); ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject);
objectStack.Push(currentObject); objectStack.Push(currentObject);
} }
// clear the key // clear the key
currentKey=null; currentKey=null;
break; break;
case '}': case '}':
// pop the hashtable off the stack // pop the hashtable off the stack
objectStack.Pop(); objectStack.Pop();
break; break;
case '"':// string boundary case '"':// string boundary
string tokenValue=""; string tokenValue="";
i++; // move to next char i++; // move to next char
// just loop through until the next quote mark storing the string // just loop through until the next quote mark storing the string
while(JSON[i]!='"') while (JSON[i]!='"')
{ {
tokenValue+=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 // 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") if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
{ {
((ArrayList)objectStack.Peek()).Add(tokenValue); ((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 else if (currentKey==null) // no key stored and its not an array this must be a key so store it
{ {
currentKey = tokenValue; currentKey = tokenValue;
} }
else else
{ {
// we have a key so lets store this value // we have a key so lets store this value
((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue); ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue);
// now lets clear the key, we're done with it and moving on // now lets clear the key, we're done with it and moving on
currentKey=null; currentKey=null;
} }
break; break;
case ':':// key : value separator case ':':// key : value separator
@ -670,83 +670,83 @@ namespace OpenSim.Region.ScriptEngine.Common
// just ignore // just ignore
break; break;
case '[': // array start case '[': // array start
ArrayList currentArray = new ArrayList(); ArrayList currentArray = new ArrayList();
if(objectStack.Peek().ToString()=="System.Collections.ArrayList") if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
{ {
((ArrayList)objectStack.Peek()).Add(currentArray); ((ArrayList)objectStack.Peek()).Add(currentArray);
} }
else else
{ {
((Hashtable)objectStack.Peek()).Add(currentKey,currentArray); ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray);
// clear the key // clear the key
currentKey=null; currentKey=null;
} }
objectStack.Push(currentArray); objectStack.Push(currentArray);
break; break;
case ',':// seperator case ',':// seperator
// just ignore // just ignore
break; break;
case ']'://Array end case ']'://Array end
// pop the array off the stack // pop the array off the stack
objectStack.Pop(); objectStack.Pop();
break; break;
case 't': // we've found a character start not in quotes, it must be a boolean true case 't': // we've found a character start not in quotes, it must be a boolean true
if(objectStack.Peek().ToString()=="System.Collections.ArrayList") if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
{ {
((ArrayList)objectStack.Peek()).Add(true); ((ArrayList)objectStack.Peek()).Add(true);
} }
else else
{ {
((Hashtable)objectStack.Peek()).Add(currentKey,true); ((Hashtable)objectStack.Peek()).Add(currentKey,true);
} }
//advance the counter to the letter 'e' //advance the counter to the letter 'e'
i = i+3; i = i+3;
break; break;
case 'f': // we've found a character start not in quotes, it must be a boolean false case 'f': // we've found a character start not in quotes, it must be a boolean false
if(objectStack.Peek().ToString()=="System.Collections.ArrayList") if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
{ {
((ArrayList)objectStack.Peek()).Add(false); ((ArrayList)objectStack.Peek()).Add(false);
} }
else else
{ {
((Hashtable)objectStack.Peek()).Add(currentKey,false); ((Hashtable)objectStack.Peek()).Add(currentKey,false);
} }
//advance the counter to the letter 'e' //advance the counter to the letter 'e'
i = i+4; i = i+4;
break; break;
default: default:
// ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately // 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 // 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 // just loop through until the next known marker quote mark storing the string
while(JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') while (JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ')
{ {
numberValue+=""+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 // 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") if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
{ {
((ArrayList)objectStack.Peek()).Add(numberValue); ((ArrayList)objectStack.Peek()).Add(numberValue);
} }
else else
{ {
// we have a key so lets store this value // we have a key so lets store this value
((Hashtable)objectStack.Peek()).Add(currentKey,numberValue); ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue);
// now lets clear the key, we're done with it and moving on // now lets clear the key, we're done with it and moving on
currentKey=null; currentKey=null;
} }
break; break;
} }
} }