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

slimupdates
John Hurliman 2010-03-12 14:40:21 -08:00
commit 5beb08be31
6 changed files with 78 additions and 62 deletions

View File

@ -67,6 +67,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
get { return false; } get { return false; }
} }
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent)
{
m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
// If we can't take it, we can't attach it!
SceneObjectPart part = m_scene.GetSceneObjectPart(objectLocalID);
if (part == null)
return;
if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId))
return;
// Calls attach with a Zero position
if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false))
{
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
// Save avatar attachment information
ScenePresence presence;
if (m_scene.AvatarFactory != null && m_scene.TryGetAvatar(remoteClient.AgentId, out presence))
{
m_log.Info(
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
+ ", AttachmentPoint: " + AttachmentPt);
m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
}
}
public bool AttachObject( public bool AttachObject(
IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent)
{ {
@ -143,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
{ {
m_log.DebugFormat( m_log.DebugFormat(
"[ATTACHMENTS MODULEY]: Updating inventory of {0} to show attachment of {1} (item ID {2})", "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
remoteClient.Name, att.Name, itemID); remoteClient.Name, att.Name, itemID);
if (!att.IsDeleted) if (!att.IsDeleted)

View File

@ -56,6 +56,9 @@
<RegionModule id="RemotePresenceServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.RemotePresenceServicesConnector" /> <RegionModule id="RemotePresenceServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.RemotePresenceServicesConnector" />
<RegionModule id="LocalUserAccountServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts.LocalUserAccountServicesConnector" /> <RegionModule id="LocalUserAccountServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts.LocalUserAccountServicesConnector" />
<RegionModule id="RemoteUserAccountServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts.RemoteUserAccountServicesConnector" /> <RegionModule id="RemoteUserAccountServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts.RemoteUserAccountServicesConnector" />
<RegionModule id="LocalGridUserServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser.LocalGridUserServicesConnector" />
<RegionModule id="LocalSimulationConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation.LocalSimulationConnectorModule" /> <RegionModule id="LocalSimulationConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation.LocalSimulationConnectorModule" />
<RegionModule id="RemoteSimulationConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation.RemoteSimulationConnectorModule" /> <RegionModule id="RemoteSimulationConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation.RemoteSimulationConnectorModule" />
<!-- Service connectors IN modules --> <!-- Service connectors IN modules -->

View File

@ -34,6 +34,17 @@ namespace OpenSim.Region.Framework.Interfaces
{ {
public interface IAttachmentsModule public interface IAttachmentsModule
{ {
/// <summary>
/// Attach an object to an avatar from the world.
/// </summary>
/// <param name="controllingClient"></param>
/// <param name="localID"></param>
/// <param name="attachPoint"></param>
/// <param name="rot"></param>
/// <param name="silent"></param>
void AttachObject(
IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent);
/// <summary> /// <summary>
/// Attach an object to an avatar. /// Attach an object to an avatar.
/// </summary> /// </summary>
@ -41,11 +52,11 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="localID"></param> /// <param name="localID"></param>
/// <param name="attachPoint"></param> /// <param name="attachPoint"></param>
/// <param name="rot"></param> /// <param name="rot"></param>
/// <param name="pos"></param> /// <param name="attachPos"></param>
/// <param name="silent"></param> /// <param name="silent"></param>
/// <returns>true if the object was successfully attached, false otherwise</returns> /// <returns>true if the object was successfully attached, false otherwise</returns>
bool AttachObject( bool AttachObject(
IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent); IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent);
/// <summary> /// <summary>
/// Update the user inventory to the attachment of an item /// Update the user inventory to the attachment of an item

View File

@ -2644,12 +2644,14 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
{ {
client.OnRezSingleAttachmentFromInv += RezSingleAttachment; client.OnRezSingleAttachmentFromInv += RezSingleAttachment;
client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments;
client.OnObjectAttach += m_sceneGraph.AttachObject;
client.OnObjectDetach += m_sceneGraph.DetachObject; client.OnObjectDetach += m_sceneGraph.DetachObject;
if (AttachmentsModule != null) if (AttachmentsModule != null)
{
client.OnObjectAttach += AttachmentsModule.AttachObject;
client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
}
} }
public virtual void SubscribeToClientTeleportEvents(IClientAPI client) public virtual void SubscribeToClientTeleportEvents(IClientAPI client)
@ -2774,7 +2776,6 @@ namespace OpenSim.Region.Framework.Scenes
client.OnRezObject -= RezObject; client.OnRezObject -= RezObject;
} }
public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client) public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client)
{ {
client.OnCreateNewInventoryItem -= CreateNewInventoryItem; client.OnCreateNewInventoryItem -= CreateNewInventoryItem;
@ -2799,12 +2800,14 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
{ {
client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments;
client.OnRezSingleAttachmentFromInv -= RezSingleAttachment; client.OnRezSingleAttachmentFromInv -= RezSingleAttachment;
client.OnObjectAttach -= m_sceneGraph.AttachObject;
client.OnObjectDetach -= m_sceneGraph.DetachObject; client.OnObjectDetach -= m_sceneGraph.DetachObject;
if (AttachmentsModule != null) if (AttachmentsModule != null)
{
client.OnObjectAttach -= AttachmentsModule.AttachObject;
client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
}
} }
public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client) public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client)

View File

@ -486,41 +486,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
/// <summary>
/// Event Handling routine for Attach Object
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="objectLocalID"></param>
/// <param name="AttachmentPt"></param>
/// <param name="rot"></param>
protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent)
{
// If we can't take it, we can't attach it!
SceneObjectPart part = m_parentScene.GetSceneObjectPart(objectLocalID);
if (part == null)
return;
if (!m_parentScene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId))
return;
// Calls attach with a Zero position
if (m_parentScene.AttachmentsModule.AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false))
{
m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
// Save avatar attachment information
ScenePresence presence;
if (m_parentScene.AvatarFactory != null && m_parentScene.TryGetAvatar(remoteClient.AgentId, out presence))
{
m_log.Info(
"[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
+ ", AttachmentPoint: " + AttachmentPt);
m_parentScene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
}
}
/// <summary> /// <summary>
/// Rez an attachment /// Rez an attachment
/// </summary> /// </summary>

View File

@ -5,17 +5,18 @@
;; ;;
[Modules] [Modules]
AssetServices = "LocalAssetServicesConnector" AssetServices = "LocalAssetServicesConnector"
InventoryServices = "LocalInventoryServicesConnector" InventoryServices = "LocalInventoryServicesConnector"
NeighbourServices = "LocalNeighbourServicesConnector" NeighbourServices = "LocalNeighbourServicesConnector"
AuthenticationServices = "LocalAuthenticationServicesConnector" AuthenticationServices = "LocalAuthenticationServicesConnector"
GridServices = "LocalGridServicesConnector" GridServices = "LocalGridServicesConnector"
PresenceServices = "LocalPresenceServicesConnector" PresenceServices = "LocalPresenceServicesConnector"
UserAccountServices = "LocalUserAccountServicesConnector" UserAccountServices = "LocalUserAccountServicesConnector"
SimulationServices = "LocalSimulationConnectorModule" GridUserServices = "LocalGridUserServicesConnector"
AvatarServices = "LocalAvatarServicesConnector" SimulationServices = "LocalSimulationConnectorModule"
EntityTransferModule = "BasicEntityTransferModule" AvatarServices = "LocalAvatarServicesConnector"
InventoryAccessModule = "BasicInventoryAccessModule" EntityTransferModule = "BasicEntityTransferModule"
InventoryAccessModule = "BasicInventoryAccessModule"
LibraryModule = true LibraryModule = true
LLLoginServiceInConnector = true LLLoginServiceInConnector = true
@ -57,6 +58,9 @@
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService"
[GridUserService]
LocalServiceModule = "OpenSim.Services.UserAccountService.dll:GridUserService"
[FriendsService] [FriendsService]
LocalServiceModule = "OpenSim.Services.FriendsService.dll" LocalServiceModule = "OpenSim.Services.FriendsService.dll"
@ -64,14 +68,14 @@
Connector = "OpenSim.Services.FriendsService.dll" Connector = "OpenSim.Services.FriendsService.dll"
[LoginService] [LoginService]
LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService" LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService"
UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService"
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService" AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService"
FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService" FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService"
WelcomeMessage = "Welcome, Avatar!" WelcomeMessage = "Welcome, Avatar!"