From 61d49d4f63eafa68d0b63877029da3475d977263 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Aug 2011 23:20:36 +0100 Subject: rename NPC.Autopilot to NPC.MoveToTarget internally. Add method doc to INPCModule --- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 32 ++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 21a755f..fa8d6b6 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -32,9 +32,39 @@ namespace OpenSim.Region.Framework.Interfaces { public interface INPCModule { + /// + /// Create an NPC + /// + /// + /// + /// + /// + /// The UUID of the avatar from which to clone the NPC's appearance from. + /// The UUID of the ScenePresence created. UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); - void Autopilot(UUID agentID, Scene scene, Vector3 pos); + + /// + /// Move an NPC to a target over time. + /// + /// The UUID of the NPC + /// + /// + void MoveToTarget(UUID agentID, Scene scene, Vector3 pos); + + /// + /// Get the NPC to say something. + /// + /// The UUID of the NPC + /// + /// void Say(UUID agentID, Scene scene, string text); + + + /// + /// Delete an NPC. + /// + /// The UUID of the NPC + /// void DeleteNPC(UUID agentID, Scene scene); } } \ No newline at end of file -- cgit v1.1 From e869eeb0bfc48c769f680970f99e4c67dd5a1a70 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 9 Aug 2011 03:51:34 +0100 Subject: Implement first draft functions for saving and loading NPC appearance from storage. This works by serializing and deserializing NPC AvatarAppearance to a notecard in the prim inventory and making the required baked textures permanent. By using notecards, we avoid lots of awkward, technical and user-unfriendly issues concerning retaining asset references and creating a new asset type. Notecards also allow different appearances to be swapped and manipulated easily. This also allows stored NPC appearances to work transparently with OARs/IARs since the UUID scan will pick up and store the necessary references from the notecard text. This works in my basic test but is not at all ready for user use or bug reporting yet. --- OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs | 8 ++++++++ OpenSim/Region/Framework/Interfaces/INPCModule.cs | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs index d0e5609..6817725 100644 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs +++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs @@ -32,6 +32,14 @@ namespace OpenSim.Region.Framework.Interfaces { public interface IAvatarFactory { + /// + /// Send the appearance of an avatar to others in the scene. + /// + /// + /// + bool SendAppearance(UUID agentId); + + bool SaveBakedTextures(UUID agentId); bool ValidateBakedTextureCache(IClientAPI client); void QueueAppearanceSend(UUID agentid); void QueueAppearanceSave(UUID agentid); diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index fa8d6b6..54575ca 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -26,6 +26,7 @@ */ using OpenMetaverse; +using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Framework.Interfaces @@ -44,6 +45,23 @@ namespace OpenSim.Region.Framework.Interfaces UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); /// + /// Check if the agent is an NPC. + /// + /// + /// + /// True if the agent is an NPC in the given scene. False otherwise. + bool IsNPC(UUID agentID, Scene scene); + + /// + /// Set the appearance for an NPC. + /// + /// + /// + /// + /// + bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene); + + /// /// Move an NPC to a target over time. /// /// The UUID of the NPC @@ -59,7 +77,6 @@ namespace OpenSim.Region.Framework.Interfaces /// void Say(UUID agentID, Scene scene, string text); - /// /// Delete an NPC. /// -- cgit v1.1 From 195c1dc9b8b8511980d9a607a242b24a5a91da17 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 00:26:38 +0100 Subject: implement osNpcStopMoveTo() to cancel any current move target --- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 54575ca..763d2dc 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - /// + /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene); /// @@ -67,7 +67,16 @@ namespace OpenSim.Region.Framework.Interfaces /// The UUID of the NPC /// /// - void MoveToTarget(UUID agentID, Scene scene, Vector3 pos); + /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC + bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos); + + /// + /// Stop the NPC's current movement. + /// + /// The UUID of the NPC + /// + /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC + bool StopMoveToTarget(UUID agentID, Scene scene); /// /// Get the NPC to say something. @@ -75,13 +84,15 @@ namespace OpenSim.Region.Framework.Interfaces /// The UUID of the NPC /// /// - void Say(UUID agentID, Scene scene, string text); + /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC + bool Say(UUID agentID, Scene scene, string text); /// /// Delete an NPC. /// /// The UUID of the NPC /// - void DeleteNPC(UUID agentID, Scene scene); + /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC + bool DeleteNPC(UUID agentID, Scene scene); } } \ No newline at end of file -- cgit v1.1 From 5d6c9644faf6aeac38410af9cff97adfef88d7aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 01:47:37 +0100 Subject: early code to allow scripts to force npcs not to fly when moving to target this is to allow walking on prims. it will be up to the script writer to be sure that there is a continuous path. currently implemented in osNpcMoveToTarget(), but none of this is final. --- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 763d2dc..06296c9 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -67,8 +67,12 @@ namespace OpenSim.Region.Framework.Interfaces /// The UUID of the NPC /// /// + /// + /// If true, then the avatar will attempt to walk to the location even if it's up in the air. + /// This is to allow walking on prims. + /// /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC - bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos); + bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly); /// /// Stop the NPC's current movement. -- cgit v1.1 From 7f499ff3f386d57bcd81ebb3f58f110011100604 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 23:56:19 +0100 Subject: Add a OS_NPC_LAND_AT_TARGET option to osMoveToTarget() Default for this function is now not to automatically land. This allows better control by scripts when an avatar is going to be landing on a prim rather than the ground. Stopping the avatar involves faking a collision, to avoid the pid controller making it overshoot. A better approach would be to gradually slow the avatar as we near the target --- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 06296c9..08b973d 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -71,8 +71,11 @@ namespace OpenSim.Region.Framework.Interfaces /// If true, then the avatar will attempt to walk to the location even if it's up in the air. /// This is to allow walking on prims. /// + /// + /// If true and the avatar is flying when it reaches the target, land. + /// /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC - bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly); + bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget); /// /// Stop the NPC's current movement. -- cgit v1.1 From 50945dd56029a1280c581ea9b29213ab0e162a0a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 11 Aug 2011 21:43:26 +0100 Subject: add regression test for osNpcCreate when cloning an in-region avatar --- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 08b973d..5e5c4a1 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -40,9 +40,9 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - /// The UUID of the avatar from which to clone the NPC's appearance from. + /// The avatar appearance to use for the new NPC. /// The UUID of the ScenePresence created. - UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); + UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, AvatarAppearance appearance); /// /// Check if the agent is an NPC. -- cgit v1.1 From acfdca34fd9bf6d66d144ae5c0a325dd5e864517 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 17 Aug 2011 01:35:33 +0100 Subject: Fix issue where loading a new appearance onto an NPC would not remove the previous attachments from the scene. Addresses http://opensimulator.org/mantis/view.php?id=5636 --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 6cc64c6..4cb3df2 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -96,9 +96,10 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Detach an object from the avatar. /// - /// + /// /// This method is called in response to a client's detach request, so we only update the information in /// inventory + /// /// /// void DetachObject(uint objectLocalID, IClientAPI remoteClient); -- cgit v1.1 From c9e6b7bd10b2cdaa917e41259ae0d612f2171f7a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 19 Aug 2011 00:45:22 +0100 Subject: Stop NPC's getting hypergrid like names in some circumstances. This meant punching in another AddUser() method in IUserManagement to do a direct name to UUID associated without the account check (since NPCs don't have accounts). May address http://opensimulator.org/mantis/view.php?id=5645 --- .../Region/Framework/Interfaces/IUserManagement.cs | 37 +++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs index 5d30aa8..c66e053 100644 --- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs +++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs @@ -5,13 +5,48 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { + /// + /// This maintains the relationship between a UUID and a user name. + /// public interface IUserManagement { string GetUserName(UUID uuid); string GetUserHomeURL(UUID uuid); string GetUserUUI(UUID uuid); string GetUserServerURL(UUID uuid, string serverType); - void AddUser(UUID uuid, string userData); + + /// + /// Add a user. + /// + /// + /// If an account is found for the UUID, then the names in this will be used rather than any information + /// extracted from creatorData. + /// + /// + /// The creator data for this user. + void AddUser(UUID uuid, string creatorData); + + /// + /// Add a user. + /// + /// + /// The UUID is related to the name without any other checks being performed, such as user account presence. + /// + /// + /// + /// + void AddUser(UUID uuid, string firstName, string lastName); + + /// + /// Add a user. + /// + /// + /// The arguments apart from uuid are formed into a creatorData string and processing proceeds as for the + /// AddUser(UUID uuid, string creatorData) method. + /// + /// + /// + /// void AddUser(UUID uuid, string firstName, string lastName, string profileURL); } } -- cgit v1.1 From 2787207aa287a60a3c7c06fad66d406180033ae2 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 19 Aug 2011 18:47:21 -0400 Subject: Add llRegionSayTo llRegionSayTo(key target, integer channel, string messasge) Allows messages to be sent region-wide to a particular prim. --- OpenSim/Region/Framework/Interfaces/IWorldComm.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index 8da99a0..8f200ae 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs @@ -81,6 +81,26 @@ namespace OpenSim.Region.Framework.Interfaces void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); /// + /// Delivers the message to a specified object in the region. + /// + /// + /// Target. + /// + /// + /// Channel. + /// + /// + /// Name. + /// + /// + /// Identifier. + /// + /// + /// Message. + /// + void DeliverMessageTo(UUID target, int channel, string name, UUID id, string msg); + + /// /// Are there any listen events ready to be dispatched? /// /// boolean indication -- cgit v1.1 From 5e231acdce7a006a4d88a205044d9862f7d4dda8 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 20 Aug 2011 12:36:35 -0400 Subject: Add avatar and attachments to llRegionSay llRegionSay will now message avatars on chan 0 and will message attachments on the avatar that listen on channels other than 0. This behavior is consistant with the LL implementation as tested on regions in Agni with one exception: this implementation does not include issue: https://jira.secondlife.com/browse/SCR-66? --- OpenSim/Region/Framework/Interfaces/IWorldComm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index 8f200ae..dafbf30 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs @@ -98,7 +98,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Message. /// - void DeliverMessageTo(UUID target, int channel, string name, UUID id, string msg); + bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error); /// /// Are there any listen events ready to be dispatched? -- cgit v1.1 From 7cf4bb5256be8e4b6a585e5128ccfc4b132bee04 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 22 Aug 2011 22:13:07 +0100 Subject: Add ISimulatorFeaturesModule so that other modules can register features in addition to the hardcoded ones. --- .../Interfaces/ISimulatorFeaturesModule.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs b/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs new file mode 100644 index 0000000..8cef14e --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/ISimulatorFeaturesModule.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using OpenMetaverse.StructuredData; + +namespace OpenSim.Region.Framework.Interfaces +{ + /// + /// Add remove or retrieve Simulator Features that will be given to a viewer via the SimulatorFeatures capability. + /// + public interface ISimulatorFeaturesModule + { + void AddFeature(string name, OSD value); + bool RemoveFeature(string name); + bool TryGetFeature(string name, out OSD value); + OSDMap GetFeatures(); + } +} \ No newline at end of file -- cgit v1.1 From d328046efbcd7449e0421f72138f48272f514481 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 22 Aug 2011 23:59:48 +0100 Subject: If an attachment fails, then start logging the exception for now, in order to help with the inconsistent state bug. This also refactors AttachmentsModules to stop pointlessly refetching the ScenePresence in various methods. However, more of this is required. --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 4cb3df2..e012885 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -49,11 +49,9 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Attach an object to an avatar. /// - /// - /// - /// - /// - /// + /// + /// + /// /// /// true if the object was successfully attached, false otherwise bool AttachObject( -- cgit v1.1 From 97b207240ee79abfec08d2dfaa9385211eb305c8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 23 Aug 2011 22:05:22 +0100 Subject: rename AttachmentsModule.ShowDetachInUserInventory() to DetachSingleAttachmentToInv() for consistency and to reflect it's actual behaviour --- .../Framework/Interfaces/IAttachmentsModule.cs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index e012885..0c82411 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Interfaces IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); /// - /// Attach an object to an avatar. + /// Attach an object to an avatar /// /// /// @@ -110,11 +110,11 @@ namespace OpenSim.Region.Framework.Interfaces void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient); /// - /// Update the user inventory to show a detach. + /// Detach the given item so that it remains in the user's inventory. /// /// /param> /// - void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); + void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient); /// /// Update the position of an attachment. @@ -126,18 +126,10 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Update the user inventory with a changed attachment /// - /// - /// A - /// - /// - /// A - /// - /// - /// A - /// - /// - /// A - /// + /// + /// + /// + /// void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID); } } -- cgit v1.1 From ae614c1264a2c4d06f019f2a91ad481cc2f96770 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Aug 2011 22:37:53 +0100 Subject: refactor: simplify DetachSingleAttachmentToGround() by retrieving the scene object group direct --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 0c82411..86f5a0f 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -105,9 +105,9 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Detach the given item to the ground. /// - /// + /// /// - void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient); + void DetachSingleAttachmentToGround(UUID sceneObjectID, IClientAPI remoteClient); /// /// Detach the given item so that it remains in the user's inventory. -- cgit v1.1 From be357f8feeb438e3292292d163918a307d69c69a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 01:58:32 +0100 Subject: Fix bug in persisting saved appearances for npcs Assets have to be marked non-local as well as non-temporary to persist. This is now done. Hopefully addresses http://opensimulator.org/mantis/view.php?id=5660 --- OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs index 6817725..4dbddf4 100644 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs +++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +40,23 @@ namespace OpenSim.Region.Framework.Interfaces /// bool SendAppearance(UUID agentId); + /// + /// Return the baked texture ids of the given agent. + /// + /// + /// An empty list if this agent has no baked textures (e.g. because it's a child agent) + Dictionary GetBakedTextureFaces(UUID agentId); + + /// + /// Save the baked textures for the given agent permanently in the asset database. + /// + /// + /// This is used to preserve apperance textures for NPCs + /// + /// + /// true if a valid agent was found, false otherwise bool SaveBakedTextures(UUID agentId); + bool ValidateBakedTextureCache(IClientAPI client); void QueueAppearanceSend(UUID agentid); void QueueAppearanceSave(UUID agentid); -- cgit v1.1 From 1de68b34d959570c6dc5de42e8dac5e36f960273 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 22:25:38 +0100 Subject: refactor: migrate DropObject handling fully into AttachmentsModule from Scene --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 86f5a0f..c910289 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// The scene object that was attached. Null if the scene object could not be found - UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt); + ISceneEntity RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt); /// /// Rez an attachment from user inventory @@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Interfaces /// False is required so that we don't attempt to update information when a user enters a scene with the /// attachment already correctly set up in inventory. /// The uuid of the scene object that was attached. Null if the scene object could not be found - UUID RezSingleAttachmentFromInventory( + ISceneEntity RezSingleAttachmentFromInventory( IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus); /// @@ -105,9 +105,9 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Detach the given item to the ground. /// - /// + /// /// - void DetachSingleAttachmentToGround(UUID sceneObjectID, IClientAPI remoteClient); + void DetachSingleAttachmentToGround(uint objectLocalID, IClientAPI remoteClient); /// /// Detach the given item so that it remains in the user's inventory. -- cgit v1.1 From 04bafd21221a789b83b039efd1c52e141944cde0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 23:05:43 +0100 Subject: refactor: Move ScenePresence.RezAttachments() into AttachmentsModule This adds an incomplete IScenePresence to match ISceneEntity --- .../Framework/Interfaces/IAttachmentsModule.cs | 6 +++ .../Region/Framework/Interfaces/IScenePresence.cs | 56 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/IScenePresence.cs (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index c910289..1833dce 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -36,6 +36,12 @@ namespace OpenSim.Region.Framework.Interfaces public interface IAttachmentsModule { /// + /// RezAttachments. This should only be called upon login on the first region. + /// Attachment rezzings on crossings and TPs are done in a different way. + /// + void RezAttachments(IScenePresence sp); + + /// /// Attach an object to an avatar from the world. /// /// diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs new file mode 100644 index 0000000..d700d79 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs @@ -0,0 +1,56 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using OpenSim.Framework; + +namespace OpenSim.Region.Framework.Interfaces +{ + /// + /// An agent in the scene. + /// + /// + /// Interface is a work in progress. Please feel free to add other required properties and methods. + /// + public interface IScenePresence : ISceneEntity + { + /// + /// The client controlling this presence + /// + IClientAPI ControllingClient { get; } + + /// + /// Avatar appearance data. + /// + /// + // Because appearance setting is in a module, we actually need + // to give it access to our appearance directly, otherwise we + // get a synchronization issue. + /// + AvatarAppearance Appearance { get; set; } + } +} \ No newline at end of file -- cgit v1.1 From ddc733cd3d940a4357eb0d235562050eb6f206bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 23:32:30 +0100 Subject: refactor: move SP.SaveChangedAttachments() fully into AttachmentsModule --- OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 6 ++++++ OpenSim/Region/Framework/Interfaces/IScenePresence.cs | 11 +++++++++++ 2 files changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 1833dce..ce795f1 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -42,6 +42,12 @@ namespace OpenSim.Region.Framework.Interfaces void RezAttachments(IScenePresence sp); /// + /// Save the attachments that have change on this presence. + /// + /// + void SaveChangedAttachments(IScenePresence sp); + + /// /// Attach an object to an avatar from the world. /// /// diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs index d700d79..b07c821 100644 --- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs @@ -26,7 +26,9 @@ */ using System; +using System.Collections.Generic; using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Framework.Interfaces { @@ -52,5 +54,14 @@ namespace OpenSim.Region.Framework.Interfaces // get a synchronization issue. /// AvatarAppearance Appearance { get; set; } + + /// + /// The scene objects attached to this avatar. + /// + /// + /// Do not change this list directly - use methods such as + /// AddAttachment() and RemoveAttachment(). Lock this list when performing any read operations upon it. + /// + List Attachments { get; } } } \ No newline at end of file -- cgit v1.1 From 32444d98cb13423fdf8c874e4fbb7ea17670d7c5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 31 Aug 2011 16:29:51 +0100 Subject: Make SP.Attachments available as sp.GetAttachments() instead. The approach here, as in other parts of OpenSim, is to return a copy of the list rather than the attachments list itself This prevents callers from forgetting to lock the list when they read it, as was happening in various parts of the codebase. It also improves liveness. This might improve attachment anomolies when performing region crossings. --- OpenSim/Region/Framework/Interfaces/IScenePresence.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs index b07c821..788b36f 100644 --- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs @@ -58,10 +58,13 @@ namespace OpenSim.Region.Framework.Interfaces /// /// The scene objects attached to this avatar. /// + /// + /// A copy of the list. + /// /// /// Do not change this list directly - use methods such as - /// AddAttachment() and RemoveAttachment(). Lock this list when performing any read operations upon it. + /// AddAttachment() and RemoveAttachment(). /// - List Attachments { get; } + List GetAttachments(); } } \ No newline at end of file -- cgit v1.1 From 7d58b5fa157b4c3e842573d9fb02a9822034f4b0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 31 Aug 2011 17:53:58 +0100 Subject: move common code into AttachmentsModule.DeleteAttachmentsFromScene() --- .../Region/Framework/Interfaces/IAttachmentsModule.cs | 9 +++++++++ OpenSim/Region/Framework/Interfaces/IScenePresence.cs | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index ce795f1..dd11ded 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -48,6 +48,15 @@ namespace OpenSim.Region.Framework.Interfaces void SaveChangedAttachments(IScenePresence sp); /// + /// Delete all the presence's attachments from the scene + /// + /// + /// This is done when a root agent leaves/is demoted to child (for instance, on logout, teleport or region cross). + /// + /// + void DeleteAttachmentsFromScene(IScenePresence sp, bool silent); + + /// /// Attach an object to an avatar from the world. /// /// diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs index 788b36f..91e4bf2 100644 --- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs @@ -62,9 +62,22 @@ namespace OpenSim.Region.Framework.Interfaces /// A copy of the list. /// /// - /// Do not change this list directly - use methods such as - /// AddAttachment() and RemoveAttachment(). + /// Do not change this list directly - use the attachments module. /// List GetAttachments(); + + /// + /// The scene objects attached to this avatar at a specific attachment point. + /// + /// + /// + List GetAttachments(uint attachmentPoint); + + bool HasAttachments(); + + // Don't use these methods directly. Instead, use the AttachmentsModule + void AddAttachment(SceneObjectGroup gobj); + void RemoveAttachment(SceneObjectGroup gobj); + void ClearAttachments(); } } \ No newline at end of file -- cgit v1.1 From 5c1fa968ab954bec9860023dffc8f68baf3c0620 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 3 Sep 2011 01:11:16 +0100 Subject: Stop NPCs losing attachments when the source avatar takes them off. This was happening because we were using the source avatar's item IDs in the clone appearance. Switch to using the asset IDs of attachments instead for NPCs. The InventoryAccessModule and AttachmentModule had to be changed to allow rezzing of an object without an associated inventory item. Hopefully goes some way towards resolving http://opensimulator.org/mantis/view.php?id=5653 --- .../Framework/Interfaces/IInventoryAccessModule.cs | 56 ++++++++++++++++++++-- .../Region/Framework/Interfaces/IScenePresence.cs | 5 ++ 2 files changed, 57 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces') diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs index da11e61..1904011 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs @@ -54,10 +54,58 @@ namespace OpenSim.Region.Framework.Interfaces /// FIXME: This is not very useful. It would be far more useful to return a list of items instead. /// UUID CopyToInventory(DeRezAction action, UUID folderID, List objectGroups, IClientAPI remoteClient); - - SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, - UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, - bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); + + /// + /// Rez an object into the scene from the user's inventory + /// + /// + /// FIXME: It would be really nice if inventory access modules didn't also actually do the work of rezzing + /// things to the scene. The caller should be doing that, I think. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The SceneObjectGroup rezzed or null if rez was unsuccessful. + SceneObjectGroup RezObject( + IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, + UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); + + /// + /// Rez an object into the scene from the user's inventory + /// + /// + /// FIXME: It would be really nice if inventory access modules didn't also actually do the work of rezzing + /// things to the scene. The caller should be doing that, I think. + /// + /// + /// + /// The item from which the object asset came. Can be null, in which case pre and post rez item adjustment and checks are not performed. + /// + /// The asset id for the object to rez. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The SceneObjectGroup rezzed or null if rez was unsuccessful. + SceneObjectGroup RezObject( + IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart, + UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); + void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); /// diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs index 91e4bf2..8913133 100644 --- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs @@ -46,6 +46,11 @@ namespace OpenSim.Region.Framework.Interfaces IClientAPI ControllingClient { get; } /// + /// What type of presence is this? User, NPC, etc. + /// + PresenceType PresenceType { get; } + + /// /// Avatar appearance data. /// /// -- cgit v1.1