De-tabify source.

0.6.0-stable
Jeff Ames 2008-05-06 22:41:38 +00:00
parent 0b09966c7e
commit 0ea48cf786
9 changed files with 533 additions and 527 deletions

View File

@ -198,7 +198,6 @@ namespace OpenSim.Data.MSSQL
while (reader.Read())
items.Add(readInventoryFolder(reader));
reader.Close();
result.Dispose();
@ -321,12 +320,12 @@ namespace OpenSim.Data.MSSQL
item.Creator = new LLUUID((string) reader["creatorID"]);
item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]);
item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]);
item.SalePrice = (int) reader["salePrice"];
item.SaleType = Convert.ToByte(reader["saleType"]);
item.CreationDate = (int) reader["creationDate"];
item.GroupID = new LLUUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
item.Flags = (uint) reader["flags"];
item.SalePrice = (int) reader["salePrice"];
item.SaleType = Convert.ToByte(reader["saleType"]);
item.CreationDate = (int) reader["creationDate"];
item.GroupID = new LLUUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
item.Flags = (uint) reader["flags"];
return item;
}

View File

@ -333,7 +333,7 @@ namespace OpenSim.Data.MySQL
item.Creator = new LLUUID((string) reader["creatorID"]);
item.BasePermissions = (uint) reader["inventoryBasePermissions"];
item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
item.SalePrice = (int) reader["salePrice"];
item.SalePrice = (int) reader["salePrice"];
item.SaleType = Convert.ToByte(reader["saleType"]);
item.CreationDate = (int) reader["creationDate"];
item.GroupID = new LLUUID(reader["groupID"].ToString());

View File

@ -237,14 +237,14 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
// Outside of this method, they should never be added to objectflags!
// -teravus
SceneObjectPart task=m_scene.GetSceneObjectPart(objID);
SceneObjectPart task=m_scene.GetSceneObjectPart(objID);
// this shouldn't ever happen.. return no permissions/objectflags.
if (task == null)
return (uint)0;
uint objflags = task.GetEffectiveObjectFlags();
LLUUID objectOwner = task.OwnerID;
uint objflags = task.GetEffectiveObjectFlags();
LLUUID objectOwner = task.OwnerID;
// Remove any of the objectFlags that are temporary. These will get added back if appropriate

View File

@ -193,7 +193,7 @@ namespace OpenSim.Region.Environment.Scenes
// Is this prim part of the group
if (obj.HasChildPrim(localID))
{
SceneObjectPart part=obj.GetChildPart(localID);
SceneObjectPart part=obj.GetChildPart(localID);
if (part != null)
{
// If the touched prim handles touches, deliver it

View File

@ -186,8 +186,6 @@ namespace OpenSim.Region.Environment.Scenes
string.Format("[SCENE OBJECT GROUP]: Object {0} has no root part.", m_uuid));
}
return m_rootPart.GroupPosition;
}
set
@ -198,7 +196,6 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.CrossPrimGroupIntoNewRegion(val, this);
}
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
@ -969,19 +966,19 @@ namespace OpenSim.Region.Environment.Scenes
public void aggregateScriptEvents()
{
uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags();
uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags();
scriptEvents aggregateScriptEvents=0;
scriptEvents aggregateScriptEvents=0;
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
{
if(part == null)
continue;
if(part != RootPart)
part.ObjectFlags = objectflagupdate;
aggregateScriptEvents |= part.m_aggregateScriptEvents;
if (part == null)
continue;
if (part != RootPart)
part.ObjectFlags = objectflagupdate;
aggregateScriptEvents |= part.m_aggregateScriptEvents;
}
}

View File

@ -98,8 +98,8 @@ namespace OpenSim.Region.Environment.Scenes
// TODO: This needs to be persisted in next XML version update!
[XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2};
[XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
[XmlIgnore] public scriptEvents m_aggregateScriptEvents=0;
[XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
[XmlIgnore] public scriptEvents m_aggregateScriptEvents=0;
[XmlIgnore] private LLObject.ObjectFlags LocalFlags = LLObject.ObjectFlags.None;
[XmlIgnore] public bool DIE_AT_EDGE = false;
@ -190,10 +190,10 @@ namespace OpenSim.Region.Environment.Scenes
set { m_name = value; }
}
public scriptEvents ScriptEvents
{
get { return m_aggregateScriptEvents; }
}
public scriptEvents ScriptEvents
{
get { return m_aggregateScriptEvents; }
}
protected LLObject.MaterialType m_material = 0;
@ -211,14 +211,14 @@ namespace OpenSim.Region.Environment.Scenes
set { m_regionHandle = value; }
}
public uint GetEffectiveObjectFlags()
{
LLObject.ObjectFlags f=Flags;
if(m_parentGroup == null || m_parentGroup.RootPart == this)
f &= ~(LLObject.ObjectFlags.Touch | LLObject.ObjectFlags.Money);
public uint GetEffectiveObjectFlags()
{
LLObject.ObjectFlags f = Flags;
if (m_parentGroup == null || m_parentGroup.RootPart == this)
f &= ~(LLObject.ObjectFlags.Touch | LLObject.ObjectFlags.Money);
return (uint)Flags | (uint)LocalFlags;
}
return (uint)Flags | (uint)LocalFlags;
}
//unkown if this will be kept, added as a way of removing the group position from the group class
protected LLVector3 m_groupPosition;
@ -2158,14 +2158,14 @@ namespace OpenSim.Region.Environment.Scenes
}
}
if(soundID == LLUUID.Zero)
if (soundID == LLUUID.Zero)
return;
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
foreach (ScenePresence p in avatarts)
{
double dis=Util.GetDistanceTo(p.AbsolutePosition, position);
if(dis > 100.0) // Max audio distance
if (dis > 100.0) // Max audio distance
continue;
// Scale by distance
@ -2623,25 +2623,25 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void SetScriptEvents(LLUUID scriptid, int events)
{
scriptEvents oldparts;
lock (m_scriptEvents)
{
if (m_scriptEvents.ContainsKey(scriptid))
{
oldparts = m_scriptEvents[scriptid];
public void SetScriptEvents(LLUUID scriptid, int events)
{
scriptEvents oldparts;
lock (m_scriptEvents)
{
if (m_scriptEvents.ContainsKey(scriptid))
{
oldparts = m_scriptEvents[scriptid];
// remove values from aggregated script events
m_scriptEvents[scriptid] = (scriptEvents) events;
}
else
{
m_scriptEvents.Add(scriptid, (scriptEvents) events);
}
}
aggregateScriptEvents();
}
// remove values from aggregated script events
m_scriptEvents[scriptid] = (scriptEvents) events;
}
else
{
m_scriptEvents.Add(scriptid, (scriptEvents) events);
}
}
aggregateScriptEvents();
}
public void RemoveScriptEvents(LLUUID scriptid)
{
@ -2710,16 +2710,15 @@ namespace OpenSim.Region.Environment.Scenes
}
}
LocalFlags=(LLObject.ObjectFlags)objectflagupdate;
LocalFlags=(LLObject.ObjectFlags)objectflagupdate;
if(m_parentGroup != null && m_parentGroup.RootPart == this)
m_parentGroup.aggregateScriptEvents();
else
ScheduleFullUpdate();
}
if (m_parentGroup != null && m_parentGroup.RootPart == this)
m_parentGroup.aggregateScriptEvents();
else
ScheduleFullUpdate();
}
public void PhysicsCollision(EventArgs e)
{
return;
//
@ -2733,7 +2732,6 @@ namespace OpenSim.Region.Environment.Scenes
//{
// m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString());
//}
}
public void SetDieAtEdge(bool p)
@ -2755,5 +2753,4 @@ namespace OpenSim.Region.Environment.Scenes
return m_parentGroup.RootPart.DIE_AT_EDGE;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -64,11 +64,11 @@ namespace OpenSim.Region.ScriptEngine.Common
str = str.Replace('<', ' ');
str = str.Replace('>', ' ');
string[] tmps = str.Split(new Char[] { ',', '<', '>' });
if(tmps.Length < 3)
{
x=y=z=0;
return;
}
if (tmps.Length < 3)
{
x=y=z=0;
return;
}
bool res;
res = Double.TryParse(tmps[0], out x);
res = res & Double.TryParse(tmps[1], out y);
@ -81,26 +81,26 @@ namespace OpenSim.Region.ScriptEngine.Common
public override string ToString()
{
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", x, y, z);
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", x, y, z);
return s;
}
public static explicit operator LSLString(Vector3 vec)
{
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
return new LSLString(s);
}
public static explicit operator string(Vector3 vec)
{
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
return s;
}
public static explicit operator Vector3(string s)
{
return new Vector3(s);
}
public static explicit operator Vector3(string s)
{
return new Vector3(s);
}
public static bool operator ==(Vector3 lhs, Vector3 rhs)
{
@ -296,11 +296,11 @@ namespace OpenSim.Region.ScriptEngine.Common
str = str.Replace('<', ' ');
str = str.Replace('>', ' ');
string[] tmps = str.Split(new Char[] { ',', '<', '>' });
if(tmps.Length < 4)
{
x=y=z=s=0;
return;
}
if (tmps.Length < 4)
{
x=y=z=s=0;
return;
}
bool res;
res = Double.TryParse(tmps[0], out x);
res = res & Double.TryParse(tmps[1], out y);
@ -330,26 +330,26 @@ namespace OpenSim.Region.ScriptEngine.Common
public override string ToString()
{
string st=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
string st=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
return st;
}
public static explicit operator string(Quaternion r)
{
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
return s;
}
public static explicit operator LSLString(Quaternion r)
{
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
return new LSLString(s);
}
public static explicit operator Quaternion(string s)
{
return new Quaternion(s);
}
public static explicit operator Quaternion(string s)
{
return new Quaternion(s);
}
public static bool operator ==(Quaternion lhs, Quaternion rhs)
{
@ -406,19 +406,19 @@ namespace OpenSim.Region.ScriptEngine.Common
public int Length
{
get {
if(m_data == null)
m_data=new Object[0];
return m_data.Length;
}
if (m_data == null)
m_data=new Object[0];
return m_data.Length;
}
}
public object[] Data
{
get {
if(m_data == null)
m_data=new Object[0];
return m_data;
}
if (m_data == null)
m_data=new Object[0];
return m_data;
}
}
public static list operator +(list a, list b)
@ -453,67 +453,67 @@ namespace OpenSim.Region.ScriptEngine.Common
return ret;
}
public list DeleteSublist(int start, int end)
{
// Not an easy one
// If start <= end, remove that part
// if either is negative, count from the end of the array
// if the resulting start > end, remove all BUT that part
public list DeleteSublist(int start, int end)
{
// Not an easy one
// If start <= end, remove that part
// if either is negative, count from the end of the array
// if the resulting start > end, remove all BUT that part
Object[] ret;
Object[] ret;
if(start < 0)
start=m_data.Length-start;
if (start < 0)
start=m_data.Length-start;
if(start < 0)
start=0;
if (start < 0)
start=0;
if(end < 0)
end=m_data.Length-end;
if(end < 0)
end=0;
if (end < 0)
end=m_data.Length-end;
if (end < 0)
end=0;
if(start > end)
{
if(end >= m_data.Length)
return new list(new Object[0]);
if (start > end)
{
if (end >= m_data.Length)
return new list(new Object[0]);
if(start >= m_data.Length)
start=m_data.Length-1;
if (start >= m_data.Length)
start=m_data.Length-1;
return GetSublist(end, start);
}
return GetSublist(end, start);
}
// start >= 0 && end >= 0 here
if(start >= m_data.Length)
{
ret=new Object[m_data.Length];
Array.Copy(m_data, 0, ret, 0, m_data.Length);
// start >= 0 && end >= 0 here
if (start >= m_data.Length)
{
ret=new Object[m_data.Length];
Array.Copy(m_data, 0, ret, 0, m_data.Length);
return new list(ret);
}
return new list(ret);
}
if(end >= m_data.Length)
end=m_data.Length-1;
if (end >= m_data.Length)
end=m_data.Length-1;
// now, this makes the math easier
int remove=end+1-start;
// now, this makes the math easier
int remove=end+1-start;
ret=new Object[m_data.Length-remove];
if(ret.Length == 0)
return new list(ret);
ret=new Object[m_data.Length-remove];
if (ret.Length == 0)
return new list(ret);
int src;
int dest=0;
int src;
int dest=0;
for(src = 0 ; src < m_data.Length ; src++)
{
if(src < start || src > end)
ret[dest++]=m_data[src];
}
for(src = 0 ; src < m_data.Length ; src++)
{
if (src < start || src > end)
ret[dest++]=m_data[src];
}
return new list(ret);
}
return new list(ret);
}
public list GetSublist(int start, int end)
{
@ -581,13 +581,13 @@ namespace OpenSim.Region.ScriptEngine.Common
list result = null;
// If end is negative, then prefix list is empty
if(end < 0)
if (end < 0)
{
result = new list();
// If start is still negative, then the whole of
// the existing list is returned. This case is
// only admitted if end is also still negative.
if(start < 0)
if (start < 0)
{
return this;
}
@ -600,7 +600,7 @@ namespace OpenSim.Region.ScriptEngine.Common
// If start is outside of list, then just return
// the prefix, whatever it is.
if(start >= m_data.Length)
if (start >= m_data.Length)
{
return result;
}
@ -610,76 +610,76 @@ namespace OpenSim.Region.ScriptEngine.Common
}
}
public list Sort(int stride, int ascending)
{
if(Data.Length == 0)
return new list(); // Don't even bother
public list Sort(int stride, int ascending)
{
if (Data.Length == 0)
return new list(); // Don't even bother
string[] keys;
string[] keys;
if(stride == 1) // The simple case
{
Object[] ret=new Object[Data.Length];
if (stride == 1) // The simple case
{
Object[] ret=new Object[Data.Length];
Array.Copy(Data, 0, ret, 0, Data.Length);
Array.Copy(Data, 0, ret, 0, Data.Length);
keys=new string[Data.Length];
int k;
for(k=0;k<Data.Length;k++)
keys[k]=Data[k].ToString();
keys=new string[Data.Length];
int k;
for(k=0;k<Data.Length;k++)
keys[k]=Data[k].ToString();
Array.Sort(keys, ret);
Array.Sort(keys, ret);
if(ascending == 0)
Array.Reverse(ret);
return new list(ret);
}
if (ascending == 0)
Array.Reverse(ret);
return new list(ret);
}
int src=0;
int src=0;
int len=(Data.Length+stride-1)/stride;
int len=(Data.Length+stride-1)/stride;
keys=new string[len];
Object[][] vals=new Object[len][];
keys=new string[len];
Object[][] vals=new Object[len][];
int i;
int i;
while(src < Data.Length)
{
Object[] o=new Object[stride];
while(src < Data.Length)
{
Object[] o=new Object[stride];
for(i=0;i<stride;i++)
{
if(src < Data.Length)
o[i]=Data[src++];
else
{
o[i]=new Object();
src++;
}
}
for(i=0;i<stride;i++)
{
if (src < Data.Length)
o[i]=Data[src++];
else
{
o[i]=new Object();
src++;
}
}
int idx=src/stride-1;
keys[idx]=o[0].ToString();
vals[idx]=o;
}
int idx=src/stride-1;
keys[idx]=o[0].ToString();
vals[idx]=o;
}
Array.Sort(keys, vals);
if(ascending == 0)
{
Array.Reverse(vals);
}
Array.Sort(keys, vals);
if (ascending == 0)
{
Array.Reverse(vals);
}
Object[] sorted=new Object[stride*vals.Length];
Object[] sorted=new Object[stride*vals.Length];
int j;
int j;
for(i=0;i<vals.Length;i++)
for(j=0;j<stride;j++)
sorted[i*stride+j]=vals[i][j];
for(i=0;i<vals.Length;i++)
for(j=0;j<stride;j++)
sorted[i*stride+j]=vals[i][j];
return new list(sorted);
}
return new list(sorted);
}
#region CSV Methods
@ -693,7 +693,7 @@ namespace OpenSim.Region.ScriptEngine.Common
string ret = "";
foreach(object o in this.Data)
{
if(ret == "")
if (ret == "")
{
ret = o.ToString();
}
@ -720,20 +720,20 @@ namespace OpenSim.Region.ScriptEngine.Common
return output;
}
public static explicit operator String(list l)
{
return l.ToSoup();
}
public static explicit operator String(list l)
{
return l.ToSoup();
}
public static explicit operator LSLString(list l)
{
return new LSLString(l.ToSoup());
}
public static explicit operator LSLString(list l)
{
return new LSLString(l.ToSoup());
}
public override string ToString()
{
return ToSoup();
}
public override string ToString()
{
return ToSoup();
}
#endregion
@ -1068,7 +1068,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public override bool Equals(object o)
{
return o.ToString() == value;
return o.ToString() == value;
}
public override int GetHashCode()
@ -1089,11 +1089,11 @@ namespace OpenSim.Region.ScriptEngine.Common
m_string = s;
}
public LSLString(double d)
{
string s=String.Format("{0:0.000000}", d);
m_string=s;
}
public LSLString(double d)
{
string s=String.Format("{0:0.000000}", d);
m_string=s;
}
#endregion
@ -1120,10 +1120,10 @@ namespace OpenSim.Region.ScriptEngine.Common
return new LSLString(s);
}
public static string ToString(LSLString s)
{
return s.m_string;
}
public static string ToString(LSLString s)
{
return s.m_string;
}
public override string ToString()
{
@ -1140,27 +1140,27 @@ namespace OpenSim.Region.ScriptEngine.Common
return s1.m_string != s2;
}
public static explicit operator double(LSLString s)
{
return Convert.ToDouble(s.m_string);
}
public static explicit operator double(LSLString s)
{
return Convert.ToDouble(s.m_string);
}
public static explicit operator LSLInteger(LSLString s)
{
return new LSLInteger(Convert.ToInt32(s.m_string));
}
public static explicit operator LSLInteger(LSLString s)
{
return new LSLInteger(Convert.ToInt32(s.m_string));
}
public static explicit operator LSLString(double d)
{
return new LSLString(d);
}
public static explicit operator LSLString(double d)
{
return new LSLString(d);
}
#endregion
#region Overriders
public override bool Equals(object o)
{
return m_string == o.ToString();
return m_string == o.ToString();
}
public override int GetHashCode()
@ -1212,10 +1212,10 @@ namespace OpenSim.Region.ScriptEngine.Common
return (uint)i.value;
}
static public explicit operator LSLString(LSLInteger i)
{
return new LSLString(i.ToString());
}
static public explicit operator LSLString(LSLInteger i)
{
return new LSLString(i.ToString());
}
static public implicit operator Boolean(LSLInteger i)
{
@ -1234,10 +1234,10 @@ namespace OpenSim.Region.ScriptEngine.Common
return new LSLInteger(i);
}
static public explicit operator LSLInteger(string s)
{
return new LSLInteger(int.Parse(s));
}
static public explicit operator LSLInteger(string s)
{
return new LSLInteger(int.Parse(s));
}
static public implicit operator LSLInteger(double d)
{
@ -1250,17 +1250,17 @@ namespace OpenSim.Region.ScriptEngine.Common
return ret;
}
public static LSLInteger operator ++(LSLInteger i)
{
i.value++;
return i;
}
public static LSLInteger operator ++(LSLInteger i)
{
i.value++;
return i;
}
public static LSLInteger operator --(LSLInteger i)
{
i.value--;
return i;
}
public static LSLInteger operator --(LSLInteger i)
{
i.value--;
return i;
}
static public implicit operator System.Double(LSLInteger i)
{

View File

@ -295,18 +295,18 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
if (e.InnerException != null)
{
// Send inner exception
string[] lines=e.InnerException.ToString().Replace("\r", "").Split('\n');
int line=0;
foreach(string t in lines)
{
int idx=t.IndexOf("SecondLife.Script.");
if(idx != -1)
{
int colon=t.IndexOf(":");
line=Convert.ToInt32(t.Substring(colon+1));
break;
}
}
string[] lines=e.InnerException.ToString().Replace("\r", "").Split('\n');
int line=0;
foreach(string t in lines)
{
int idx=t.IndexOf("SecondLife.Script.");
if(idx != -1)
{
int colon=t.IndexOf(":");
line=Convert.ToInt32(t.Substring(colon+1));
break;
}
}
text += e.InnerException.Message.ToString()+" in line "+line.ToString();
}
else