btw, I'm all for the " anti-LLUUID crusade.", just not sure its causing us problems now (but I could be wrong) and think we should think about how to go about it, as LLUUID is used throughout our code. <br><br><b><i>Teravus Ovares <teravus@gmail.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <div>Hey Guys'n Gals.. </div> <div> </div> <div>Digging into Bug number 145 on Mantis.. I discovered profuse and prolific use of the unserializable LLUUID in inventory.. It's used *everywhere*. </div> <div> </div> <div>It's no wonder inventory is spotty and error prone!</div> <div> </div> <div>It's used in InventoryFolderBase</div> <div>It's used in InventoryItemBase</div> <div>It's used in the REST calls</div> <div>All of this data is being transferred over Grid Communications :/</div> <div> </div> <div>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. </div> <div> </div> <div>We all need to take a good look at the grid inventory service and 'fix' all uses of LLUUID.</div> <div> </div> <div>It's *really* easy to use a Guid instead. </div> <div> </div> <div>To go from a System.Guid to a LLUUID, you instantiate a new LLUUID and pass the Guid to it's constructor. </div> <div>ex:</div> <div> </div> <div>Guid gAgentID = 'xxxxxxx-xx-x--x-x--xx';</div> <div> </div> <div>LLUUID AgentID = new LLUUID(gAgentID);</div> <div> </div> <div> </div> <div>To go from a LLUUID to a guid, you use the UUID property of the LLUUID.</div> <div>ex:</div> <div> </div> <div>Guid gAgentID = AgentID.UUID;</div> <div> </div> <div>So, given that
you've got a userID LLUUID.. to get it over grid communications reliably.. you have to turn it into a Guid.</div> <div> </div> <div>requester.BeginPostObject<<strong>Guid</strong>>(_inventoryServerUrl + "/GetInventory/", <strong>userID.UUID</strong>);</div> <div> </div> <div>Then on the receiving side, </div> <div> </div> <div> httpServer.AddStreamHandler(<br> new RestDeserialisehandler<<strong>Guid</strong>, InventoryCollection>("POST",
"/GetInventory/",<br> m_inventoryService.GetUserInventory)); </div> <div> </div> <div>public InventoryCollection GetUserInventory(<strong>Guid userID</strong>)<br> {<br> InventoryCollection invCollection = new InventoryCollection();<br> List<InventoryFolderBase> folders;
<br> List<InventoryItemBase> allItems;<br> if (TryGetUsersInventory(<strong>new LLUUID(userID),</strong> out folders, out allItems))<br> {<br> invCollection.AllItems = allItems; <br> invCollection.Folders = folders;<br> invCollection.UserID = <strong>new LLUUID(userID);</strong><br> }<br> return invCollection;<br> }</div>
<div> </div> <div>Additionally, </div> <div>Any object that encapsulates a LLUUID directly, is NOT serializable... that means.. the objects;</div> <div> </div> <div>InventoyFolderBase</div> <div>and </div> <div>InventoryItemBase</div> <div> </div> <div>Are not serializable because they encapsulate LLUUIDs. This is *bad* :D. They cannot go over Grid Communications reliably.</div> <div> </div> <div>They all need to be changed to Guids, or we'll continue to have spotty inventory.</div> <div> </div> <div> :D</div> <div> </div> <div>I'm mentioning this because it's a big problem.. </div> <div> </div> <div>I don't really know this portion of the code well.. so if I edit it, it's likely to break.. hence the subject.</div> <div> </div> <div>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 </div> <div> </div> <div>Best Regards </div> <div> </div> <div>Tera</div> _______________________________________________<br>Opensim-dev mailing list<br>Opensim-dev@lists.berlios.de<br>https://lists.berlios.de/mailman/listinfo/opensim-dev<br></blockquote><br><p>
<hr size=1> Sent from <a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mail/winter07.html">Yahoo!</a> - a smarter inbox.