diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/IXAssetDataPlugin.cs (renamed from OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs) | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs b/OpenSim/Data/IXAssetDataPlugin.cs index 659c3a5..74ad6f4 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs +++ b/OpenSim/Data/IXAssetDataPlugin.cs | |||
@@ -26,38 +26,22 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Xml; | ||
30 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenSim.Framework; | ||
31 | 31 | ||
32 | namespace OpenSim.Region.Framework.Scenes.Animation | 32 | namespace OpenSim.Data |
33 | { | 33 | { |
34 | public class AvatarAnimations | 34 | /// <summary> |
35 | /// This interface exists to distinguish between the normal IAssetDataPlugin and the one used by XAssetService | ||
36 | /// for now. | ||
37 | /// </summary> | ||
38 | public interface IXAssetDataPlugin : IPlugin | ||
35 | { | 39 | { |
36 | public Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>(); | 40 | AssetBase GetAsset(UUID uuid); |
37 | public Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>(); | 41 | void StoreAsset(AssetBase asset); |
38 | public Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>(); | 42 | bool ExistsAsset(UUID uuid); |
39 | 43 | List<AssetMetadata> FetchAssetMetadataSet(int start, int count); | |
40 | public AvatarAnimations() | 44 | void Initialise(string connect); |
41 | { | 45 | bool Delete(string id); |
42 | using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) | ||
43 | { | ||
44 | XmlDocument doc = new XmlDocument(); | ||
45 | doc.Load(reader); | ||
46 | foreach (XmlNode nod in doc.DocumentElement.ChildNodes) | ||
47 | { | ||
48 | if (nod.Attributes["name"] != null) | ||
49 | { | ||
50 | string name = (string)nod.Attributes["name"].Value; | ||
51 | UUID id = (UUID)nod.InnerText; | ||
52 | string animState = (string)nod.Attributes["state"].Value; | ||
53 | |||
54 | AnimsUUID.Add(name, id); | ||
55 | AnimsNames.Add(id, name); | ||
56 | if (animState != "") | ||
57 | AnimStateNames.Add(id, animState); | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | } | 46 | } |
63 | } | 47 | } \ No newline at end of file |