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

cpu-performance
Diva Canto 2013-07-16 17:53:49 -07:00
commit 8bad56cb46
3 changed files with 12 additions and 6 deletions

View File

@ -74,10 +74,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
public void AddRegion(Scene scene) public void AddRegion(Scene scene)
{ {
m_scene = scene; m_scene = scene;
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
if (Enabled) if (Enabled)
{ {
// Only register module with scene if it is enabled. All callers check for a null attachments module.
// Ideally, there should be a null attachments module for when this core attachments module has been
// disabled. Registering only when enabled allows for other attachments module implementations.
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
m_scene.EventManager.OnNewClient += SubscribeToClientEvents; m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
m_scene.EventManager.OnStartScript += (localID, itemID) => HandleScriptStateChange(localID, true); m_scene.EventManager.OnStartScript += (localID, itemID) => HandleScriptStateChange(localID, true);
m_scene.EventManager.OnStopScript += (localID, itemID) => HandleScriptStateChange(localID, false); m_scene.EventManager.OnStopScript += (localID, itemID) => HandleScriptStateChange(localID, false);

View File

@ -116,7 +116,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
return false; return false;
// Delete existing npc attachments // Delete existing npc attachments
scene.AttachmentsModule.DeleteAttachmentsFromScene(npc, false); if(scene.AttachmentsModule != null)
scene.AttachmentsModule.DeleteAttachmentsFromScene(npc, false);
// XXX: We can't just use IAvatarFactoryModule.SetAppearance() yet // XXX: We can't just use IAvatarFactoryModule.SetAppearance() yet
// since it doesn't transfer attachments // since it doesn't transfer attachments
@ -125,7 +126,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
npc.Appearance = npcAppearance; npc.Appearance = npcAppearance;
// Rez needed npc attachments // Rez needed npc attachments
scene.AttachmentsModule.RezAttachments(npc); if (scene.AttachmentsModule != null)
scene.AttachmentsModule.RezAttachments(npc);
IAvatarFactoryModule module = IAvatarFactoryModule module =
scene.RequestModuleInterface<IAvatarFactoryModule>(); scene.RequestModuleInterface<IAvatarFactoryModule>();

View File

@ -51,7 +51,8 @@ namespace OpenSim.Region.RegionCombinerModule
m_virtScene.UnSubscribeToClientPrimEvents(client); m_virtScene.UnSubscribeToClientPrimEvents(client);
m_virtScene.UnSubscribeToClientPrimRezEvents(client); m_virtScene.UnSubscribeToClientPrimRezEvents(client);
m_virtScene.UnSubscribeToClientInventoryEvents(client); m_virtScene.UnSubscribeToClientInventoryEvents(client);
((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client); if(m_virtScene.AttachmentsModule != null)
((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client);
//m_virtScene.UnSubscribeToClientTeleportEvents(client); //m_virtScene.UnSubscribeToClientTeleportEvents(client);
m_virtScene.UnSubscribeToClientScriptEvents(client); m_virtScene.UnSubscribeToClientScriptEvents(client);
@ -66,7 +67,8 @@ namespace OpenSim.Region.RegionCombinerModule
client.OnRezObject += LocalRezObject; client.OnRezObject += LocalRezObject;
m_rootScene.SubscribeToClientInventoryEvents(client); m_rootScene.SubscribeToClientInventoryEvents(client);
((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client); if (m_rootScene.AttachmentsModule != null)
((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client);
//m_rootScene.SubscribeToClientTeleportEvents(client); //m_rootScene.SubscribeToClientTeleportEvents(client);
m_rootScene.SubscribeToClientScriptEvents(client); m_rootScene.SubscribeToClientScriptEvents(client);