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)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
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.OnStartScript += (localID, itemID) => HandleScriptStateChange(localID, true);
m_scene.EventManager.OnStopScript += (localID, itemID) => HandleScriptStateChange(localID, false);

View File

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

View File

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