diff options
author | Oren Hurvitz | 2013-01-22 08:41:32 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-25 04:03:18 +0000 |
commit | 8b4441d940a55da90645580477ece33d15849078 (patch) | |
tree | c68976caa7a0f848d48c999bc13dc6af93c93341 /OpenSim/Region/CoreModules | |
parent | Added missing DynAttrs references in MySQL (diff) | |
download | opensim-SC_OLD-8b4441d940a55da90645580477ece33d15849078.zip opensim-SC_OLD-8b4441d940a55da90645580477ece33d15849078.tar.gz opensim-SC_OLD-8b4441d940a55da90645580477ece33d15849078.tar.bz2 opensim-SC_OLD-8b4441d940a55da90645580477ece33d15849078.tar.xz |
Changed DAMap to be the container of "data stores", which are OSDMaps. Store names must have at least 4 characters.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs index d6fb15b..084fb5f 100644 --- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs | |||
@@ -75,22 +75,23 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule | |||
75 | 75 | ||
76 | protected bool OnSceneGroupMove(UUID groupId, Vector3 delta) | 76 | protected bool OnSceneGroupMove(UUID groupId, Vector3 delta) |
77 | { | 77 | { |
78 | OSDMap attrs = null; | ||
78 | SceneObjectPart sop = m_scene.GetSceneObjectPart(groupId); | 79 | SceneObjectPart sop = m_scene.GetSceneObjectPart(groupId); |
79 | DAMap attrs = sop.DynAttrs; | 80 | if (!sop.DynAttrs.TryGetValue(Name, out attrs)) |
81 | attrs = new OSDMap(); | ||
80 | 82 | ||
81 | lock (attrs) | 83 | OSDInteger newValue; |
82 | { | ||
83 | OSDInteger newValue; | ||
84 | 84 | ||
85 | if (!attrs.ContainsKey("moves")) | 85 | if (!attrs.ContainsKey("moves")) |
86 | newValue = new OSDInteger(1); | 86 | newValue = new OSDInteger(1); |
87 | else | 87 | else |
88 | newValue = new OSDInteger(((OSDInteger)attrs["moves"]).AsInteger() + 1); | 88 | newValue = new OSDInteger(((OSDInteger)attrs["moves"]).AsInteger() + 1); |
89 | 89 | ||
90 | attrs["moves"] = newValue; | 90 | attrs["moves"] = newValue; |
91 | 91 | ||
92 | m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue)); | 92 | sop.DynAttrs[Name] = attrs; |
93 | } | 93 | |
94 | m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue)); | ||
94 | 95 | ||
95 | return true; | 96 | return true; |
96 | } | 97 | } |