mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge commit 'e742cffe15d3e50841908d7babc2e4c4a7630635' into bigmerge
Conflicts: OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
This commit is contained in:
@@ -442,7 +442,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
string path = request.RawUrl;
|
||||
string handlerKey = GetHandlerKey(request.HttpMethod, path);
|
||||
|
||||
//m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
|
||||
// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
|
||||
|
||||
if (TryGetStreamHandler(handlerKey, out requestHandler))
|
||||
{
|
||||
|
||||
@@ -49,25 +49,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
private Scene m_scene;
|
||||
private IDialogModule m_dialogModule;
|
||||
|
||||
/// <summary>
|
||||
/// Are attachments enabled?
|
||||
/// </summary>
|
||||
public bool Enabled { get; private set; }
|
||||
|
||||
public string Name { get { return "Attachments Module"; } }
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void Initialise(IConfigSource source) {}
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig config = source.Configs["Attachments"];
|
||||
if (config != null)
|
||||
Enabled = config.GetBoolean("Enabled", true);
|
||||
else
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
|
||||
if (Enabled)
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
|
||||
// TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
|
||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
|
||||
if (Enabled)
|
||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene) {}
|
||||
@@ -103,6 +120,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
/// </summary>
|
||||
public void RezAttachments(IScenePresence sp)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
if (null == sp.Appearance)
|
||||
{
|
||||
m_log.WarnFormat("[ATTACHMENTS MODULE]: Appearance has not been initialized for agent {0}", sp.UUID);
|
||||
@@ -146,6 +166,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);
|
||||
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
||||
{
|
||||
// if (grp.HasGroupChanged) // Resizer scripts?
|
||||
@@ -164,6 +187,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
// "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}",
|
||||
// m_scene.RegionInfo.RegionName, sp.Name, silent);
|
||||
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
foreach (SceneObjectGroup sop in sp.GetAttachments())
|
||||
{
|
||||
sop.Scene.DeleteSceneObject(sop, silent);
|
||||
@@ -185,6 +211,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
// "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})",
|
||||
// objectLocalID, remoteClient.Name, AttachmentPt, silent);
|
||||
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
|
||||
@@ -240,6 +269,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public bool AttachObject(IClientAPI remoteClient, SceneObjectGroup group, uint AttachmentPt, bool silent)
|
||||
{
|
||||
if (!Enabled)
|
||||
return false;
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
|
||||
|
||||
if (sp == null)
|
||||
@@ -339,6 +371,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
|
||||
RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
|
||||
|
||||
if (sp == null)
|
||||
@@ -368,6 +403,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
public ISceneEntity RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
|
||||
{
|
||||
if (!Enabled)
|
||||
return null;
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
|
||||
|
||||
if (sp == null)
|
||||
@@ -383,6 +421,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public ISceneEntity RezSingleAttachmentFromInventory(ScenePresence sp, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
if (!Enabled)
|
||||
return null;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: RezSingleAttachmentFromInventory to point {0} from item {1} for {2}",
|
||||
// (AttachmentPoint)AttachmentPt, itemID, sp.Name);
|
||||
@@ -570,6 +611,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
ScenePresence presence;
|
||||
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
@@ -589,6 +633,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public void DetachSingleAttachmentToGround(uint soLocalId, IClientAPI remoteClient)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: DetachSingleAttachmentToGround() for {0}, object {1}",
|
||||
// remoteClient.Name, soLocalId);
|
||||
@@ -704,6 +751,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
// First we save the
|
||||
// attachment point information, then we update the relative
|
||||
// positioning. Then we have to mark the object as NOT an
|
||||
@@ -917,4 +967,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user