Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

0.8.2-post-fixes
dahlia 2015-08-23 15:19:58 -07:00
commit c30c7da15b
1 changed files with 62 additions and 62 deletions

View File

@ -581,7 +581,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
/// <param name='itemIndex'></param> /// <param name='itemIndex'></param>
public Type GetLSLListItemType(int itemIndex) public Type GetLSLListItemType(int itemIndex)
{ {
return m_data[itemIndex].GetType(); return Data[itemIndex].GetType();
} }
/// <summary> /// <summary>
@ -598,107 +598,107 @@ namespace OpenSim.Region.ScriptEngine.Shared
/// <param name='itemIndex'></param> /// <param name='itemIndex'></param>
public LSL_Types.LSLFloat GetLSLFloatItem(int itemIndex) public LSL_Types.LSLFloat GetLSLFloatItem(int itemIndex)
{ {
if (m_data[itemIndex] is LSL_Types.LSLInteger) if (Data[itemIndex] is LSL_Types.LSLInteger)
{ {
return (LSL_Types.LSLInteger)m_data[itemIndex]; return (LSL_Types.LSLInteger)Data[itemIndex];
} }
else if (m_data[itemIndex] is Int32) else if (Data[itemIndex] is Int32)
{ {
return new LSL_Types.LSLFloat((int)m_data[itemIndex]); return new LSL_Types.LSLFloat((int)Data[itemIndex]);
} }
else if (m_data[itemIndex] is float) else if (Data[itemIndex] is float)
{ {
return new LSL_Types.LSLFloat((float)m_data[itemIndex]); return new LSL_Types.LSLFloat((float)Data[itemIndex]);
} }
else if (m_data[itemIndex] is Double) else if (Data[itemIndex] is Double)
{ {
return new LSL_Types.LSLFloat((Double)m_data[itemIndex]); return new LSL_Types.LSLFloat((Double)Data[itemIndex]);
} }
else if (m_data[itemIndex] is LSL_Types.LSLString) else if (Data[itemIndex] is LSL_Types.LSLString)
{ {
return new LSL_Types.LSLFloat(m_data[itemIndex].ToString()); return new LSL_Types.LSLFloat(Data[itemIndex].ToString());
} }
else else
{ {
return (LSL_Types.LSLFloat)m_data[itemIndex]; return (LSL_Types.LSLFloat)Data[itemIndex];
} }
} }
public LSL_Types.LSLString GetLSLStringItem(int itemIndex) public LSL_Types.LSLString GetLSLStringItem(int itemIndex)
{ {
if (m_data[itemIndex] is LSL_Types.key) if (Data[itemIndex] is LSL_Types.key)
{ {
return (LSL_Types.key)m_data[itemIndex]; return (LSL_Types.key)Data[itemIndex];
} }
else else
{ {
return new LSL_Types.LSLString(m_data[itemIndex].ToString()); return new LSL_Types.LSLString(Data[itemIndex].ToString());
} }
} }
public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex) public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex)
{ {
if (m_data[itemIndex] is LSL_Types.LSLInteger) if (Data[itemIndex] is LSL_Types.LSLInteger)
return (LSL_Types.LSLInteger)m_data[itemIndex]; return (LSL_Types.LSLInteger)Data[itemIndex];
if (m_data[itemIndex] is LSL_Types.LSLFloat) if (Data[itemIndex] is LSL_Types.LSLFloat)
return new LSLInteger((int)m_data[itemIndex]); return new LSLInteger((int)Data[itemIndex]);
else if (m_data[itemIndex] is Int32) else if (Data[itemIndex] is Int32)
return new LSLInteger((int)m_data[itemIndex]); return new LSLInteger((int)Data[itemIndex]);
else if (m_data[itemIndex] is LSL_Types.LSLString) else if (Data[itemIndex] is LSL_Types.LSLString)
return new LSLInteger(m_data[itemIndex].ToString()); return new LSLInteger(Data[itemIndex].ToString());
else else
throw new InvalidCastException(string.Format( throw new InvalidCastException(string.Format(
"{0} expected but {1} given", "{0} expected but {1} given",
typeof(LSL_Types.LSLInteger).Name, typeof(LSL_Types.LSLInteger).Name,
m_data[itemIndex] != null ? Data[itemIndex] != null ?
m_data[itemIndex].GetType().Name : "null")); Data[itemIndex].GetType().Name : "null"));
} }
public LSL_Types.Vector3 GetVector3Item(int itemIndex) public LSL_Types.Vector3 GetVector3Item(int itemIndex)
{ {
if (m_data[itemIndex] is LSL_Types.Vector3) if (Data[itemIndex] is LSL_Types.Vector3)
{ {
return (LSL_Types.Vector3)m_data[itemIndex]; return (LSL_Types.Vector3)Data[itemIndex];
} }
else if(m_data[itemIndex] is OpenMetaverse.Vector3) else if(Data[itemIndex] is OpenMetaverse.Vector3)
{ {
return new LSL_Types.Vector3( return new LSL_Types.Vector3(
(OpenMetaverse.Vector3)m_data[itemIndex]); (OpenMetaverse.Vector3)Data[itemIndex]);
} }
else else
{ {
throw new InvalidCastException(string.Format( throw new InvalidCastException(string.Format(
"{0} expected but {1} given", "{0} expected but {1} given",
typeof(LSL_Types.Vector3).Name, typeof(LSL_Types.Vector3).Name,
m_data[itemIndex] != null ? Data[itemIndex] != null ?
m_data[itemIndex].GetType().Name : "null")); Data[itemIndex].GetType().Name : "null"));
} }
} }
public LSL_Types.Quaternion GetQuaternionItem(int itemIndex) public LSL_Types.Quaternion GetQuaternionItem(int itemIndex)
{ {
if (m_data[itemIndex] is LSL_Types.Quaternion) if (Data[itemIndex] is LSL_Types.Quaternion)
{ {
return (LSL_Types.Quaternion)m_data[itemIndex]; return (LSL_Types.Quaternion)Data[itemIndex];
} }
else if(m_data[itemIndex] is OpenMetaverse.Quaternion) else if(Data[itemIndex] is OpenMetaverse.Quaternion)
{ {
return new LSL_Types.Quaternion( return new LSL_Types.Quaternion(
(OpenMetaverse.Quaternion)m_data[itemIndex]); (OpenMetaverse.Quaternion)Data[itemIndex]);
} }
else else
{ {
throw new InvalidCastException(string.Format( throw new InvalidCastException(string.Format(
"{0} expected but {1} given", "{0} expected but {1} given",
typeof(LSL_Types.Quaternion).Name, typeof(LSL_Types.Quaternion).Name,
m_data[itemIndex] != null ? Data[itemIndex] != null ?
m_data[itemIndex].GetType().Name : "null")); Data[itemIndex].GetType().Name : "null"));
} }
} }
public LSL_Types.key GetKeyItem(int itemIndex) public LSL_Types.key GetKeyItem(int itemIndex)
{ {
return (LSL_Types.key)m_data[itemIndex]; return (LSL_Types.key)Data[itemIndex];
} }
public static list operator +(list a, list b) public static list operator +(list a, list b)
@ -794,53 +794,53 @@ namespace OpenSim.Region.ScriptEngine.Shared
Object[] ret; Object[] ret;
if (start < 0) if (start < 0)
start=m_data.Length+start; start=Data.Length+start;
if (start < 0) if (start < 0)
start=0; start=0;
if (end < 0) if (end < 0)
end=m_data.Length+end; end=Data.Length+end;
if (end < 0) if (end < 0)
end=0; end=0;
if (start > end) if (start > end)
{ {
if (end >= m_data.Length) if (end >= Data.Length)
return new list(new Object[0]); return new list(new Object[0]);
if (start >= m_data.Length) if (start >= Data.Length)
start=m_data.Length-1; start=Data.Length-1;
return GetSublist(end, start); return GetSublist(end, start);
} }
// start >= 0 && end >= 0 here // start >= 0 && end >= 0 here
if (start >= m_data.Length) if (start >= Data.Length)
{ {
ret=new Object[m_data.Length]; ret=new Object[Data.Length];
Array.Copy(m_data, 0, ret, 0, m_data.Length); Array.Copy(Data, 0, ret, 0, Data.Length);
return new list(ret); return new list(ret);
} }
if (end >= m_data.Length) if (end >= Data.Length)
end=m_data.Length-1; end=Data.Length-1;
// now, this makes the math easier // now, this makes the math easier
int remove=end+1-start; int remove=end+1-start;
ret=new Object[m_data.Length-remove]; ret=new Object[Data.Length-remove];
if (ret.Length == 0) if (ret.Length == 0)
return new list(ret); return new list(ret);
int src; int src;
int dest=0; int dest=0;
for (src = 0; src < m_data.Length; src++) for (src = 0; src < Data.Length; src++)
{ {
if (src < start || src > end) if (src < start || src > end)
ret[dest++]=m_data[src]; ret[dest++]=Data[src];
} }
return new list(ret); return new list(ret);
@ -860,12 +860,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
if (start < 0) if (start < 0)
{ {
start = m_data.Length + start; start = Data.Length + start;
} }
if (end < 0) if (end < 0)
{ {
end = m_data.Length + end; end = Data.Length + end;
} }
// The conventional case is start <= end // The conventional case is start <= end
@ -879,15 +879,15 @@ namespace OpenSim.Region.ScriptEngine.Shared
// Start sublist beyond length // Start sublist beyond length
// Also deals with start AND end still negative // Also deals with start AND end still negative
if (start >= m_data.Length || end < 0) if (start >= Data.Length || end < 0)
{ {
return new list(); return new list();
} }
// Sublist extends beyond the end of the supplied list // Sublist extends beyond the end of the supplied list
if (end >= m_data.Length) if (end >= Data.Length)
{ {
end = m_data.Length - 1; end = Data.Length - 1;
} }
// Sublist still starts before the beginning of the list // Sublist still starts before the beginning of the list
@ -898,7 +898,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
ret = new object[end - start + 1]; ret = new object[end - start + 1];
Array.Copy(m_data, start, ret, 0, end - start + 1); Array.Copy(Data, start, ret, 0, end - start + 1);
return new list(ret); return new list(ret);
@ -931,7 +931,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
// If start is outside of list, then just return // If start is outside of list, then just return
// the prefix, whatever it is. // the prefix, whatever it is.
if (start >= m_data.Length) if (start >= Data.Length)
{ {
return result; return result;
} }
@ -1109,11 +1109,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
{ {
string output; string output;
output = String.Empty; output = String.Empty;
if (m_data.Length == 0) if (Data.Length == 0)
{ {
return String.Empty; return String.Empty;
} }
foreach (object o in m_data) foreach (object o in Data)
{ {
output = output + o.ToString(); output = output + o.ToString();
} }
@ -1308,12 +1308,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
public string ToPrettyString() public string ToPrettyString()
{ {
string output; string output;
if (m_data.Length == 0) if (Data.Length == 0)
{ {
return "[]"; return "[]";
} }
output = "["; output = "[";
foreach (object o in m_data) foreach (object o in Data)
{ {
if (o is String) if (o is String)
{ {