[Opensim-dev] So I decided to give this one more shot before I start chopping it up with a chainsaw.......

Teravus Ovares teravus at gmail.com
Fri Dec 14 06:50:06 UTC 2007


Hey Guys'n Gals..

Digging into Bug number 145 on Mantis..    I discovered profuse and prolific
use of the unserializable LLUUID in inventory..    It's used
*everywhere*.

It's no wonder inventory is spotty and error prone!

It's used in InventoryFolderBase
It's used in InventoryItemBase
It's used in the REST calls
All of this data is being transferred over Grid Communications :/

Once again, I restate that the LLUUID is no longer serializable.  It now
implements the IComparable interface which is *not* serializable..
Therefore, it can 'never' be used in any grid communications, period.

We all need to take a good look at the grid inventory service and 'fix' all
uses of LLUUID.

It's *really* easy to use a Guid instead.

To go from a System.Guid to a LLUUID, you instantiate a new LLUUID and pass
the Guid to it's constructor.
ex:

Guid gAgentID = 'xxxxxxx-xx-x--x-x--xx';

LLUUID AgentID = new LLUUID(gAgentID);


To go from a LLUUID to a guid, you use the UUID property of the LLUUID.
ex:

Guid gAgentID = AgentID.UUID;

So, given that you've got a userID LLUUID..      to get it over grid
communications reliably..  you have to turn it into a Guid.

requester.BeginPostObject<*Guid*>(_inventoryServerUrl + "/GetInventory/", *
userID.UUID*);

Then on the receiving side,

 httpServer.AddStreamHandler(
                new RestDeserialisehandler<*Guid*,
InventoryCollection>("POST", "/GetInventory/",

m_inventoryService.GetUserInventory));

public InventoryCollection GetUserInventory(*Guid userID*)
        {
            InventoryCollection invCollection = new InventoryCollection();
            List<InventoryFolderBase> folders;
            List<InventoryItemBase> allItems;
            if (TryGetUsersInventory(*new LLUUID(userID),* out folders, out
allItems))
            {
                invCollection.AllItems = allItems;
                invCollection.Folders = folders;
                invCollection.UserID = *new LLUUID(userID);*
            }
            return invCollection;
        }

Additionally,
Any object that encapsulates a LLUUID directly, is NOT serializable...
that means..   the objects;

InventoyFolderBase
and
InventoryItemBase

Are not serializable because they encapsulate LLUUIDs.  This is *bad* :D.
They cannot go over Grid Communications reliably.

They all need to be changed to Guids, or we'll continue to have spotty
inventory.

 :D

I'm mentioning this because it's a big problem..

I don't really know this portion of the code well..   so if I edit it, it's
likely to break..  hence the subject.

Someone take this on please..   so I don't have to chop it up with a
chainsaw..    grind it down with a tree stump grinder, run it over with a
steam roller and jack-hammer it to itty bitty bite sized serializable
components that can reliably be transferred over grid communications. :D

Best Regards

Tera
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20071214/7bf62794/attachment-0001.html>


More information about the Opensim-dev mailing list