[Opensim-dev] dynamic-attributes branch published in Git
Justin Clark-Casey
jjustincc at googlemail.com
Tue Aug 17 01:41:28 UTC 2010
Hi folks. As I mentioned last week, I have now pushed a dynamic-attributes branch to the Git repository. This is work
that I was experimenting with while doing media-on-a-prim.
Essentially, this allows region modules to store and retrieve data on SceneObjectParts and PrimitiveBaseShapes without
adding new attributes to those core classes.
Both SOP and PBS have an OSDMap property (which for various reasons is wrappered by OpenSim.Framework.DAMap). Modules
can insert any class derived from libopenmetaverse's OSD class in this map (this includes OSDMap, OSDString, OSDInteger,
etc. See the StructuredData.cs file in libopenmetavere's OpenMetaverse.StructuredData/ directory for more details.
Persistence is achieved by [de]serializing this map to xml and storing it in a DynAttrs column in the database.
Persistence is implemented for sqlite, mysql and mssql.
There is a small region module in OpenSim.Region.CoreModules/Framework/DynamicAttributes/DAExampleModule.cs that
demonstrates this. Every time an object is moved in the scene, it adds 1 to SOP.DynamicAttributes["moves"] and tells
all users in the region how many times the object has moved. If the server is restarted, the number of moves is
restored on restart.
It didn't take much code to achieve this. However, as discussed previously, there is some awkardness in using OSD in
this way. Any feedback on this or other aspects of dynamic attributes is appreciated.
This branch is a 'technology preview' at most and should not be relied upon in production in any way whatsoever.
--
Justin Clark-Casey (justincc)
http://justincc.org
http://twitter.com/justincc
More information about the Opensim-dev
mailing list