[Opensim-dev] Proposal: Introduce key:value pair dictionaries into SOP and PrimitiveBaseShape

Hurliman, John john.hurliman at intel.com
Wed Aug 4 17:23:16 UTC 2010


Does it actually need to hold arbitrary data types, or would the LLSD type system encompass everything you need? It natively handles all the basic C# value types, the domain-specific types in OpenMetaverseTypes.dll (vectors/quaternions), plus arrays and maps. The main benefit you get from using an OSDMap is transparent serialization of arbitrary data. There's no way to serialize Dictionary<string, object> transparently* (aside from digging ourselves back into the .NET serialization hole) so you end up with something like Dictionary<string, ISerializableData> and define methods on the ISerializableData interface for storing and loading an OSDMap anyways. Restricting the type system of data that can be attached to SOG/SOPs also makes memory handling and cleanup more straightforward, since you know there are no unmanaged pointers or special resources such as sockets attached directly to prims that need cleanup before prims are thrown away. Finally, it eases dependency issues since you never have to worry about defining a MyExtendedPrimData class in one assembly and trying to typecast to it in another assembly. With over 90 different assemblies in OpenSim right now this can cause major headaches.

John

> -----Original Message-----
> From: opensim-dev-bounces at lists.berlios.de [mailto:opensim-dev-
> bounces at lists.berlios.de] On Behalf Of Justin Clark-Casey
> Sent: Thursday, July 29, 2010 8:55 AM
> To: opensim-dev at lists.berlios.de
> Subject: Re: [Opensim-dev] Proposal: Introduce key:value pair dictionaries
> into SOP and PrimitiveBaseShape
> 
> On 29/07/10 01:40, Dahlia Trimble wrote:
> > Similar to the OSDMap in libomv?
> 
> Not dissimilar, though the in-memory maps in OpenSim would need to hold
> arbitrary data types.  We couldn't use OSDMap directly unless we were
> happy to serialize objects to and from OSD for every get and set (or change
> the values directly in the OSD representation, which might be an idea).
> 
> >
> >
> > On Wed, Jul 28, 2010 at 2:39 PM, Justin Clark-Casey
> > <jjustincc at googlemail.com <mailto:jjustincc at googlemail.com>> wrote:
> >
> >     Hi there.  Whilst implementing media-on-a-prim, I've been keeping as
> >     much code in the MOAP region module as possible.
> >
> >     I'm quite impressed with how feasible this is.  However, there
> >     remain three major structures where the core of OpenSim has to
> >     understand something about media on a prim.
> >
> >     1)  Database plugins - to get/put values to named database columns
> >     (e.g. prims.MediaURL).
> >     2)  Script functions (e.g. llGetPrimMediaParams()).
> >     3)  Scene objects (PrimitiveBaseShape.Media and
> >     SceneObjectPart.MediaURL).
> >
> >     It's difficult to do anything right now about (1) and (2), but I
> >     believe there is an opportunity to address (3).
> >
> >     What I would like to do is introduce dictionaries into
> >     PrimitiveBaseShape and SceneObjectPart that would supplement
> >     existing fields by storing arbitrary key/value pairs.  So instead of
> >     having to hardcode a new MediaURL property on SceneObjectPart I
> >     could instead get/put the data as something like
> >     SceneObjectPart.Values["MediaURL"].
> >
> >     Thus, the dictionaries can act as blackboards for communication
> >     between plugins and modules without the core of OpenSim having to
> >     get involved.  I think that this would move us a tiny way towards
> >     our vision of being a generic virtual environment platform and away
> >     from hardcoded Second Life specifics, and make it easier to write
> >     more ambitious region modules without additions to core.
> >
> >     Thoughts?
> >
> >     --
> >     Justin Clark-Casey (justincc)
> >     http://justincc.org
> >     http://twitter.com/justincc
> >     _______________________________________________
> >     Opensim-dev mailing list
> >     Opensim-dev at lists.berlios.de <mailto:Opensim-dev at lists.berlios.de>
> >     https://lists.berlios.de/mailman/listinfo/opensim-dev
> >
> >
> >
> >
> > _______________________________________________
> > Opensim-dev mailing list
> > Opensim-dev at lists.berlios.de
> > https://lists.berlios.de/mailman/listinfo/opensim-dev
> 
> 
> --
> Justin Clark-Casey (justincc)
> http://justincc.org
> http://twitter.com/justincc
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev



More information about the Opensim-dev mailing list