diff options
author | Justin Clark-Casey (justincc) | 2011-08-09 03:51:34 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-09 03:51:34 +0100 |
commit | e869eeb0bfc48c769f680970f99e4c67dd5a1a70 (patch) | |
tree | 749440ee4ba12140b708e2fe68e98419710d6ea0 /OpenSim/Region/Framework | |
parent | factor out common notecard caching code from 3 methods. (diff) | |
download | opensim-SC_OLD-e869eeb0bfc48c769f680970f99e4c67dd5a1a70.zip opensim-SC_OLD-e869eeb0bfc48c769f680970f99e4c67dd5a1a70.tar.gz opensim-SC_OLD-e869eeb0bfc48c769f680970f99e4c67dd5a1a70.tar.bz2 opensim-SC_OLD-e869eeb0bfc48c769f680970f99e4c67dd5a1a70.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/INPCModule.cs | 19 |
2 files changed, 26 insertions, 1 deletions
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 | |||
32 | { | 32 | { |
33 | public interface IAvatarFactory | 33 | public interface IAvatarFactory |
34 | { | 34 | { |
35 | /// <summary> | ||
36 | /// Send the appearance of an avatar to others in the scene. | ||
37 | /// </summary> | ||
38 | /// <param name="agentId"></param> | ||
39 | /// <returns></returns> | ||
40 | bool SendAppearance(UUID agentId); | ||
41 | |||
42 | bool SaveBakedTextures(UUID agentId); | ||
35 | bool ValidateBakedTextureCache(IClientAPI client); | 43 | bool ValidateBakedTextureCache(IClientAPI client); |
36 | void QueueAppearanceSend(UUID agentid); | 44 | void QueueAppearanceSend(UUID agentid); |
37 | void QueueAppearanceSave(UUID agentid); | 45 | 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 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | using OpenSim.Framework; | ||
29 | using OpenSim.Region.Framework.Scenes; | 30 | using OpenSim.Region.Framework.Scenes; |
30 | 31 | ||
31 | namespace OpenSim.Region.Framework.Interfaces | 32 | namespace OpenSim.Region.Framework.Interfaces |
@@ -44,6 +45,23 @@ namespace OpenSim.Region.Framework.Interfaces | |||
44 | UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); | 45 | UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); |
45 | 46 | ||
46 | /// <summary> | 47 | /// <summary> |
48 | /// Check if the agent is an NPC. | ||
49 | /// </summary> | ||
50 | /// <param name="agentID"></param> | ||
51 | /// <param name="scene"></param> | ||
52 | /// <returns>True if the agent is an NPC in the given scene. False otherwise.</returns> | ||
53 | bool IsNPC(UUID agentID, Scene scene); | ||
54 | |||
55 | /// <summary> | ||
56 | /// Set the appearance for an NPC. | ||
57 | /// </summary> | ||
58 | /// <param name="agentID"></param> | ||
59 | /// <param name="appearance"></param> | ||
60 | /// <param name="scene"></param> | ||
61 | /// <returns></returns> | ||
62 | bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene); | ||
63 | |||
64 | /// <summary> | ||
47 | /// Move an NPC to a target over time. | 65 | /// Move an NPC to a target over time. |
48 | /// </summary> | 66 | /// </summary> |
49 | /// <param name="agentID">The UUID of the NPC</param> | 67 | /// <param name="agentID">The UUID of the NPC</param> |
@@ -59,7 +77,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
59 | /// <param name="text"></param> | 77 | /// <param name="text"></param> |
60 | void Say(UUID agentID, Scene scene, string text); | 78 | void Say(UUID agentID, Scene scene, string text); |
61 | 79 | ||
62 | |||
63 | /// <summary> | 80 | /// <summary> |
64 | /// Delete an NPC. | 81 | /// Delete an NPC. |
65 | /// </summary> | 82 | /// </summary> |