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

prioritization
John Hurliman 2009-10-19 15:19:37 -07:00
commit bd03cbd815
16 changed files with 86 additions and 68 deletions

View File

@ -119,7 +119,7 @@ namespace OpenSim.Data.MSSQL
updateBuilder.AppendFormat("{0} = @{0}",field); updateBuilder.AppendFormat("{0} = @{0}",field);
first = false; first = false;
cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field])); cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field]));
} }
updateBuilder.Append(" where UUID = @principalID"); updateBuilder.Append(" where UUID = @principalID");
@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL
insertBuilder.AppendFormat("insert into {0} (UUID, ", m_Realm); insertBuilder.AppendFormat("insert into {0} (UUID, ", m_Realm);
insertBuilder.Append(String.Join(", ", fields)); insertBuilder.Append(String.Join(", ", fields));
insertBuilder.Append(") values ( @principalID, @"); insertBuilder.Append(") values (@principalID, @");
insertBuilder.Append(String.Join(", @", fields)); insertBuilder.Append(String.Join(", @", fields));
insertBuilder.Append(")"); insertBuilder.Append(")");

View File

@ -146,7 +146,7 @@ namespace OpenSim.Data.MSSQL
sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID); sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID);
sceneObjectPart.UUID = groupID; sceneObjectPart.UUID = groupID;
} }
grp = new SceneObjectGroup(sceneObjectPart); grp = new SceneObjectGroup(sceneObjectPart);
} }

View File

@ -62,7 +62,7 @@ namespace OpenSim.Data.MSSQL
conn.Open(); conn.Open();
Migration m = new Migration(conn, GetType().Assembly, "GridStore"); Migration m = new Migration(conn, GetType().Assembly, "GridStore");
m.Update(); m.Update();
} }
} }
public List<RegionData> Get(string regionName, UUID scopeID) public List<RegionData> Get(string regionName, UUID scopeID)
@ -98,7 +98,7 @@ namespace OpenSim.Data.MSSQL
return null; return null;
return ret[0]; return ret[0];
} }
} }
public RegionData Get(UUID regionID, UUID scopeID) public RegionData Get(UUID regionID, UUID scopeID)
@ -251,7 +251,7 @@ namespace OpenSim.Data.MSSQL
{ {
string insert = "insert into [" + m_Realm + "] ([uuid], [ScopeID], [locX], [locY], [sizeX], [sizeY], [regionName], [" + string insert = "insert into [" + m_Realm + "] ([uuid], [ScopeID], [locX], [locY], [sizeX], [sizeY], [regionName], [" +
String.Join("], [", fields) + String.Join("], [", fields) +
"]) values ( @regionID, @scopeID, @posX, @posY, @sizeX, @sizeY, @regionName, @" + String.Join(", @", fields) + ")"; "]) values (@regionID, @scopeID, @posX, @posY, @sizeX, @sizeY, @regionName, @" + String.Join(", @", fields) + ")";
cmd.CommandText = insert; cmd.CommandText = insert;

View File

@ -54,7 +54,7 @@ namespace OpenSim.Data.MSSQL
conn.Open(); conn.Open();
Migration m = new Migration(conn, GetType().Assembly, "UserStore"); Migration m = new Migration(conn, GetType().Assembly, "UserStore");
m.Update(); m.Update();
} }
} }
public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query) public List<UserAccountData> Query(UUID principalID, UUID scopeID, string query)
@ -134,7 +134,7 @@ namespace OpenSim.Data.MSSQL
updateBuilder.AppendFormat("{0} = @{0}", field); updateBuilder.AppendFormat("{0} = @{0}", field);
first = false; first = false;
cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field])); cmd.Parameters.Add(m_database.CreateParameter("@" + field, data.Data[field]));
} }
updateBuilder.Append(" where UUID = @principalID"); updateBuilder.Append(" where UUID = @principalID");
@ -153,7 +153,7 @@ namespace OpenSim.Data.MSSQL
StringBuilder insertBuilder = new StringBuilder(); StringBuilder insertBuilder = new StringBuilder();
insertBuilder.AppendFormat("insert into {0} (UUID, ScopeID, ", m_Realm); insertBuilder.AppendFormat("insert into {0} (UUID, ScopeID, ", m_Realm);
insertBuilder.Append(String.Join(", ", fields)); insertBuilder.Append(String.Join(", ", fields));
insertBuilder.Append(") values ( @principalID, @scopeID, @"); insertBuilder.Append(") values (@principalID, @scopeID, @");
insertBuilder.Append(String.Join(", @", fields)); insertBuilder.Append(String.Join(", @", fields));
insertBuilder.Append(")"); insertBuilder.Append(")");

View File

@ -67,8 +67,8 @@ namespace OpenSim.Framework
return m_pqueue.Dequeue(); return m_pqueue.Dequeue();
if (m_queue.Count > 0) if (m_queue.Count > 0)
return m_queue.Dequeue(); return m_queue.Dequeue();
return default(T); return default(T);
} }
} }
@ -121,7 +121,7 @@ namespace OpenSim.Framework
{ {
m_pqueue.Clear(); m_pqueue.Clear();
m_queue.Clear(); m_queue.Clear();
Monitor.Pulse(m_queueSync); Monitor.Pulse(m_queueSync);
} }
} }
} }

View File

@ -41,7 +41,7 @@ namespace OpenSim.Framework.Serialization.External
public class LandDataSerializer public class LandDataSerializer
{ {
protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
/// <summary> /// <summary>
/// Reify/deserialize landData /// Reify/deserialize landData
/// </summary> /// </summary>
@ -52,7 +52,7 @@ namespace OpenSim.Framework.Serialization.External
{ {
return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length));
} }
/// <summary> /// <summary>
/// Reify/deserialize landData /// Reify/deserialize landData
/// </summary> /// </summary>
@ -62,10 +62,10 @@ namespace OpenSim.Framework.Serialization.External
public static LandData Deserialize(string serializedLandData) public static LandData Deserialize(string serializedLandData)
{ {
LandData landData = new LandData(); LandData landData = new LandData();
StringReader sr = new StringReader(serializedLandData); StringReader sr = new StringReader(serializedLandData);
XmlTextReader xtr = new XmlTextReader(sr); XmlTextReader xtr = new XmlTextReader(sr);
xtr.ReadStartElement("LandData"); xtr.ReadStartElement("LandData");
landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); landData.Area = Convert.ToInt32( xtr.ReadElementString("Area"));
@ -106,7 +106,7 @@ namespace OpenSim.Framework.Serialization.External
pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time"));
pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList"));
xtr.ReadEndElement(); xtr.ReadEndElement();
landData.ParcelAccessList.Add(pae); landData.ParcelAccessList.Add(pae);
} }
} }
@ -122,13 +122,13 @@ namespace OpenSim.Framework.Serialization.External
landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime"));
xtr.ReadEndElement(); xtr.ReadEndElement();
xtr.Close(); xtr.Close();
sr.Close(); sr.Close();
return landData; return landData;
} }
public static string Serialize(LandData landData) public static string Serialize(LandData landData)
{ {
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
@ -137,8 +137,8 @@ namespace OpenSim.Framework.Serialization.External
xtw.WriteStartDocument(); xtw.WriteStartDocument();
xtw.WriteStartElement("LandData"); xtw.WriteStartElement("LandData");
xtw.WriteElementString("Area", Convert.ToString(landData.Area)); xtw.WriteElementString("Area", Convert.ToString(landData.Area));
xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID));
xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString());
xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category));
@ -170,7 +170,7 @@ namespace OpenSim.Framework.Serialization.External
xtw.WriteEndElement(); xtw.WriteEndElement();
} }
xtw.WriteEndElement(); xtw.WriteEndElement();
xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours));
xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice));
xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice));
@ -184,7 +184,7 @@ namespace OpenSim.Framework.Serialization.External
xtw.Close(); xtw.Close();
sw.Close(); sw.Close();
return sw.ToString(); return sw.ToString();
} }
} }

View File

@ -246,7 +246,7 @@ namespace OpenSim.Framework.Servers
foreach (ProcessThread t in threads) foreach (ProcessThread t in threads)
{ {
sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " +
(DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState ); (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState);
if (t.ThreadState == System.Diagnostics.ThreadState.Wait) if (t.ThreadState == System.Diagnostics.ThreadState.Wait)
sb.Append(", Reason: " + t.WaitReason + Environment.NewLine); sb.Append(", Reason: " + t.WaitReason + Environment.NewLine);
else else

View File

@ -730,7 +730,7 @@ namespace Flotsam.RegionModules.AssetCache
int fileCount = GetFileCacheCount(m_CacheDirectory); int fileCount = GetFileCacheCount(m_CacheDirectory);
m_log.InfoFormat("[FLOTSAM ASSET CACHE] File Cache : {0} assets", fileCount); m_log.InfoFormat("[FLOTSAM ASSET CACHE] File Cache : {0} assets", fileCount);
foreach ( string s in Directory.GetFiles(m_CacheDirectory, "*.fac" ) ) foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac"))
{ {
m_log.Info("[FLOTSAM ASSET CACHE] Deep Scans were performed on the following regions:"); m_log.Info("[FLOTSAM ASSET CACHE] Deep Scans were performed on the following regions:");
@ -770,7 +770,7 @@ namespace Flotsam.RegionModules.AssetCache
int assetsCached = CacheScenes(); int assetsCached = CacheScenes();
m_log.InfoFormat("[FLOTSAM ASSET CACHE] Completed Scene Caching, {0} assets found.", assetsCached); m_log.InfoFormat("[FLOTSAM ASSET CACHE] Completed Scene Caching, {0} assets found.", assetsCached);
}); });
break; break;

View File

@ -1152,13 +1152,13 @@ namespace OpenSim.Region.Framework.Scenes
public void AddGroupTarget(SceneObjectGroup grp) public void AddGroupTarget(SceneObjectGroup grp)
{ {
lock(m_groupsWithTargets) lock (m_groupsWithTargets)
m_groupsWithTargets[grp.UUID] = grp; m_groupsWithTargets[grp.UUID] = grp;
} }
public void RemoveGroupTarget(SceneObjectGroup grp) public void RemoveGroupTarget(SceneObjectGroup grp)
{ {
lock(m_groupsWithTargets) lock (m_groupsWithTargets)
m_groupsWithTargets.Remove(grp.UUID); m_groupsWithTargets.Remove(grp.UUID);
} }

View File

@ -48,7 +48,7 @@ namespace OpenSim.Region.Physics.Manager
int[] getIndexListAsIntLocked(); int[] getIndexListAsIntLocked();
float[] getVertexListAsFloatLocked(); float[] getVertexListAsFloatLocked();
void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount); void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount);
void getVertexListAsPtrToFloatArray( out IntPtr vertexList, out int vertexStride, out int vertexCount ); void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount);
void releaseSourceMeshData(); void releaseSourceMeshData();
void releasePinned(); void releasePinned();
void Append(IMesh newMesh); void Append(IMesh newMesh);

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.Meshing
throw new NotSupportedException("Attempt to Add to a pinned Mesh"); throw new NotSupportedException("Attempt to Add to a pinned Mesh");
// If a vertex of the triangle is not yet in the vertices list, // If a vertex of the triangle is not yet in the vertices list,
// add it and set its index to the current index count // add it and set its index to the current index count
if( !m_vertices.ContainsKey(triangle.v1) ) if (!m_vertices.ContainsKey(triangle.v1))
m_vertices[triangle.v1] = m_vertices.Count; m_vertices[triangle.v1] = m_vertices.Count;
if (!m_vertices.ContainsKey(triangle.v2)) if (!m_vertices.ContainsKey(triangle.v2))
m_vertices[triangle.v2] = m_vertices.Count; m_vertices[triangle.v2] = m_vertices.Count;
@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.Meshing
private float[] getVertexListAsFloat() private float[] getVertexListAsFloat()
{ {
if(m_vertices == null) if (m_vertices == null)
throw new NotSupportedException(); throw new NotSupportedException();
float[] result = new float[m_vertices.Count * 3]; float[] result = new float[m_vertices.Count * 3];
foreach (KeyValuePair<Vertex, int> kvp in m_vertices) foreach (KeyValuePair<Vertex, int> kvp in m_vertices)
@ -169,7 +169,7 @@ namespace OpenSim.Region.Physics.Meshing
public float[] getVertexListAsFloatLocked() public float[] getVertexListAsFloatLocked()
{ {
if( m_pinnedVertexes.IsAllocated ) if (m_pinnedVertexes.IsAllocated)
return (float[])(m_pinnedVertexes.Target); return (float[])(m_pinnedVertexes.Target);
float[] result = getVertexListAsFloat(); float[] result = getVertexListAsFloat();

View File

@ -816,8 +816,8 @@ namespace OpenSim.Region.Physics.OdePlugin
IntPtr vertices, indices; IntPtr vertices, indices;
int vertexCount, indexCount; int vertexCount, indexCount;
int vertexStride, triStride; int vertexStride, triStride;
mesh.getVertexListAsPtrToFloatArray( out vertices, out vertexStride, out vertexCount ); // Note, that vertices are fixed in unmanaged heap mesh.getVertexListAsPtrToFloatArray(out vertices, out vertexStride, out vertexCount); // Note, that vertices are fixed in unmanaged heap
mesh.getIndexListAsPtrToIntArray( out indices, out triStride, out indexCount ); // Also fixed, needs release after usage mesh.getIndexListAsPtrToIntArray(out indices, out triStride, out indexCount); // Also fixed, needs release after usage
mesh.releaseSourceMeshData(); // free up the original mesh data to save memory mesh.releaseSourceMeshData(); // free up the original mesh data to save memory

View File

@ -3805,7 +3805,7 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
public void start(int unused) public void start(int unused)
{ {
ds.SetViewpoint(ref xyz, ref hpr); ds.SetViewpoint(ref xyz, ref hpr);
} }
#endif #endif

View File

@ -353,15 +353,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
// m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml);
} }
} }
else // else
{ // {
ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); // ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
if (presence != null && (!postOnRez)) // if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); // presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
// // m_log.ErrorFormat("[Script] Unable to load script state, file not found"); // }
}
} }
public void Init() public void Init()

View File

@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (warnings != null && warnings.Length != 0) if (warnings != null && warnings.Length != 0)
{ {
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false);
foreach (string warning in warnings) foreach (string warning in warnings)
{ {
try try
@ -615,10 +612,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string text = "Warning:\n" + warning; string text = "Warning:\n" + warning;
if (text.Length > 1000) if (text.Length > 1000)
text = text.Substring(0, 1000); text = text.Substring(0, 1000);
World.SimChat(Utils.StringToBytes(text), if (!ShowScriptSaveResponse(item.OwnerID,
ChatTypeEnum.DebugChannel, 2147483647, assetID, text, true))
part.AbsolutePosition, {
part.Name, part.UUID, false); if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false);
World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition,
part.Name, part.UUID, false);
}
} }
catch (Exception e2) // LEGIT: User Scripting catch (Exception e2) // LEGIT: User Scripting
{ {
@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
catch (Exception e) catch (Exception e)
{ {
if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
try try
{ {
// DISPLAY ERROR INWORLD // DISPLAY ERROR INWORLD
@ -645,10 +647,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString();
if (text.Length > 1000) if (text.Length > 1000)
text = text.Substring(0, 1000); text = text.Substring(0, 1000);
World.SimChat(Utils.StringToBytes(text), if (!ShowScriptSaveResponse(item.OwnerID,
ChatTypeEnum.DebugChannel, 2147483647, assetID, text, false))
part.AbsolutePosition, {
part.Name, part.UUID, false); if (presence != null && (!postOnRez))
presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.DebugChannel, 2147483647,
part.AbsolutePosition,
part.Name, part.UUID, false);
}
} }
catch (Exception e2) // LEGIT: User Scripting catch (Exception e2) // LEGIT: User Scripting
{ {
@ -732,6 +740,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
if (presence != null)
{
ShowScriptSaveResponse(item.OwnerID,
assetID, "Compile successful", true);
}
instance.AppDomain = appDomain; instance.AppDomain = appDomain;
instance.LineMap = linemap; instance.LineMap = linemap;
@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return instance.CanBeDeleted(); return instance.CanBeDeleted();
} }
private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
{
return false;
}
} }
} }

View File

@ -46,14 +46,14 @@ namespace OpenSim.Tests.Common.Mock
m_scene = scene; m_scene = scene;
} }
public List<ILandObject> ParcelsNearPoint(Vector3 position) public List<ILandObject> ParcelsNearPoint(Vector3 position)
{ {
return new List<ILandObject>(); return new List<ILandObject>();
} }
public List<ILandObject> AllParcels() public List<ILandObject> AllParcels()
{ {
return new List<ILandObject>(); return new List<ILandObject>();
} }
protected ILandObject GetNoLand() protected ILandObject GetNoLand()
@ -63,18 +63,18 @@ namespace OpenSim.Tests.Common.Mock
return obj; return obj;
} }
public ILandObject GetLandObject(int x, int y) public ILandObject GetLandObject(int x, int y)
{ {
return GetNoLand(); return GetNoLand();
} }
public ILandObject GetLandObject(int localID) public ILandObject GetLandObject(int localID)
{ {
return GetNoLand(); return GetNoLand();
} }
public ILandObject GetLandObject(float x, float y) public ILandObject GetLandObject(float x, float y)
{ {
return GetNoLand(); return GetNoLand();
} }