* Tweak to region module loading to check for a matching constructor first instead of throwing and catching exceptions

* Commenting out the MySQL startup sequence that cleans out dropped attachments under the advice that it is no longer relevant. If anything, it could be brought back as a database cleanup console command
* Updated to the latest libomv 0.8.0-pre. UUID.TryParse() will no longer throw and catch exceptions for most failed UUID parses
0.6.8-post-fixes
John Hurliman 2009-10-27 01:46:14 -07:00
parent c75d415648
commit b498693cff
5 changed files with 29 additions and 23 deletions

View File

@ -341,14 +341,15 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
// Actually load it // Actually load it
INonSharedRegionModule module = null; INonSharedRegionModule module = null;
try
{ Type[] ctorParamTypes = new Type[ctorArgs.Length];
for (int i = 0; i < ctorParamTypes.Length; i++)
ctorParamTypes[i] = ctorArgs[i].GetType();
if (node.Type.GetConstructor(ctorParamTypes) != null)
module = (INonSharedRegionModule)Activator.CreateInstance(node.Type, ctorArgs); module = (INonSharedRegionModule)Activator.CreateInstance(node.Type, ctorArgs);
} else
catch
{
module = (INonSharedRegionModule)Activator.CreateInstance(node.Type); module = (INonSharedRegionModule)Activator.CreateInstance(node.Type);
}
// Check for replaceable interfaces // Check for replaceable interfaces
Type replaceableInterface = module.ReplaceableInterface; Type replaceableInterface = module.ReplaceableInterface;

View File

@ -66,22 +66,26 @@ namespace OpenSim.Data.MySQL
Migration m = new Migration(m_Connection, assem, "RegionStore"); Migration m = new Migration(m_Connection, assem, "RegionStore");
m.Update(); m.Update();
// NOTE: This is a very slow query that times out on regions with a lot of prims.
// I'm told that it is no longer relevant so it's commented out now, but if it
// is relevant it should be added as a console command instead of part of the
// startup phase
// Clean dropped attachments // Clean dropped attachments
// //
try //try
{ //{
using (MySqlCommand cmd = m_Connection.CreateCommand()) // using (MySqlCommand cmd = m_Connection.CreateCommand())
{ // {
cmd.CommandText = "delete from prims, primshapes using prims " + // cmd.CommandText = "delete from prims, primshapes using prims " +
"left join primshapes on prims.uuid = primshapes.uuid " + // "left join primshapes on prims.uuid = primshapes.uuid " +
"where PCode = 9 and State <> 0"; // "where PCode = 9 and State <> 0";
ExecuteNonQuery(cmd); // ExecuteNonQuery(cmd);
} // }
} //}
catch (MySqlException ex) //catch (MySqlException ex)
{ //{
m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); // m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
} //}
} }
private IDataReader ExecuteReader(MySqlCommand c) private IDataReader ExecuteReader(MySqlCommand c)

View File

@ -154,7 +154,7 @@ namespace pCampBot
client.Network.OnConnected += new NetworkManager.ConnectedCallback(this.Network_OnConnected); client.Network.OnConnected += new NetworkManager.ConnectedCallback(this.Network_OnConnected);
client.Network.OnSimConnected += new NetworkManager.SimConnectedCallback(this.Network_OnConnected); client.Network.OnSimConnected += new NetworkManager.SimConnectedCallback(this.Network_OnConnected);
client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(this.Network_OnDisconnected); client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(this.Network_OnDisconnected);
client.Objects.OnNewPrim += Objects_NewPrim; client.Objects.ObjectUpdate += Objects_NewPrim;
//client.Assets.OnAssetReceived += Asset_ReceivedCallback; //client.Assets.OnAssetReceived += Asset_ReceivedCallback;
if (client.Network.Login(firstname, lastname, password, "pCampBot", "Your name")) if (client.Network.Login(firstname, lastname, password, "pCampBot", "Your name"))
{ {
@ -369,8 +369,10 @@ namespace pCampBot
} }
} }
public void Objects_NewPrim(Simulator simulator, Primitive prim, ulong regionHandle, ushort timeDilation) public void Objects_NewPrim(object sender, PrimEventArgs args)
{ {
Primitive prim = args.Prim;
if (prim != null) if (prim != null)
{ {
if (prim.Textures != null) if (prim.Textures != null)
@ -396,7 +398,6 @@ namespace pCampBot
client.Assets.RequestImage(prim.Sculpt.SculptTexture, ImageType.Normal, Asset_TextureCallback_Texture); client.Assets.RequestImage(prim.Sculpt.SculptTexture, ImageType.Normal, Asset_TextureCallback_Texture);
} }
} }
} }

Binary file not shown.

Binary file not shown.