<div>At this moment, I'm using System.Guid for inter region communications with most of the inter-region remoting calls. I think it's safe to say that it's serializable on both Windows and Unix :D</div>
<div> </div>
<div>I'm for this anti-'LLUUID' use movement :D<br> </div>
<div>Best Regards</div>
<div> </div>
<div>Tera<br> </div>
<div><span class="gmail_quote">On 12/14/07, <b class="gmail_sendername">Stefan Andersson</b> <<a href="mailto:stefan@tribalmedia.se">stefan@tribalmedia.se</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>I suggest we eliminate the use if LLUUID outside of the ClientStack entirely; all conversions to and from LLUUID should be in the ClientStack endpoints. This would be a big step towards decoupling from libsl, as many project include it only because of LLUUID.
<br> <br>Now, this said, I warn you that using Guid directly will lead to a LOT of GC on Guids, as they are value types and are copied on all calls. You really want a reference-type wrapper to pass around.<br> <br>A quick solution for this would be to actually start using 'Guid?' which is a short for Nullable<Guid> which incidentally gives us the opportunity to check for .HasValue instead of checking for
Guid.Empty, which can lead to unpredictable behaviour (and vulnerabilities)<br> <br>(Of course you need to do a test to see if Guid? actually serializes ok on mono vs .net)<br> <br>This is also a worthy task for 0.5, and should be rather easily done, actually. Just replace 'LLUUID' with 'Guid?', revert the clientstack and start coping with the errors... ;)
<br> <br>Sincerely,<br>/Stefan<br><br>
<blockquote>
<hr>
Date: Fri, 14 Dec 2007 01:50:06 -0500<br>From: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:teravus@gmail.com" target="_blank">teravus@gmail.com</a><br>To: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:opensim-dev@lists.berlios.de" target="_blank">
opensim-dev@lists.berlios.de</a><br>Subject: [Opensim-dev] So I decided to give this one more shot before I start chopping it up with a chainsaw.......<br><br>
<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></blockquote></div><br>_______________________________________________<br>Opensim-dev mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Opensim-dev@lists.berlios.de">Opensim-dev@lists.berlios.de
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.berlios.de/mailman/listinfo/opensim-dev" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><br><br></blockquote>
</div><br>